var calculando = null;
var url = "";
var insubmit = 0;
function cargando_stop(opc){
    if (insubmit == 0){
        //alert(opc);
        document.listadoForm.opc.value = opc;
        document.listadoForm.submit();
        //alert("document.linksubmit.href: [" + document.getElementsByName('linksubmit').href + "]");
        document.getElementsByName('linksubmit').href = '#';
        //alert("document.linksubmit.href: [" + document.getElementsByName('linksubmit').href + "]");
        //eval("document.linksubmit.href='#'");
        insubmit = 1;
    }
}

function enviarConOpcion_stop(opc){
    if (insubmit == 0){
        document.listadoForm.opc.value=opc;
        document.listadoForm.submit();
        eval("linksubmit.href='#'");
        insubmit = 1;
    }
}
function cargando_btn_stop(opc,btn){
    if (insubmit==0){
        document.listadoForm.opc.value=opc;
        document.listadoForm.submit();
        btn.disabled=true;
        insubmit=1;
    }
}
function enviarConOpcion(opc){
    document.listadoForm.opc.value=opc;
    document.listadoForm.submit();
}
function cargando(opc){
    document.listadoForm.opc.value=opc;
    document.listadoForm.submit();
    //carga = open("cargando.jsp","cargando","top=400,left=5,width=590,height=50");
    //carga.focus();
}
function cargando2(_url){
    url=_url;
    document.location.href=url;
    //carga = open("cargando.jsp","cargando","top=400,left=5,width=590,height=50");
    //carga.focus();
}
function enviar(){
    if (url=="") document.listadoForm.submit();
    else document.location.href=url;
}
function cerrarCargando(){
    //var nomRecurs = document.referrer.substring(document.referrer.lastIndexOf('/')+1,document.referrer.indexOf('.jsp'));
    //if ((nomRecurs=="disponibilidad_filtro") || (nomRecurs==""))
    //{
    //carga = open("","cargando","top=400,left=5,width=0,height=0");
    //carga.close();
    //}
}
function informacion(src){
    window.open(src,"informacion","top=100,left=100,width=600,height=225,toolbar=no,scrollbars=yes,resizable=yes");
}
function informacion_desglose(src,ses){
    window.open(src,"informacion"+ses,"top=100,left=100,width=605,height=300,toolbar=no,scrollbars=yes,resizable=yes");
}
function printBonoPropio(localizador){
    bono = open("/interfaz/bonoreserva.jsp?msghp=1&hotel=0&localizador="+localizador,"cargando","scrollbars=yes,top=100,left=100,width=680,height=550,toolbar=yes,resizable=yes");
    //bono = open("print_bono.jsp?localizador="+localizador,"cargando","scrollbars=yes,top=100,left=100,width=680,height=550,toolbar=yes,resizable=yes");
}
function printBonoPropioPDF(localizador){
    bono = open("/interfaz/bonoreservaPDF.jsp?msghp=1&hotel=0&localizador="+localizador+"&ext=.pdf","cargando","scrollbars=yes,top=100,left=100,width=680,height=550,toolbar=yes,resizable=yes");
}
function printBonoDemo(localizador){
    bono = open("/interfaz/print_bono_demo.jsp?localizador="+localizador,"cargando","scrollbars=yes,top=100,left=100,width=680,height=550,toolbar=yes,resizable=yes");
}
function printBonoAjeno(localizador){
    document.location.href="/interfaz/bono_ajeno.jsp?localizador="+localizador;
}

function printBonoBeroni(localizador){
    oNewWindow2  =  open("bonoBeroni.jsp?localizador="+localizador, "cargando2" , "scrollbars=no, top=10, left=10, width=620, height=200, toolbar=no,  resizable=no, menubar=no");

}

