
infbox = null;
function updateibox(e) {
	x = (document.all) ? window.event.x + document.body.scrollLeft : e.pageX;
	y = (document.all) ? window.event.y + document.body.scrollTop  : e.pageY;
	if (infbox!=null) {
		infbox.style.left = (x + 15) + "px";
		infbox.style.top 	= (y + 15) + "px";
	}
}
function showibox(id){
	infbox=document.getElementById(id);
	infbox.style.display="block";
}
function hideibox() {
	infbox.style.display="none";
}
function opendetails(id){
	window.open( "kiegeszito.php?id="+id ,"popper","width=580,height=580,directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=no");
}
function openbigpic(id){
	window.name = "main";
	window.open( "image.php?id="+id ,"popper","width=580,height=580,directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=no");
}
function openbigpic2(kep){
	window.open( "image.php?kep="+kep ,"popper","width=580,height=580,directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=no");
}
function openclothes(id){
	window.open( "ruhazat.php?id="+id ,"popper","width=580,height=580,directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=yes");
}
function openvidplayer(id){
	window.open( "video.php?file="+id ,"popper","width=360,height=350,directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=yes");
}
function GimmeXmlObj() {
	var req = false;
	// branch for IE/Windows ActiveX version
	if(window.ActiveXObject){
		try {
			req = new ActiveXObject("Msxml2.XMLHTTP");
		}catch(e){
			try {
				req = new ActiveXObject("Microsoft.XMLHTTP");
			}catch(e){
				req = false;
			}
		}
	// branch for native XMLHttpRequest object
	}else if(window.XMLHttpRequest){
		try{
			req = new XMLHttpRequest();
		}catch(e){
			req = false;
		}
	}
	return req;
}
function processReqChange(req) {
	// only if req shows "loaded"
	if(req.readyState == 4){
		// only if "OK"
		if (req.status == 200) {
			return req.responseText;
		}else{
			return '<option>->Hiba!<-</option>';
		}
	}
	return "";
}
function xselect_changed(num,val){
	var x,to;
	x=xlista[num];
	to=document.kategselect.elements["xselectvalue_"+num];
	if(to==null) return;
	if(val==-1) val=to.value;
	else to.value=val;
	x.open("GET",xtarget+"?type="+num+"&id="+val,true);
	x.onreadystatechange=function(){
		var ret=processReqChange(x);
		if(ret) document.getElementById("xselectarea_"+num).innerHTML='<select class="formSelect" style="width:250px;" onChange="xselect_changed(\''+num+'\',this.value);">'+ret+'</select>';
	};
	x.send(null);
}

