function getAjax(){
	var xmlHttp=(typeof(XMLHttpRequest)!="undefined") ? new XMLHttpRequest() : new ActiveXObject("Msxml2.XMLHTTP");
	xmlHttp=(typeof(xmlHttp)=="undefined")? new ActiveXObject("Microsoft.XMLHTTP") : xmlHttp;
	return xmlHttp;
}

function getItemHu(itemId,e){
			e=(!e?window.event:e);
			var b=(e.target?e.target:e.srcElement);
	var xmlHttp=getAjax();
	xmlHttp.onreadystatechange=function(){
		if(xmlHttp.readyState==4){
			var itemProperties=xmlHttp.responseText.split("|");
			document.getElementById("itemlink").href="javascript:nagykep("+itemProperties[1]+")";
			document.getElementById("itemimage").src="item_pics/small/"+itemProperties[1]+".jpg";
			document.getElementById("itemcaption").innerHTML=itemProperties[0];
			document.getElementById("itemfesztav").innerHTML=itemProperties[2];


			var trs=b.parentNode.parentNode.parentNode.parentNode.childNodes;

			for(var i=0;i<trs.length;i++){
			if(trs[i].nodeName=="TR"){
			
			trs[i].style.fontWeight="normal";
			}
			}
			b.parentNode.parentNode.parentNode.style.fontWeight="bold";
		}
	}
	var param="itemId="+itemId;
	xmlHttp.open("POST","getItem.php",true);
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", param.length);
	xmlHttp.setRequestHeader("Connection", "close");
	xmlHttp.send(param);
}
function getItemDe(itemId,e){
			e=(!e?window.event:e);
			var b=(e.target?e.target:e.srcElement);
	var xmlHttp=getAjax();
	xmlHttp.onreadystatechange=function(){
		if(xmlHttp.readyState==4){
			var itemProperties=xmlHttp.responseText.split("|");
			document.getElementById("itemlink").href="javascript:nagykep("+itemProperties[1]+")";
			document.getElementById("itemimage").src="item_pics/small/"+itemProperties[1]+".jpg";
			document.getElementById("itemcaption").innerHTML=itemProperties[0];
			document.getElementById("itemfesztav").innerHTML=itemProperties[2];
			
			var trs=b.parentNode.parentNode.parentNode.parentNode.childNodes;

			for(var i=0;i<trs.length;i++){
			if(trs[i].nodeName=="TR"){
			
			trs[i].style.fontWeight="normal";
			}
			}
			b.parentNode.parentNode.parentNode.style.fontWeight="bold";
		}
	}
	var param="itemId="+itemId;
	xmlHttp.open("POST","getItemDe.php",true);
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", param.length);
	xmlHttp.setRequestHeader("Connection", "close");
	xmlHttp.send(param);
}
function getCategoryListHu(catPage){
	var xmlHttp=getAjax();
	xmlHttp.onreadystatechange=function(){
		if(xmlHttp.readyState==4){
			var kivagas=xmlHttp.responseText.split("***");
			document.getElementById("rightsidecatlist").innerHTML=kivagas[0];
			document.getElementById("lapozo").innerHTML=kivagas[1];
		}
	}
	var param="catPage="+catPage;
	xmlHttp.open("POST","getCategoryList.php",true);
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", param.length);
	xmlHttp.setRequestHeader("Connection", "close");
	xmlHttp.send(param);

}

function getCategoryListDe(catPage){
	var xmlHttp=getAjax();
	xmlHttp.onreadystatechange=function(){
		if(xmlHttp.readyState==4){
			document.getElementById("rightsidecatlist").innerHTML=xmlHttp.responseText;
		}
	}
	var param="catPage="+catPage;
	xmlHttp.open("POST","getCategoryListDe.php",true);
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", param.length);
	xmlHttp.setRequestHeader("Connection", "close");
	xmlHttp.send(param);

}
function nagykep(id){
window.open("nagykep.php?id="+id,null,"height=100,width=100,status=yes,toolbar=no,menubar=no,location=no");
}

function nagykep2(id,szam){
window.open("nagykep2.php?id="+id+"&szam="+szam,null,"height=100,width=100,status=yes,toolbar=no,menubar=no,location=no");
}

function popup(id){
window.open("popup.php?id="+id,null,"height=100,width=100,status=yes,toolbar=no,menubar=no,location=no");
}