function compruebaFP(){
    if (window.reservaform.fpago.value==12){
        window.reservaform.tipo_tarjeta.disabled=false;
        window.reservaform.ntarjeta.disabled=false;
        window.reservaform.mescaducidad.disabled=false;
        window.reservaform.anocaducidad.disabled=false;
        window.reservaform.titular.disabled=false;
        window.reservaform.cvv.disabled=false;
    }
    else {
        window.reservaform.tipo_tarjeta.disabled=true;
        window.reservaform.ntarjeta.disabled=true;
        window.reservaform.mescaducidad.disabled=true;
        window.reservaform.anocaducidad.disabled=true;
        window.reservaform.titular.disabled=true;
        window.reservaform.cvv.disabled=true;
        window.reservaform.ntarjeta.value="";
        window.reservaform.titular.value="";
        window.reservaform.cvv.value="";
    }
}

function avisaTPV(idioma){
    if (window.reservaform.fpago.value==250) {
        if(idioma == 1)
            alert("Tras rellenar el listadoForm de la Reserva, pulse RESERVAR");
        else if (idioma == 2)
            alert("After filling up the form of the Reserve, press BOOK");
        else if (idioma == 3)
            alert("Après avoir rempli le formulaire de la Réserve, poussez RÉSERVER");
        else if (idioma == 4)
            alert("Nachdem dem Füllen herauf die Form der Reserve, betätigen Sie sich, RESERVIERUNG");
        else if (idioma == 5)
            alert("Dopo essere riempitsi sulla forma della riserva, premi PRENOTARE");
        else if (idioma == 6)
            alert("Após o enchimento acima do formulário da reserva, pressione RESERVAR");
        else
            alert("Tras rellenar el listadoForm de la Reserva, pulse RESERVAR");
    }
}

function compruebaFPAvisaTPV(idioma)
{
    compruebaFP();
    avisaTPV(idioma);
}

