function rozbal(strURL, divID) {
    var xmlHttpReq = false;
    var self = this;
    strURL = 'http://www.piste-povidky.cz' + strURL;
    //alert(strURL);
    // Mozilla/Safari
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    // IE
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatePopisek(self.xmlHttpReq.responseText, divID);
        }
    }
    self.xmlHttpReq.send(null);
}

function board_update(page, handler, errHandler){
	var xmlhttp;
	
	try {
		// Mozilla / Safari / IE7
		xmlhttp = new XMLHttpRequest();
	} catch (e) {
		// IE
		var XMLHTTP_IDS = new Array('MSXML2.XMLHTTP.5.0',
			'MSXML2.XMLHTTP.4.0',
			'MSXML2.XMLHTTP.3.0',
			'MSXML2.XMLHTTP',
			'Microsoft.XMLHTTP'
		);
		var success = false;
		for (var i=0;i < XMLHTTP_IDS.length && !success; i++) {
			try {
				xmlhttp = new ActiveXObject(XMLHTTP_IDS[i]);
				success = true;
			} catch (e) {}
		}
		if (!success) {
			eval('errHandler()');
			return false;
		}
	}
		
	xmlhttp.open('GET', '/include/akce.php?akce=vypis_diskuzi&page=' + page, true);
	xmlhttp.onreadystatechange = function() {
	if(xmlhttp.readyState == 4) {
		if(xmlhttp.status == 200){
				eval('handler(xmlhttp.responseText)');
			}
		}
	}
	xmlhttp.send(null);
}

function updatePopisek(str, divID){
    //if (document.getElementById(divID).innerHTML =="")
    //alert(divID);
    document.getElementById(divID).innerHTML = str;
    //else document.getElementById(divID).innerHTML = "";
}