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_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_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];}
}

function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+''
win = window.open(mypage, myname, winprops)
}

var MM_contentVersion = 8;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
		var words = navigator.plugins["Shockwave Flash"].description.split(" ");
	    for (var i = 0; i < words.length; ++i)
	    {
		if (isNaN(parseInt(words[i])))
		continue;
		var MM_PluginVersion = words[i]; 
	    }
	var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
/*else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
   && (navigator.appVersion.indexOf("Win") != -1)) {
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
	document.write('on error resume next \n');
	document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
	document.write('</SCR' + 'IPT\> \n');
}*/
if ( MM_FlashCanPlay ) {	
} else{
	//window.location.replace("footer.php");
}

function phpOnlinePopupWindow() {
var url = "http://www.4rentargentina.com/msn/client.php";
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=550,height=400,screenX=150,screenY=150,top=150,left=150')
}

function getHTTPObject() {
  var xmlhttp;

  /*@cc_on

  @if (@_jscript_version >= 5)

    try {

      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");

    } catch (e) {

      try {

        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");

      } catch (E) {

        xmlhttp = false;

      }

    }

  @else

  xmlhttp = false;

  @end @*/

  if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {

    try {

      xmlhttp = new XMLHttpRequest();

    } catch (e) {

      xmlhttp = false;

    }

  }

  return xmlhttp;

}

function habdepall(){	
	if (document.formsearch.baall.checked)	{
		for(i = 0; i < document.formsearch.batotal.value; i++){			
			document.formsearch['ba'+i].checked = false;				
		}//end for 	
	}
}//end deptos all seleccionado

function habdeps(){	
if (document.formsearch.baall.checked){			
	document.formsearch.baall.checked = false;	
}
}//end barrio seleccionado


function editin(fecha){	
//alert("llego");
if (document.form1.baall.checked)
{			
	document.form1.baall.checked = false;	
}
}//end barrio seleccionado

function HandleChange(valor,valor2) {		
		url="http://www.4rentargentina.com/en/includes/changefoto.php?id_f="+valor+"&num="+valor2;
		leer_doc(url);	
}
	
function leer_doc(url) {
if (window.XMLHttpRequest) { // Non-IE browsers
req = new XMLHttpRequest();
req.onreadystatechange = targetDiv;
try {

req.open("GET", url, true);
} catch (e) {
alert(e);
}
req.send(null);
} else if (window.ActiveXObject) { // IE
req = new ActiveXObject("Microsoft.XMLHTTP");
if (req) {
req.onreadystatechange = targetDiv;
req.open("GET", url, true);
req.send();

}
}
}

function targetDiv() {
if (req.readyState == 4) { // Complete
if (req.status == 200) { // OK response
document.getElementById("changefoto").innerHTML = req.responseText;
} else {
alert("Problem: " + req.statusText);
}
}
}


function HandleChangeReal(valor,valor2) {		
		url="http://www.4rentargentina.com/en/includes/changefotoreal.php?id_f="+valor+"&num="+valor2;
		leer_docreal(url);	
}	
function leer_docreal(url) {
if (window.XMLHttpRequest) { // Non-IE browsers
req = new XMLHttpRequest();
req.onreadystatechange = targetDivreal;
try {
req.open("GET", url, true);
} catch (e) {
alert(e);
}
req.send(null);
} else if (window.ActiveXObject) { // IE
req = new ActiveXObject("Microsoft.XMLHTTP");
if (req) {
req.onreadystatechange = targetDivreal;
req.open("GET", url, true);
req.send();

}
}
}
function targetDivreal() {
if (req.readyState == 4) { // Complete
if (req.status == 200) { // OK response
document.getElementById("changefoto").innerHTML = req.responseText;
} else {
alert("Problem: " + req.statusText);
}
}
}


function HandleChangeRoom(valor,valor2) {		
		url="http://www.4rentargentina.com/en/includes/changefotoroom.php?id_f="+valor+"&num="+valor2;
		leer_docroom(url);	
}	
function leer_docroom(url) {
if (window.XMLHttpRequest) { // Non-IE browsers
req = new XMLHttpRequest();
req.onreadystatechange = targetDivroom;
try {
req.open("GET", url, true);
} catch (e) {
alert(e);
}
req.send(null);
} else if (window.ActiveXObject) { // IE
req = new ActiveXObject("Microsoft.XMLHTTP");
if (req) {
req.onreadystatechange = targetDivroom;
req.open("GET", url, true);
req.send();

}
}
}
function targetDivroom() {
if (req.readyState == 4) { // Complete
if (req.status == 200) { // OK response
document.getElementById("changefoto").innerHTML = req.responseText;
} else {
alert("Problem: " + req.statusText);
}
}
}