function submitFP(form,btn,mb)
{
    var todoOk = false;

    var codcli = eval("form.codcli")==null?"1":form.codcli.value;
    var email = eval("form.email")==null?"1":form.email.value;
    var telefono = eval("form.telefono")==null?"1":form.telefono.value;
    var bonoext = eval("form.nbono")==null?"1":form.nbono.value;
    var bonoobl = eval("form.bono_obligatorio")==null?"N":form.bono_obligatorio.value;

    var existeNombre = form.nombre;
    //alert(existeNombre);

    if (window.reservaform.fpago.value==12){
        if (CheckCardNumber(form)){
            if ((bonoext.length == 0) && (bonoobl=="S"))
            {
                alert("Introduzca el número de bono de su agencia o número de expediente. Gracias.");
            }
            else if ((email.length == 0)&&(telefono.length == 0))
            {
                alert("Introduzca email o telefono de contacto. Gracias.");
            }
            //else if((form.titular.value.length == 0)||(form.nombre.value.length == 0)||(form.apellidos.value.length == 0)) {
            //    alert(literales[524]);
            //}
            else if((form.titular.value.length == 0)){
                alert(literales[524]);
            }
            //else if(existeNombre){
            //    if((form.nombre.value.length == 0)||(form.apellidos.value.length == 0)) {
            //        alert(literales[524]);
            //    }
            //}
            else if(existeNombre && ( form.nombre.value.length == 0 || form.apellidos.value.length == 0 )) {
                alert(literales[524]);
            }
            else if(form.cvv.value.length == 0) {
                alert('¿¿¿ CVV/CVC/DC ????');
            }
            //else if ((codcli==1)&&(email.length<2)) alert("¿¿¿ Email ????");
            else{
                todoOk = true;
                //btn.disabled=true;
                //form.submit();
            }
        }
    }
    else {
        if ((bonoext.length == 0) && (bonoobl=="S")){
            alert("Introduzca el número de bono de su agencia o número de expediente. Gracias.");
        }
        else if((email.length == 0) && (telefono.length == 0)){
            alert("Introduzca email o telefono de contacto. Gracias.");
        }
        else if(existeNombre && ((form.nombre.value.length == 0) || (form.apellidos.value.length == 0)) ){
            //if((form.nombre.value.length == 0) || (form.apellidos.value.length == 0)){
            alert(literales[524]);
            //}
        }
        //else if ((codcli.length > 0)&&(email.length < 1)) alert("¿¿¿ Email ????");
        else{
            todoOk = true;
            //btn.disabled=true;
            //form.submit();
        }
    }
    //alert(existeNombre.value);
    if ((window.reservaform.fpago.value == 26) && (todoOk == true)){
        if (codcli < 2){
            alert("¿¿¿ Código Hotusa Plus ????");
            todoOk = false;
        }
        else if (email.length < 2) {
            alert("¿¿¿ Email ????");
            todoOk = false;
        }
    }

    var datos = '';
    var numOcu = 0;
    for(var i=0; i<form.length; i++){
        var sName = form[i].name;
        if(sName.substring(0,12) == 'OCUPANT_NOM_'){
            var numOcuAux = sName.substring(12,sName.length);
            if(parseInt(numOcuAux) > parseInt(numOcu)){
                numOcu = numOcuAux;
            }
        }
    }

    //alert('Cuantos ocupantes hay: [' + numOcu + "]");
    for(var i=0; i < numOcu; i++){
        //alert('i: [' + i + "]");
        var nom = eval('form.OCUPANT_NOM_' + (i+1) + '.value');
        var ape1 = eval('form.OCUPANT_APE1_' + (i+1) + '.value');
        var ape2 = eval('form.OCUPANT_APE2_' + (i+1) + '.value');
        var edat = eval('form.OCUPANT_EDAT_' + (i+1) + '.value');
        if(nom == ''){
            alert("Introduzca nombre del ocupante " + (i+1));
            eval('form.OCUPANT_NOM_' + (i+1) + '.focus();');
            todoOk = false;
            break;
        }
        if(ape1 == ''){
            alert("Introduzca primer apellido del ocupante " + (i+1));
            eval('form.OCUPANT_APE1_' + (i+1) + '.focus();');
            todoOk = false;
            break;
        }
        if(ape2 == ''){
            ape2 = '--';
            //todoOk = false;
            //break;
        }
        if(edat == ''){
            alert("Introduzca edad del ocupante " + (i+1));
            eval('form.OCUPANT_EDAT_' + (i+1) + '.focus();');
            todoOk = false;
            break;
        }
        else{
            var CheckEdat  = parseInt(edat);
            if(isNaN(CheckEdat)){
                alert("Introduzca edad del ocupante " + (i+1));
                eval('form.OCUPANT_EDAT_' + (i+1) + '.value = \'\';');
                eval('form.OCUPANT_EDAT_' + (i+1) + '.focus();');
                todoOk = false;
                break;
            }
        }
        nom = nom.replace('\'','´');
        ape1 = ape1.replace('\'','´');
        ape2 = ape2.replace('\'','´');
        datos = datos + nom + '#' + ape1 + '#' + ape2 + '#' + edat + '@';
    }

    //form.datosOcupantes.value = datos_nom + '@' + datos_ape1 + '@' + datos_ape2 + '@' +  datos_edad + '@';
    form.datosOcupantes.value = datos;
    //alert(datos);
    //todoOk = false;

    if (todoOk){
        if (window.reservaform.fpago.value == 60){
            btn.disabled = true;
            hll = open("oficina_select.jsp","SeleccionarAgencia","left=35,top=20,width=630,height=475,resizable=no,scrollbars=yes");
        }
        else{
            if (mb == 1){
                abrePantallaConfirmacionDatos(form);
            }
            else {
                btn.disabled = true;
                form.submit();
            }
        }
    }


}

