function isNetscape4() {
	return (navigator.appName == "Netscape" && navigator.appVersion.charAt(0) == "4");
}
function isNetscape6() {
 	return (navigator.appName == "Netscape" && navigator.appVersion.charAt(0) != "4");
}
function isExplorer4() {
	return (!isNetscape4() && !isNetscape6());
}
function isMac() {
	return (navigator.appVersion.lastIndexOf('Mac')!=-1)
}
function checkEnter(event,action) { 	
	var code = 0;
	// es NS4
	if (document.layers) code = event.which;
	else code = event.keyCode;
	if (code==13) return eval(action);
	return code;
}
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();
}
function enviar() {
	c1 = document.frmBusqueda.campo1;
	c2 = document.frmBusqueda.campo2;
	c3 = document.frmBusqueda.campo3;
	msg = ""; 
	if (c1.value=="") msg += "debe seleccionar un precio\n";
	if (c2.value=="") msg += "debe seleccionar un nº de habitaciones\n";
	if (c3.value=="") msg += "debe seleccionar una ubicación";
	if (msg=="") document.frmBusqueda.submit();
	else alert(msg);
}
function averigua () 
{ 
posicion = formulario.precio.value 
valopA = "25%"
valopB = "25%"
valopC = "50%"
document.formulario.opA.value=valopA
document.formulario.opB.value=valopB
document.formulario.opC.value=valopC
} 
function nuevaWin(sUrl, sWidth, sHeight)
{
	ScreenWidth = screen.width;
	ScreenHeight = screen.height;

	sLeft = (String)((parseInt(ScreenWidth) - parseInt(sWidth)) / 2);
	sTop = (String)((parseInt(ScreenHeight) - parseInt(sHeight)) / 2);
	
	popUpWin=window.open(sUrl,"win","dependent=yes,toolbar=no,location=no,Directory=no,Status=no,menubar=no,scrollbars=no,resizable=no,top=" + sTop + ",left=" + sLeft + ",width=" + sWidth + ",height=" + sHeight);
	popUpWin.focus();
}

function nuevaWinScroll(sUrl, sWidth, sHeight)
{
	ScreenWidth = screen.width;
	ScreenHeight = screen.height;

	sLeft = (String)((parseInt(ScreenWidth) - parseInt(sWidth)) / 2);
	sTop = (String)((parseInt(ScreenHeight) - parseInt(sHeight)) / 2);
	
	popUpWin=open(sUrl,"win","dependent=yes,toolbar=no,location=no,Directory=no,Status=no,menubar=no,scrollbars=yes,resizable=no,top=" + sTop + ",left=" + sLeft + ",width=" + sWidth + ",height=" + sHeight);
	popUpWin.focus();
}
function nuevaWinResizable(sUrl, sWidth, sHeight,sRes)
{
	ScreenWidth = screen.width;
	ScreenHeight = screen.height;

	sLeft = (String)((parseInt(ScreenWidth) - parseInt(sWidth)) / 2);
	sTop = (String)((parseInt(ScreenHeight) - parseInt(sHeight)) / 2);
	
	popUpWin=open(sUrl,"win1","dependent=yes,toolbar=no,location=no,Directory=no,Status=no,menubar=no,scrollbars=yes,resizable="+sRes+",top=" + sTop + ",left=" + sLeft + ",width=" + sWidth + ",height=" + sHeight);
	popUpWin.focus();
}

function nuevaWinImprimir(sUrl, sWidth, sHeight)
{
	ScreenWidth = screen.width;
	ScreenHeight = screen.height;

	sLeft = (String)((parseInt(ScreenWidth) - parseInt(sWidth)) / 2);
	sTop = (String)((parseInt(ScreenHeight) - parseInt(sHeight)) / 2);
	
	popUpWin=open(sUrl,"win","dependent=yes,toolbar=yes,location=no,Directory=no,Status=no,menubar=yes,scrollbars=yes,resizable=yes,top=" + sTop + ",left=" + sLeft + ",width=" + sWidth + ",height=" + sHeight);
	popUpWin.focus();
}

// Abre un navegador completo
function nuevaWinFull(sUrl, sWidth, sHeight)
{
	ScreenWidth = screen.width;
	ScreenHeight = screen.height;

	sLeft = 20;
	sTop = 20;
	sHeigth = ScreenHeight-100;
	
	popUpWin=open(sUrl,"","dependent=no,toolbar=yes,location=yes,Directory=yes,Status=yes,menubar=yes,scrollbars=yes,resizable=yes,top=" + sTop + ",left=" + sLeft + ",width=" + sWidth + ",height=" + sHeight);
}