function initialize() {

	try {
		httpRequest = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
			httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (oc) {
			httpRequest = null;
		}
	}
	if(!httpRequest && typeof XMLHttpRequest != "undefined") {httpRequest= new XMLHttpRequest();}
	if(!httpRequest) {alert('Nem támogatott böngésző!');return false;}


	// initialize our DHTML history
	dhtmlHistory.initialize();
// subscribe to DHTML history change
// events
	dhtmlHistory.addListener(historyChange);

// if this is the first time we have
// loaded the page...
	if (dhtmlHistory.isFirstLoad() && getID == false) {

		var hash = document.location.hash;
		hash = hash.replace('#','');
		getContent_(hash);

	}
}

         /** Our callback to receive history 
             change events. */
function historyChange(newLocation,historyData) {
	getContent_(newLocation);
}


//////
function processRequest() {
	if (httpRequest.readyState == 4) {
		if(httpRequest.status == 200) {
			var contentXML = httpRequest.responseXML.getElementsByTagName("content")[0];
			var contentText = contentXML.childNodes[0].nodeValue;
			return contentText;
		} else {
			alert("Error loading page\n"+ httpRequest.status +":"+ httpRequest.statusText);
		}
	}
}
//////


//////
function getContent(params) {
	var params;
	params = params.replace('?','');

	getContent_(params);
	dhtmlHistory.add(params,true);

}
//////
function getContent_(params) {
	var params;

	urchinTracker();

	document.getElementById("loading").style.display = "block";
	document.getElementById('page').value = params;
	var url = host+'getContent.php?'+params;
	httpRequest.open("GET",url,true);
	httpRequest.onreadystatechange = function() {
		try {

			if (httpRequest.readyState == 4) {
				if(httpRequest.status == 200) {
					var contentXML = httpRequest.responseXML.getElementsByTagName("content")[0];
					var contentText = contentXML.childNodes[0].nodeValue;
					document.getElementById("centerContent").innerHTML = contentText;
				} else {
					alert("Error loading page\n"+ httpRequest.status +":"+ httpRequest.statusText);
				}
			}

		} catch (e) {/* err02 */}
	};
	httpRequest.send(null);

}
//////






/////
function onLoadComplete() {
	document.getElementById("loading").style.display = "none";
	//document.getElementById('body').style.cursor = 'default';
}
/////



/////
function openSzamlazasiCimCntr() {
	document.getElementById("szamlazasiCimCntr").style.display = "block";
	document.getElementById("szmlazasiCimLink").href = "javascript:closeSzamlazasiCimCntr()";
}
function closeSzamlazasiCimCntr() {
	document.getElementById("szamlazasiCimCntr").style.display = "none";
	document.getElementById("szmlazasiCimLink").href = "javascript:openSzamlazasiCimCntr()";
}
/////



//////
function setImage(ID) {
	var ID;
	url = 'getImageProps.php?id='+ID;
	httpRequest.open("GET",url,true);
	httpRequest.onreadystatechange = function() {
		try {
			if (content = processRequest()) {
				if (content != 'undefined') document.getElementById("termekImageCntr").innerHTML = content;
			}
		} catch (e) {/* err02 */}
	};
	httpRequest.send(null);

}
//////