function abrePantallaConfirmacionDatos(form)
{
    parametros = '?nombre='+form.nombre.value;
    parametros = parametros +'&apellidos='+form.apellidos.value;
    if (form.nbono!=undefined){
        parametros = parametros +'&nbono='+form.nbono.value;
    } else {
        parametros = parametros +'&nbono=';
    }
    parametros = parametros +'&observaciones='+form.observaciones.value;
    if (form.tipo_tarjeta!=undefined){
        parametros = parametros +'&tipo_tarjeta='+form.tipo_tarjeta.value;
    } else {
        parametros = parametros +'&tipo_tarjeta=';
    }
    if (form.ntarjeta!=undefined){
        parametros = parametros +'&ntarjeta='+form.ntarjeta.value;
    } else {
        parametros = parametros +'&ntarjeta=';
    }
    if (form.titular!=undefined){
        parametros = parametros +'&titular='+form.titular.value;
    } else {
        parametros = parametros +'&titular=';
    }
    if (form.anocaducidad!=undefined){
        parametros = parametros +'&anocaducidad='+form.anocaducidad.value;
    } else {
        parametros = parametros +'&anocaducidad=';
    }
    if (form.mescaducidad!=undefined){
        parametros = parametros +'&mescaducidad='+form.mescaducidad.value;
    } else {
        parametros = parametros +'&mescaducidad=';
    }
    parametros = parametros + '&fpago='+form.fpago.value;
    newfic=open('previo_make_reserva.jsp'+parametros,'previo','scrollbars=yes,resizable=no,top=10,left=10,width=500,height=340');
}

function obreFichaURL(url)
{
    newfic=open(url,'ficha','top=10,left=10,width=800,height=440,scrollbars=yes');
}
function enviar_consulta()
{
    if (document.listadoForm.dem_nom.value=="") { document.listadoForm.dem_nom.focus(); }
    else if ((document.listadoForm.dem_tel.value=="") && (document.listadoForm.dem_mail.value=="")) { document.listadoForm.dem_tel.focus(); }
    else if (document.listadoForm.dem_tit.value=="") { document.listadoForm.dem_tit.focus(); }
    else { document.listadoForm.submit(); }
}
function openWinBonoEmail(loc)
{
    bnemfr=open('/interfaz/bono_email_form.jsp?localizador='+loc,'bonemlfrm','top=200,left=300,width=150,height=100');
}
function openWinBonoSPEmail(loc,codserv,serv)
{
    bnemfr=open('/interfaz/bono_email_form.jsp?codserv='+codserv+'&serv='+serv+'&localizador='+loc,'bonemlfrm','top=200,left=300,width=150,height=100');
}
function openWinBonoEmail2(loc,xsl)
{
    // BONO EMAIL EUROSTARS
    bnemfr=open("/interfaz/bono_email_form.jsp?hotel=1&secacc=20597&xsl="+xsl+"&localizador="+loc,"bonemlfrm","top=200,left=300,width=150,height=100");
}
function openCalendari(field)
{
    calen=open('/interfaz/calendari.jsp?field='+field,'calend','top=200,left=300,width=150,height=195');
}

// R.J.A. 1.12.2003
function mostrar_texto_dia(){
    if ( (valida_data(document.listadoForm.diaFechaEntrada.value, document.listadoForm.mesFechaEntrada.value, document.listadoForm.anyFechaEntrada.value))){
        var d=new Date(document.listadoForm.anyFechaEntrada.value, document.listadoForm.mesFechaEntrada.value-1, document.listadoForm.diaFechaEntrada.value,0,0,0);
                var weekday = textdays.split("#");
        //var weekday=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
                tfecha = weekday[d.getDay()];
                span1.innerHTML=tfecha;
        }
        // El día no se muestra porque no existe. (e.g. 30 de febrero)
        else{
            span1.innerHTML="";
        }

    if ((valida_data(document.listadoForm.diaFechaSalida.value, document.listadoForm.mesFechaSalida.value, document.listadoForm.anyFechaSalida.value))){
        var d=new Date(document.listadoForm.anyFechaSalida.value, document.listadoForm.mesFechaSalida.value-1, document.listadoForm.diaFechaSalida.value,0,0,0);
                var weekday = textdays.split("#");
                tfecha = weekday[d.getDay()];
                span2.innerHTML=tfecha;
        }
        // El día no se muestra porque no existe. (e.g. 30 de febrero)
        else{
            span2.innerHTML="";
        }

}


