function googlesearch(query)
{
window.open('http://www.google.com/search?q='+query+'','_blank','left=30,top=30,width=800,height=650,toolbar=1,scrollbars=1,location=1,resizable=1,menubar=1');
}

function searcher(hol,mit)
{
	//alert(hol);
	if (hol=='google')
	{
	   //document.forms.searchform.action="http://www.google.co.hu";
	   //document.forms.searchform.target="_blank";
	   //document.forms.searchform.task="";
	   window.open('http://www.google.com/search?q='+mit+'','_blank','left=30,top=30,width=800,height=650,toolbar=1,scrollbars=1,location=1,resizable=1,menubar=1');
	   //self.location="index.php";
	}
	else
		if (hol=='ehok')
		{
		//alert(mit);
		window.location="index.php?task=lib/search.php&q="+mit;}

//window.open('http://www.google.com/search?q='+query+'','_blank','left=30,top=30,width=800,height=650,toolbar=1,scrollbars=1,location=1,resizable=1,menubar=1');
}

 function indulo(){
            var szett = new BComplete("hotel_ker",5);
            szett.loadData("scripts/hotels/hotel_jscript.php");     
			}
	function indulo3(){
            var szetto = new BComplete("hotel_ker2",5);
            szetto.loadData("scripts/hotels/hotel_jscript.php");     
			}
function indulo2(){
if (document.getElementById("kmezo"))
{
 var szett = new BComplete("kmezo",5);
			var szett2 = new BComplete("kmezo2",5);
			var szett3 = new BComplete("kmezo3",5);
			var szett4 = new BComplete("kmezo4",5);
            szett.loadData("scripts/hotels/hotel_jscript.php");
			 szett2.loadData("scripts/hotels/hotel_jscript.php");
			  szett3.loadData("scripts/hotels/hotel_jscript.php");
			  szett4.loadData("scripts/hotels/hotel_jscript.php");
}
           
			}

function varoslist(irszam)
{
//alert(varos)
if (irszam!='')
{
	 //document.getElementById("txtHint").innerHTML="";
  
xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	  //var x=parent.document.getElementById("szemelyek")
	  //var value=x.options[x.selectedIndex].value
	var url="lib/varoslist.php";
	url=url+"?irszam="+irszam;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange= function() { showcont(); };
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
	}


/*else{
	utcasel=document.getElementById('utca');
	
	//utcasel.selectedIndex.text='Mindegy';
	utcasel.selectedIndex=0;
	utcasel.disabled=true;
	} */
}


function showcont() 
{ 
if (xmlHttp.readyState==4)
{ 
	citytxt=document.getElementById("city");
	citytxt.value=xmlHttp.responseText
//utcasel.disabled=false
//document.getElementById("utcadiv").innerHTML=xmlHttp.responseText;
}



}

function kepcsekk()
{
//alert(hotel)

	 //document.getElementById("txtHint").innerHTML="";
 
xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	  //var x=parent.document.getElementById("szemelyek")
	  //var value=x.options[x.selectedIndex].value
	  x=document.getElementById("myarticle").getElementsByTagName("img");
	  //alert(x[0].src);
	  //alert(x[0].width);
	var url="lib/kepcsekk.php";
	url=url+"?sid="+Math.random();
	for(i=0;i<x.length;i++)
	{
		var picstring=""+x[i].src+"";
	
		//picstring.replace(/www.ingatlancafeszeged.hu/gi, " ");
		
			//alert(picstring.replace(/http:\/\/www.ingatlancafeszeged.hu/,""))
		url=url+"&pic_"+i+"="+encodeURI((picstring.replace(/http:\/\/www.ingatlancafeszeged.hu/,"")));
		url=url+"&width_"+i+"="+x[i].width;
		url=url+"&height_"+i+"="+x[i].height;
	}
	
	
	url=url+"&mynum="+x.length;
	//alert(url);
	xmlHttp.onreadystatechange= function() { showcont_kep();  };
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
	


/*else{
	utcasel=document.getElementById('utca');
	
	//utcasel.selectedIndex.text='Mindegy';
	utcasel.selectedIndex=0;
	utcasel.disabled=true;
	} */
}

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 showcont_kep() 
{ 
	
if (xmlHttp.readyState==4)
{ 
	//alert(elem)
	//citytxt=document.getElementById(elem);
	//citytxt.value=xmlHttp.responseText
//utcasel.disabled=false
//document.getElementById("utcadiv").innerHTML=xmlHttp.responseText;
}



}

function toggleOpt(tipus)
{
	
	//ha nem hitelkiváltás, akkor nem látszik, vagy nem aktív a következő négy elem a formban
	if (tipus=='hitelkivaltas')
	{
		//alert(document.getElementById('jelenosszeg'))
		document.getElementById('jelenosszeg').disabled=false;
			document.getElementById('jelentipus').disabled=false;
			document.getElementById('honapszam').disabled=false;
			document.getElementById('jelentorl').disabled=false;
			document.getElementById('osszeg').disabled=true;
			document.getElementById('futamido').disabled=true;
			document.getElementById('onero').disabled=true;
		}
		else{
			document.getElementById('jelenosszeg').disabled=true;
			document.getElementById('jelentipus').disabled=true;
			document.getElementById('honapszam').disabled=true;
			document.getElementById('jelentorl').disabled=true;
			document.getElementById('osszeg').disabled=false;
			document.getElementById('futamido').disabled=false;
			document.getElementById('onero').disabled=false;
			}
	}