function abrirVentana(enlace,nom,param){
		if ((param == undefined) || (param == null)){param="scrollbars=no,toolbar=no,location=no,status=no,menubar=no,width=50,height=50";}
		if ((nom == undefined) || (nom == null)){nom="popup";}
		return window.open(enlace,nom,param);
}

function centerWindow(width,height){
		if (window.innerWidth){
			iiWidth = window.innerWidth;
			iiHeight = window.innerHeight;
		}else{
			iiWidth = document.body.clientWidth;
			iiHeight =document.body.clientHeight;
		}
		iWidth = width - iiWidth;
		iHeight = height - iiHeight;
		iWidth = Math.abs(iWidth);
		//alert("width: "+iWidth+"px, "+iiWidth+"px");
		window.resizeBy(iWidth, iHeight);
		x = (screen.width - iWidth) / 2;
		y = (screen.height - iHeight) / 2; 
		window.moveTo(x,y);
		window.focus();

}

try{
if (!isMotionGallery) isMotionGallery = false;
}catch (e){
	var isMotionGallery = false;
}
window.onload=function() { 
		if (isMotionGallery) fillup(); //MOTION GALLERY pasa imagenes del piso
	  	var w = document.getElementById("bodyContent");
		if (w)
		{
			var h = w.offsetHeight;
			document.getElementById("body1").style.height = h +"px";
			document.getElementById("spaceBlack").style.height = (h-714) +"px";
		}
		objSlide = new slideShow('objSlide', fotos,Caption,"slideshow1");
		objSlide.slide_start();

	  }

/*PROTOTYPE 1.4
window.onload=function() { 
	  	var w = $("bodyContent");
		if (w)
		{
			var h = Element.getHeight("bodyContent");
			$("body1").style.height = h +"px";
			$("spaceBlack").style.height = (h-432) +"px";
		}
	  }*/

/* JQUERY 1.3.2
$(window).load(function(){
	var h = $("#bodyContent").height();
	$("#body1").height(h);
	$("#spaceBlack").height(h-432);
});*/

function fitPic() {
                iWidth = document.images[0].width;
                iHeight = document.images[0].height;
				centerWindow(iWidth,iHeight);
};

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function limpiarForm(){
		document.getElementById("fecha_ini").value = "";
		document.getElementById("fecha_fin").value = "";
		document.getElementById("numPersonas").options[0].selected = true;
}

function lastSearch(){document.location='index.php?buscar=true';}