function selec_data_entrada(dia,mes,any)
{
    document.listadoForm.diaFechaEntrada.selectedIndex = dia-1;
    document.listadoForm.mesFechaEntrada.selectedIndex = mes-1;
    i_any = any-document.listadoForm.anyFechaEntrada.options[0].value;
    if (i_any<0) i_any=0;
    if (i_any>2) i_any=2;
    document.listadoForm.anyFechaEntrada.selectedIndex = i_any;
    calcula_dies();
}
function selec_data_salida(dia,mes,any)
{
    document.listadoForm.diaFechaSalida.selectedIndex = dia-1;
    document.listadoForm.mesFechaSalida.selectedIndex = mes-1;
    i_any = any-document.listadoForm.anyFechaSalida.options[0].value;
    if (i_any<0) i_any=0;
    if (i_any>2) i_any=2;
    document.listadoForm.anyFechaSalida.selectedIndex = i_any;
    calcula_dies();
}

function calcula_dies()
{

//    mostrar_texto_dia();
    if ( (valida_data(document.listadoForm.diaFechaEntrada.value, document.listadoForm.mesFechaEntrada.value, document.listadoForm.anyFechaEntrada.value)) && (valida_data(document.listadoForm.diaFechaSalida.value, document.listadoForm.mesFechaSalida.value, document.listadoForm.anyFechaSalida.value)) )
    {
        var data_ini = new Date(document.listadoForm.anyFechaEntrada.value, document.listadoForm.mesFechaEntrada.value-1, document.listadoForm.diaFechaEntrada.value,0,0,0);
        var data_fi = new Date(document.listadoForm.anyFechaSalida.value, document.listadoForm.mesFechaSalida.value-1, document.listadoForm.diaFechaSalida.value,0,0,0);
        var dies = Math.round((data_fi.getTime()-data_ini.getTime())/86400000);
        if ((dies<0) || (dies>15))
        {
            //document.listadoForm.noches2.size=15;
            //document.listadoForm.noches2.value="ERROR (1-7)";
            document.listadoForm.noches2.value="";
        }
        else
        {
            //document.listadoForm.noches2.size=1;
            document.listadoForm.noches2.value=dies;
        }
    }
    else document.listadoForm.noches2.value="";
    //alert(dies);
}

// R.J.A. 1.12.2003
function cambio_fecha_entrada()
{
    if ( (valida_data(document.listadoForm.diaFechaEntrada.value, document.listadoForm.mesFechaEntrada.value, document.listadoForm.anyFechaEntrada.value))){
        var d=new Date(document.listadoForm.anyFechaEntrada.value, document.listadoForm.mesFechaEntrada.value-1, document.listadoForm.diaFechaEntrada.value,0,0,0);
        var d3=new Date(d.getYear(), d.getMonth(), d.getDate()+1,0,0,0);
        document.listadoForm.diaFechaSalida.value = d3.getDate();
        document.listadoForm.mesFechaSalida.value = d3.getMonth()+1;
        document.listadoForm.anyFechaSalida.value = d3.getYear();
    }
    calcula_dies();
}

// R.J.A. 1.12.2003
function cambio_fecha_salida()
{
    calcula_dies();
}


function verEventos(idioma)
{
    var codpais = new String();
    var codprovincia = new String();
    var codest = new String();
    codpais = document.listadoForm.pais.value;
    codprovincia = document.listadoForm.provincia.value;
    if (codprovincia == ''){
        codest = codpais;
    }else {codest = codprovincia;}
    window.open("eventos.jsp?codest="+codest+"&idioma="+idioma,"eventos","top=100,left=100,width=500,height=225,toolbar=no,scrollbars=yes,resizable=yes");
}

