var TipusSzamlalo=0;
var VarosSzamlalo=0;
var FotipusSzamlalo=0;
var TipusHozzaadas="";
var FotipusHozzaadas="";
var MegyeSzamlalo=0;
var MegyeHozzaadas="";
var FoTipSz=0;
///////////////////////////////////////////////////////////////////////////////////////////////////
   function getOtherSelect(megyeid) {
		var postbody="megye="+megyeid;
	    var opts = {
			method: 'post',
	        postBody: postbody,
	        onSuccess: function(transport){
				if (transport.getResponseHeader("Content-Type").match(/text\/html/)) {//XML error
					document.getElementById('varosok_select').innerHTML=transport.responseText;
				} else if(transport.getResponseHeader("Content-Type").match(/text\/error/)) {//error
					alert("hiba: "+transport.responseText);
				} else {
					alert("ismeretlen hiba!!!");
				}
			},
	        on404: function(t) {alert('Error 404: location "' + t.statusText + '" was not found.');},
	        onFailure: function(t) {alert('Error ' + t.status + ' -- ' + t.statusText);}
		}
	    var myAjaxObj=new Ajax.Request("modules/ajax.php", opts);
	}
  function KeruletValasztas(ker)
	  {
		document.getElementById("city").value=ker;
	  }
///////////////////////////////////////////////////////////////////////////////////////////////////
   function GyorsKeresoVaros(megyeid) {
		var postbody="megye="+megyeid;
	    var opts = {
			method: 'post',
	        postBody: postbody,
	        onSuccess: function(transport){
				if (transport.getResponseHeader("Content-Type").match(/text\/html/)) {//XML error
					document.getElementById('varosok_select_gy').innerHTML=transport.responseText;
				} else if(transport.getResponseHeader("Content-Type").match(/text\/error/)) {//error
					alert("hiba: "+transport.responseText);
				} else {
					alert("ismeretlen hiba!!!");
				}
			},
	        on404: function(t) {alert('Error 404: location "' + t.statusText + '" was not found.');},
	        onFailure: function(t) {alert('Error ' + t.status + ' -- ' + t.statusText);}
		}
	    var myAjaxObj=new Ajax.Request("modules/gyvaros.php", opts);
	}
  function KeruletValasztasGy(ker)
	  {
		document.getElementById("city").value=ker;
	  }
///////////////////////////////////////////////////////////////////////////////////////////////////
  function MegyeValasztas(varosv)
	  {
	   for(var VarosSz=0;VarosSz<document.keresesform.county.length;VarosSz++)
			{
			if(document.keresesform.county.options[VarosSz].selected==true)
				{
				MegyeSzamlalo=MegyeSzamlalo+1;
				if(MegyeSzamlalo>1){MegyeHozzaadas=document.keresesform.county.options[VarosSz].value+"_"+MegyeHozzaadas;}
				else{MegyeHozzaadas=document.keresesform.county.options[VarosSz].value}
				}
			}
	  document.getElementById("megyetarolo").value=MegyeHozzaadas;
	  }
	function getOtherSelect2(megyeid) {
		var postbody="megye="+MegyeHozzaadas;
	    var opts = {
			method: 'post',
	        postBody: postbody,
	        onSuccess: function(transport){
				if (transport.getResponseHeader("Content-Type").match(/text\/html/)) {//XML error
					document.getElementById('varosok_select2').innerHTML=transport.responseText;
				} else if(transport.getResponseHeader("Content-Type").match(/text\/error/)) {//error
					alert("hiba: "+transport.responseText);
				} else {
					alert("ismeretlen hiba!!!");
				}
			},
	        on404: function(t) {alert('Error 404: location "' + t.statusText + '" was not found.');},
	        onFailure: function(t) {alert('Error ' + t.status + ' -- ' + t.statusText);}
		}
	    var myAjaxObj=new Ajax.Request("modules/ajax2.php", opts);
		MegyeHozzaadas="";
		MegyeSzamlalo=0;
	}
  function KeruletValasztas2(ker)
	  {
          //nem kell kerület, az a városokban van...
return false;
	   for(var VarSz=0;VarSz<document.keresesform.city.length;VarSz++)
			{
			if(document.keresesform.city.options[VarSz].selected==true)
				{
				VarosSzamlalo=VarosSzamlalo+1;
				if(VarosSzamlalo>1){VarosHozzaadas=document.keresesform.city.options[VarSz].value+"_"+VarosHozzaadas;}
				else{VarosHozzaadas=document.keresesform.city.options[VarSz].value}
				}
			}
		document.getElementById("citytarolo").value=VarosHozzaadas;
		VarosHozzaadas="";
		VarosSzamlalo=0;
	  }
///////////////////////////////////////////////////////////////////////////////////////////////////
   function FoTipusValasztas()
	  {
     var o = document.getElementById('fotipus_reszl');
	   for(FoTipSz=0;FoTipSz<o.length;FoTipSz++)
			{
			if(o.options[FoTipSz].selected==true)
				{
				FotipusSzamlalo=FotipusSzamlalo+1;
				if(FotipusSzamlalo>1){FotipusHozzaadas=o.options[FoTipSz].value+"_"+FotipusHozzaadas;}
				else{FotipusHozzaadas=o.options[FoTipSz].value}
				}
			}
	  document.getElementById("fotipustarolo").value=FotipusHozzaadas;
	  }
   function getOtherSelect3(fotipus) {
		var postbody="fotipus="+FotipusHozzaadas;
	    var opts = {
			method: 'post',
	        postBody: postbody,
	        onSuccess: function(transport){
				if (transport.getResponseHeader("Content-Type").match(/text\/html/)) {//XML error
					document.getElementById('TipusHTML').innerHTML=transport.responseText;
				} else if(transport.getResponseHeader("Content-Type").match(/text\/error/)) {//error
					alert("hiba: "+transport.responseText);
				} else {
					alert("ismeretlen hiba!!!");
				}
			},
	        on404: function(t) {alert('Error 404: location "' + t.statusText + '" was not found.');},
	        onFailure: function(t) {alert('Error ' + t.status + ' -- ' + t.statusText);}
		}
	    var myAjaxObj=new Ajax.Request("modules/tipus.php", opts);
		FotipusHozzaadas="";
		FotipusSzamlalo=0;
	}
	function TipusValasztas(tip)
		{
	   for(var TipSz=0;TipSz<document.keresesform.tipus.length;TipSz++)
			{
			if(document.keresesform.tipus.options[TipSz].selected==true)
				{
				TipusSzamlalo=TipusSzamlalo+1;
				if(TipusSzamlalo>1){TipusHozzaadas=document.keresesform.tipus.options[TipSz].value+"_"+TipusHozzaadas;}
				else{TipusHozzaadas=document.keresesform.tipus.options[TipSz].value}
				}
			}
		document.getElementById("tipus").value=TipusHozzaadas;
		TipusHozzaadas="";
		TipusSzamlalo=0;
		}
///////////////////////////////////////////////////////////////////////////////////////////////////
