
initHttpRequest();

function initHttpRequest() {
	host = 'http://www.xpressdigital.hu/';
	if (window.ActiveXObject) {
		httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
	} else if (window.XMLHttpRequest) {
		httpRequest = new XMLHttpRequest();
	}
}
//////

//////
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 setImage(ID) {
	var ID;
	url = 'getImageProps.php?id='+ID;
	httpRequest.open("GET",url,true);
	httpRequest.onreadystatechange = function() {
		if (content = processRequest()) {
			if (content != 'undefined') document.getElementById("termekImageCntr").innerHTML = content;
		}
	};
	httpRequest.send(null);

}
//////


//////
function getContent(params) {
	var params;

	//if (params) location.href=location.pathname+'#'+params;

	var url = host+'getContent.php'+params;
	httpRequest.open("GET",url,true);
	httpRequest.onreadystatechange = function() {
		if (content = processRequest()) {
			if (content != 'undefined') document.getElementById("rightContent").innerHTML = content;
		}
	};
	httpRequest.send(null);

}
//////


/////
function setHistoryPage(params) {
	//alert(params);
}
/////


//////
function insertCart(ID) {
	var ID;
	var num = document.getElementById("tcv_"+ID).value;

	//alert(num);

}
//////


//////
function blockOpen(id,obj,oid,oobj) {
var id;
var a = document.getElementById(obj);
var oid;
var oa = document.getElementById(oobj);

document.getElementById(id).style.display = 'block';
a.href = 'javascript:blockClose(\''+id+'\',\''+obj+'\',\''+oid+'\',\''+oobj+'\')';
a.innerHTML = '<img src="templates/css/close.png" width="14" height="11" alt="Bezár" border="0">';

document.getElementById(oid).style.display = 'none';
oa.href = 'javascript:blockOpen(\''+oid+'\',\''+oobj+'\',\''+id+'\',\''+obj+'\')';
oa.innerHTML = '<img src="templates/css/open.png" width="14" height="11" alt="Kinyit" border="0">';


}
/////

//////
function blockClose(id,obj,oid,oobj) {
var id;
var a = document.getElementById(obj);
var oid;
var oa = document.getElementById(oobj);


document.getElementById(id).style.display = 'none';
a.href = 'javascript:blockOpen(\''+id+'\',\''+obj+'\',\''+oid+'\',\''+oobj+'\')';
a.innerHTML = '<img src="templates/css/open.png" width="14" height="11" alt="Kinyit" border="0">';

document.getElementById(oid).style.display = 'block';
oa.href = 'javascript:blockClose(\''+oid+'\',\''+oobj+'\',\''+id+'\',\''+obj+'\')';
oa.innerHTML = '<img src="templates/css/close.png" width="14" height="11" alt="Bezár" border="0">';

}
/////


/////
function clearSearchText(obj) {
	var obj;
	obj.value = '';
}
/////

/////
function checkSend() {

	var a = document.getElementById('keresesIN');
	if (a.value == 'keresendő szöveg...') {
		a.value = '';
	}
}
/////