function asignar_pack(codhot,hotname,divisa,precio,sreg)
{
    opener.location.href="/interfaz/packs/packs_central.jsp?opc=1&codhot="+codhot+"&div="+divisa+"&prec="+precio+"&sreg="+sreg;
    document.close();
}
function iniciar_pack(codhot,hotname,divisa,precio,sreg)
{
    //pack = open("/interfaz/packs/packs_hoteles.jsp?opc=5&codhot="+codhot+"&div="+divisa+"&prec="+precio,'pack_','top=0,left=0,width=800,height=600');
    document.location.href="/interfaz/packs/packs_central.jsp?opc=5&codhot="+codhot+"&div="+divisa+"&prec="+precio+"&sreg="+sreg;
}
function openCnfDispServiProve()
{
    document.listadoForm.codprove.value = proveidors[document.listadoForm.sel_provs.selectedIndex].cobol;
    document.listadoForm.codserviprove.value =document.listadoForm.sel_servs.options[document.listadoForm.sel_servs.selectedIndex].value;
    //document.listadoForm.cant.value = cant;
    document.listadoForm.opc.value= 2;
    document.listadoForm.diaspac.value=proveidors[document.listadoForm.sel_provs.selectedIndex].servicios[document.listadoForm.sel_servs.selectedIndex].dias;
    document.listadoForm.regimen.value=proveidors[document.listadoForm.sel_provs.selectedIndex].servicios[document.listadoForm.sel_servs.selectedIndex].serv;
    document.listadoForm.tipohab.value=proveidors[document.listadoForm.sel_provs.selectedIndex].servicios[document.listadoForm.sel_servs.selectedIndex].tipo;
    cnfdispsp=open('about:blank','cnfdispsp_','top=200,left=300,width=500,height=255');
    document.listadoForm.submit();
}
function asignar_servicio(precio,divisa,codcobol)
{
    opener.opener.location.href="/interfaz/packs/packs_central.jsp?opc=6&prec="+document.listadoForm.precio.value+"&div="+document.listadoForm.divisa.value+"&codcobol="+codcobol;
    //opener.close();
    opener.focus();
    document.close();
}
function mashabs(src)
{
    window.open(src,"mashabs","top=20,left=100,width=750,height=550,toolbar=no,scrollbars=yes,resizable=yes");
}
function show_icons_bono()
{
    document.images.img1.src='http://www.hotusahotels.com/images/printer.gif';
    document.images.img2.src='http://www.hotusahotels.com/images/sobre.gif';
    document.listadoForm.txt_print.value=document.listadoForm.txt_print_b.value;
    document.frm2.txt_sobre.value=document.frm2.txt_sobre_b.value;
}
function ocult_icons_bono()
{
    document.images.img1.src='http://www.hotelresb2b.com/interfaz/images/void.gif';
    document.images.img2.src='http://www.hotelresb2b.com/interfaz/images/void.gif';
    document.listadoForm.txt_print.value="";
    document.frm2.txt_sobre.value="";
}
function open_calculando(msg)
{
    calculando = window.open("","calculando_","top=200,left=200,width=250,height=15,toolbar=no,scrollbars=no,resizable=no");
    calculando.document.open();
    calculando.document.write("<title>...</title><body><br><center><b>"+msg+"</b></center></body>");
    calculando.document.close();
}
function close_calculando()
{
    if (calculando!=null) eval("calculando.close();");
}
function open_traslado(url)
{
    window.open(url,"traslado_","top=20,left=65,width=656,height=490,toolbar=no,scrollbars=auto,resizable=yes");
}
function obreFoto (imatge)
{

    planol = open("",'planol',"width=397,height=397,top=50,left=50,resizable=yes");

    planol.document.write("<html>");
    planol.document.write("<head>");
    planol.document.write("<title>MAP</title>");
    planol.document.write("</head>");
    planol.document.write("<script>");
    planol.document.write("    setTimeout('redimensiona()', 2000);");
    planol.document.write("    function redimensiona()");
    planol.document.write("    {");
    planol.document.write("        width = document.document.imatge.width;");
    planol.document.write("        height = document.document.imatge.height;");
    planol.document.write("        window.resizeTo(width+6, height+32);");
    planol.document.write("    }");
    planol.document.write("</script>");
    planol.document.write("   <body lefmargin=0 topmargin=0 leftmargin=0 rightmargin=0 marginheight=0 marginwidth=0>");
    planol.document.write("      <img name=\"imatge\" src=\""+imatge+"\" border=0>");
    planol.document.write("   </body>");
    planol.document.write("</html>");

    width = planol.document.images[0].width;
    height = planol.document.images[0].height;
    planol.resizeTo(width+6, height+32);

}
function openTextPAQFS(codpaq,hot_codcobol,hot_afil,codtar)
{
    window.open("/interfaz/showTextPaqFS.jsp?codpaq="+codpaq+"&hot_codcobol="+hot_codcobol+"&codtar="+codtar+"&hot_afil="+hot_afil,"textPaqFS_","top=20,left=65,width=300,height=150,toolbar=no,scrollbars=yes,resizable=yes");
}

