var xmlhttp = false;

		try {
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e1) {
			try {
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e2) {
				xmlhttp = null;
			}
		}

		if (! xmlhttp) {
			if (typeof XMLHttpRequest != "undefined") {
				xmlhttp = new XMLHttpRequest();
			}
			else {
			xmlhttp = false; }
		}

function chk_buscar() {

show = false ;
if (document.getElementById('sel_cid').value > 0 ) show = true;
if (document.getElementById('sel_prov').value > 0 ) show = true;

show = true ; //vinagi da se pokazva 07.07.2009

if (show) {
	document.getElementById('src').style.display='block';
	document.getElementById('buscar_but').style.display='block';
	}
else {
	document.getElementById('src').style.display='none';
	document.getElementById('buscar_but').style.display='none';
	}
return false;
}

function check_code(id2) {

val2 = document.getElementById('sms_code_'+id2).value ;

if (xmlhttp) {
	document.getElementById('tel_'+id2).innerHTML = "<img src='/loading.gif' border='0' alt='loading' />";
	document.getElementById('ver_tel_'+id2).style.display='none';
		
	xmlhttp.open('GET', '/check_code.php?id=' + id2 + '&'+'code=' + val2 , false) ;
	xmlhttp.send(null);
	document.getElementById('tel_'+id2).innerHTML = "" + xmlhttp.responseText + "";
	answer = xmlhttp.responseText ;
	if (answer.match('answ_err') != null ) document.getElementById('ver_tel_'+id2).style.display='block';
  }
  
return false ;
}


function vote(id2) {
if (xmlhttp) {
	xmlhttp.open('GET', '/vote_tel.php?id=' + id2 , false) ;
	xmlhttp.send(null);
  }
}

function send_sms() {

phone = document.getElementById('phone').value ;
code = document.getElementById('code').value ;
txt = document.getElementById('txt').value ;

if (xmlhttp) {
	document.getElementById('answer').innerHTML = "<img src='/loading.gif' border='0' alt='loading' />";
	xmlhttp.open('GET', '/send_sms.php?phone=' + phone + '&'+'code=' + code + '&'+'txt=' + txt , false) ;
	xmlhttp.send(null);
	document.getElementById('answer').innerHTML = "" + xmlhttp.responseText + "";
  }
}

function sh_dif2() {
if (document.form1.fotos.checked == true) {
	document.getElementById("dif2").style.display='block';
	}
else {
	document.getElementById("dif2").style.display='none';
	}
} //func

function get_citys(elem_id_in , elem_id_out) {
	
val3 = document.getElementById(elem_id_in).value ;

if (xmlhttp) {
	document.getElementById(elem_id_out).innerHTML = "<img src='/loading.gif' border='0' alt='loading' />";
	xmlhttp.open('GET', '/get_citys.php?id=' + val3 , false) ;
	xmlhttp.send(null);
	document.getElementById(elem_id_out).innerHTML = "" + xmlhttp.responseText + "";
  }

document.getElementById(elem_id_out).innerHTML = "" ; // 07.07.2009 maham zona
}

function swp(id , s) {
if (!s) s = "";
document.getElementById('img_box').innerHTML = "<img class='img_box' src='/pic.php?id=" + id + "&s=" + s + "' alt='picture' />";
}


/////////////////////////////////////////////geo begin
    var map = null;
	var geocoder = null;

    //<![CDATA[

    function load() {

      if (GBrowserIsCompatible()) {
        map = new GMap2(document.getElementById("map"), { size: new GSize(400,300) } );
		
        map.addControl(new GMapTypeControl());
        map.addControl(new GLargeMapControl());
//        map.addControl(new GOverviewMapControl());
		
//        map.setCenter(new GLatLng(40,-5), 13, G_NORMAL_MAP);
		
		geocoder = new GClientGeocoder();

//		var point = new GLatLng(40,-5);
//		var marker = new GMarker(point, {draggable: true});

		
      }

    }//func load


    function showAddress(address) {
      if (geocoder) {
        geocoder.getLatLng(
          address,
          function(point) {
            if (!point) {
              //alert(address + " not found");
            } else {
              map.setCenter(point, 13);
//              var marker = new GMarker(point);
//              map.addOverlay(marker);
//              marker.openInfoWindowHtml(address);
            }
          }
        );
      }
    }


    //]]>


/////////////////////////////////////////////geo end

function open_map() {
document.getElementById('map_field').style.display = "block";
}

function text_phone(id) {
return "<div class='pay_field'><img src='http://payment.allopass.com/imgweb/script_iframe/paliers/pal_25.gif' style='border:0px;' alt='' title='' /><!--Para recibir un mensaje con el código de acceso, envíe texto <strong>CODE</strong> al número<sup>*</sup> <strong>27722</strong>.--><br /><br /> Codigo de acceso <input id='sms_code_" + id + "' type='text' size='10' /> <a href='#' onclick='check_code(" + id + "); return false;'>comprobar</a><!--<br /><br /><sub>*Precio 1,39€ con IVA includio.</sub>--></div>";
}

function booking_adv_link() {
//document.location = "http://www.booking.com/index.html?aid=307324&lang=bg";
document.location = "http://eulands.com/%D1%80%D0%B5%D0%B7%D0%B5%D1%80%D0%B2%D0%B0%D1%86%D0%B8%D0%B8";
return false;
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}