function HandleTransfer(valor) {		
		switch(valor){
		case "yes":
		url="http://www.4rentargentina.com/booktransfersi.php";
		break;
		case "no":
		url="http://www.4rentargentina.com/booktransferno.php";	
		break;
		}
		leer_doc2(url);	
}
	
function leer_doc2(url) {
if (window.XMLHttpRequest) { // Non-IE browsers
req = new XMLHttpRequest();
req.onreadystatechange = targetDiv2;
try {
req.open("GET", url, true);
} catch (e) {
alert(e);
}
req.send(null);
} else if (window.ActiveXObject) { // IE
req = new ActiveXObject("Microsoft.XMLHTTP");
if (req) {
req.onreadystatechange = targetDiv2;
req.open("GET", url, true);
req.send();

}
}
}

function targetDiv2() {
if (req.readyState == 4) { // Complete
if (req.status == 200) { // OK response
document.getElementById("transfers").innerHTML = req.responseText;
} else {
alert("Problem: " + req.statusText);
}
}
}

function Handlesearch(valor) {		
		switch(valor){
		case "avanzada":
		url="http://www.4rentargentina.com/en/includes/searcherav.php";
		break;
		case "normal":
		url="http://www.4rentargentina.com/en/includes/searcher2.php";
		break;
		case "avanzadaes":
		url="http://www.4rentargentina.com/es/includes/searcherav.php";
		break;
		case "normales":
		url="http://www.4rentargentina.com/es/includes/searcher2.php";
		break;
		case "deptoen":
		url="http://www.4rentargentina.com/en/includes/searcher-depto.php";
		break;
		case "deptoes":
		url="http://www.4rentargentina.com/es/includes/searcher-depto.php";
		break;
		}
		leer_doc3(url);	
}
	
function leer_doc3(url) {
if (window.XMLHttpRequest) { // Non-IE browsers
req = new XMLHttpRequest();
req.onreadystatechange = targetDiv3;
try {
req.open("GET", url, true);
} catch (e) {
alert(e);
}
req.send(null);
} else if (window.ActiveXObject) { // IE
req = new ActiveXObject("Microsoft.XMLHTTP");
if (req) {
req.onreadystatechange = targetDiv3;
req.open("GET", url, true);
req.send();

}
}
}

function targetDiv3() {
if (req.readyState == 4) { // Complete
if (req.status == 200) { // OK response
document.getElementById("busqueda").innerHTML = req.responseText;
} else {
alert("Problem: " + req.statusText);
}
}
}

function HandleTransfer(valor) {		
		switch(valor){
		case "yes":
		url="http://www.4rentargentina.com/en/includes/booktransfersi.php";
		break;
		case "no":
		url="http://www.4rentargentina.com/en/includes/booktransferno.php";	
		break;
		case "si":
		url="http://www.4rentargentina.com/es/includes/booktransfersi.php";
		break;
		case "noo":
		url="http://www.4rentargentina.com/es/includes/booktransferno.php";	
		break;
		}
		leer_doc4(url);	
}
	
function leer_doc4(url) {
if (window.XMLHttpRequest) { // Non-IE browsers
req = new XMLHttpRequest();
req.onreadystatechange = targetDiv4;
try {
req.open("GET", url, true);
} catch (e) {
alert(e);
}
req.send(null);
} else if (window.ActiveXObject) { // IE
req = new ActiveXObject("Microsoft.XMLHTTP");
if (req) {
req.onreadystatechange = targetDiv4;
req.open("GET", url, true);
req.send();

}
}
}

function targetDiv4() {
if (req.readyState == 4) { // Complete
if (req.status == 200) { // OK response
document.getElementById("transfers").innerHTML = req.responseText;
} else {
alert("Problem: " + req.statusText);
}
}
}

function viewdata(valor) {
	if(valor==""){
		document.forms2.callecod.value = "fill street or code";	
	}
}