function obrePlano (longitud, latitud)
{
    if (longitud && latitud && longitud.length!=0 && latitud.length!=0) {
        //window.open("http://www.hotelresb2b.com/FichasHotel/googleMapHotel.jsp?lathotel="+latitud+"&lonhotel="+longitud,'planol',"width=420,height=345,top=50,left=50,resizable=yes");
        window.open("/FichasHotel/googleMapHotel.jsp?lathotel="+latitud+"&lonhotel="+longitud,'planol',"width=420,height=345,top=50,left=50,resizable=yes");
    }
}

function obrePlanoDiv (longitud, latitud, id) {
   var curTop = 0;
   var obj = document.getElementById(id);
    if (obj.offsetParent){
		while (obj.offsetParent){
			curTop += obj.offsetTop;
			obj = obj.offsetParent;
		}
	} else if (obj.y){
		curTop += obj.y;
	}
   if (longitud && latitud && longitud.length!=0 && latitud.length!=0) {
        //window.open("http://www.hotelresb2b.com/FichasHotel/googleMapHotel.jsp?lathotel="+latitud+"&lonhotel="+longitud,'planol',"width=420,height=345,top=50,left=50,resizable=yes");
        //window.open("/FichasHotel/googleMapHotel.jsp?lathotel="+latitud+"&lonhotel="+longitud,'planol',"width=420,height=345,top=50,left=50,resizable=yes");
        document.getElementById("popup").innerHTML = '<table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">            <tr height="90%">                <td>                    <iframe width="100%" height="100%" src="/FichasHotel/googleMapHotel.jsp?lathotel='+latitud+'&lonhotel='+longitud+'"></iframe>                </td>            </tr>            <tr height="10%">                <td align="center">                    <p><a href="javascript: tancaPlanoDiv();">Cerrar</a></p>                </td>            </tr>        </table> ';
        document.getElementById("popup").style.top = curTop;
        document.getElementById("popup").style.visibility = 'visible';
    } else {
		fesGran(1000);
        obreFoto(document.images.foto1000.src);
        //document.getElementById("popup").innerHTML = '<table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">            <tr height="90%">                <td>                    <img id="imagen" src="" width="100%" height="100%">                </td>            </tr>            <tr height="10%">                <td align="center">                    <p><a href="javascript: tancaPlano();">Cerrar</a></p>                </td>            </tr>        </table> ';
    }
}

function tancaPlanoDiv (){
    document.getElementById("popup").style.visibility = 'hidden';
}
