var xmlHttp
var thd
function showSite(page, thd, wheres, s1, s2,s3,s4,s5,s6,s7,limit)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 } 
var url=page+".php"
url=url+"?thd="+thd+"&wheres="+wheres+"&search1="+s1+"&search2="+s2+"&search3="+s3+"&search4="+s4+"&search5="+s5+"&search6="+s6+"&search7="+s7+"&lim="+limit
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange= function() { stateChanged(thd);}; 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)	
}

function stateChanged(thd) { 

 if (xmlHttp.readyState==1) {document.getElementById(thd).innerHTML='betöltés, aktualizásás'}
 if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
	document.getElementById(thd).innerHTML=xmlHttp.responseText ; 	
	
	function rs(objektum){
		var scrtg = objektum.getElementsByTagName('script');
		for(var nr=0;nr < scrtg.length; nr++) {
			eval(scrtg[nr].innerHTML);
		}
	}
	rs(document.getElementById(thd)); 
 } 
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 //Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}


function vissza()	{
		window.history.back(1);
}


function accept_check(){	
	if (document.forms.sreg.registration.disabled == true){
		document.forms.sreg.registration.disabled = false;
	}else{document.forms.sreg.registration.disabled = true;}
}


function OpenPopup(htmname, winname, xs, ys, scr) {
	eval (winname+" = window.open(htmname, winname, 'location=0,resizable=0,status=0,titlebar=1,toolbar=0,directories=0,menubar=0,scrollbars="+scr+",screenX=0,screenY=0,width="+xs+",height="+ys+"');");  eval(winname+'.focus();'); 
}

function cnfm1(todo, wheres, schtime){
	//window.alert(todo+ wheres+ schtime);
	showSite('schedule',document.getElementById('"sch1'), todo, wheres, schtime);
}
function fill(){
	document.getElementById('szlaname').value=document.getElementById('szallname').value;
	document.getElementById('szlaplz').value=document.getElementById('szallplz').value;
	document.getElementById('szlaort').value=document.getElementById('szallort').value;
	document.getElementById('szlastr').value=document.getElementById('szallstr').value;
}
