
function cambiarDestinos(valorCombo,smartCategoria,smartPrecio,apartado,pagina){arrayParametros=valorCombo.split("/");var precio=document.getElementById("smartPrecio")[document.getElementById("smartPrecio").selectedIndex].text;var codFamilia=document.getElementById("smartCategoria")[document.getElementById("smartCategoria").selectedIndex].text;dwr.engine.setAsync(false);buscaYMarcaIndice(smartCategoria,codFamilia,'AjaxSmartBox.obtenerCategorias',new Array(arrayParametros[4],arrayParametros[6],apartado,pagina));buscaYMarcaIndice(smartPrecio,precio,'AjaxSmartBox.obtenerPrecios',new Array(arrayParametros[5],arrayParametros[4],apartado,pagina));dwr.engine.setAsync(false);document.forms.formularioSmartBox.desDestino.value=arrayParametros[4];}
function cambiarCategorias(valorCombo,smartDestino,smartPrecio,codIdi,apartado,pagina){arrayParametros=valorCombo.split("/");var destino=document.getElementById("smartDestino")[document.getElementById("smartDestino").selectedIndex].text;var precio=document.getElementById("smartPrecio")[document.getElementById("smartPrecio").selectedIndex].text;dwr.engine.setAsync(false);buscaYMarcaIndice(smartDestino,destino,'AjaxSmartBox.obtenerDestinos',new Array(arrayParametros[5],arrayParametros[6],codIdi,apartado,pagina));buscaYMarcaIndice(smartPrecio,precio,'AjaxSmartBox.obtenerPrecios',new Array(arrayParametros[5],arrayParametros[4],apartado,pagina));dwr.engine.setAsync(false);document.forms.formularioSmartBox.desCategoria.value=arrayParametros[5];}
function cambiarPrecios(valorCombo,smartDestino,smartCategoria,codIdi,apartado,pagina){arrayParametros=valorCombo.split("/");var destino=document.getElementById("smartDestino")[document.getElementById("smartDestino").selectedIndex].text;var familia=document.getElementById("smartCategoria")[document.getElementById("smartCategoria").selectedIndex].text;dwr.engine.setAsync(false);buscaYMarcaIndice(smartDestino,destino,'AjaxSmartBox.obtenerDestinos',new Array(arrayParametros[5],arrayParametros[6],codIdi,apartado,pagina));buscaYMarcaIndice(smartCategoria,familia,'AjaxSmartBox.obtenerCategorias',new Array(arrayParametros[4],arrayParametros[6],apartado,pagina));dwr.engine.setAsync(false);document.forms.formularioSmartBox.desPrecio.value=arrayParametros[6];}
function buscaYMarcaIndice(smartCombo,text,metodoAjax,arrayParametros){cargarCombo(metodoAjax,arrayParametros,smartCombo);for(var i=0;i<document.getElementById(smartCombo).length;i++)
if(document.getElementById(smartCombo)[i].text==text)
document.getElementById(smartCombo).selectedIndex=i;}
function buscarSmartBox(ruta,login,tipo){document.forms.formularioSmartBox.metodo.value="doActividadesBuscador";if(document.getElementById("smartDestino").selectedIndex!=0){document.forms.formularioSmartBox.desDestino.value=document.getElementById("smartDestino")[document.getElementById("smartDestino").selectedIndex].text;}
if(document.getElementById("smartCategoria").selectedIndex!=0){document.forms.formularioSmartBox.desCategoria.value=document.getElementById("smartCategoria")[document.getElementById("smartCategoria").selectedIndex].text;}
if(document.getElementById("smartPrecio").selectedIndex!=0){document.forms.formularioSmartBox.desPrecio.value=document.getElementById("smartPrecio")[document.getElementById("smartPrecio").selectedIndex].text;}
if(document.getElementById("desDestino").value!=null&&document.getElementById("desDestino").value!=""){destino=document.getElementById("desDestino").value.toLowerCase()+"/";destino=destino.replace(" ","-");}else
destino="";if(document.getElementById("desCategoria").value!=null&&document.getElementById("desCategoria").value!=""){categoria=document.getElementById("desCategoria").value.toLowerCase()+"/";categoria=categoria.replace(" ","-");}else
categoria="";if(document.getElementById("desPrecio").value!=null&&document.getElementById("desPrecio").value!=""){precio=document.getElementById("desPrecio").value.toLowerCase()+"/";precio=precio.replace(" ","-");}else
precio="";if(tipo=='SMARTBOX'){login=document.forms.formHomeSmartBox.login.value;if(login=='NEWECUADOR'){document.forms.formularioSmartBox.action=ruta+'/servlet/smartbox';}else{document.forms.formularioSmartBox.action="http://www.halconviajes.com/escapadas-fin-de-semana/"+destino+categoria+precio;}}else{document.forms.formularioSmartBox.action=ruta+'/servlet/V3';}
mostrarCargandoNuevoV2(1,"0003",login);document.forms.formularioSmartBox.submit();}
function continuarSB(indiceDisp,indiceProd,ruta,login,tipo){var paginaInclude='/servlet/smartbox?metodo=ajaxSeleccionarProducto&indiceDisponibilidad='+indiceDisp+'&indiceProducto='+indiceProd+'&login='+login;forwardPostSincrono('capaFinSeleccionar',paginaInclude,document.formularioResumen);mostrarCargandoNuevoV2(2,"0003",$j('#login').val());if(tipo=='SMARTBOX'){document.formularioResumen.action=ruta+'/servlet/smartbox';}else{document.formularioResumen.action=ruta+'/servlet/V3';}
document.formularioResumen.indiceDisponibilidad.value=indiceDisp;document.formularioResumen.indiceProducto.value=indiceProd;document.formularioResumen.numUnidades.value=document.getElementById("smartCantidad").value;document.formularioResumen.submit();}
function cambiarPagina(producto,indiceDisponibilidad,pagina){var paginaInclude='/appMultiproducto/jsp/v3/listadoServicios.jsp?numPagina='+pagina;document.getElementById("paginaActual").value=pagina;forwardPostSincrono('productosSmartBox',paginaInclude,'formSmartBoxFiltro');subirPagina();}
function cambiarPaginaV2(producto,indiceDisponibilidad,pagina){var paginaInclude='/appMultiproducto/jsp/v3/listadoServiciosV2.jsp?numPagina='+pagina;document.getElementById("paginaActual").value=pagina;forwardPostSincrono('productosSmartBox',paginaInclude,'formSmartBoxFiltro');subirPagina();}
function listar(url,key,login,tipoProd){document.formHomeSmartBox.codigo.value=key;document.formHomeSmartBox.tipProdComercial.value=tipoProd;document.formHomeSmartBox.action=url;var nombre=url.substring(url.lastIndexOf("/"),url.length);document.formHomeSmartBox.nombreProducto.value=nombre;mostrarCargandoNuevoV2(1,"0003",login);document.formHomeSmartBox.submit();}
function comoFunciona(pagina){document.formAyuda.pagina.value=pagina;document.formAyuda.submit();}
function pintarOcultarCapa(capa){var str="<span class=\"botactivo_a\"><a href=\"javascript:display('"+capa+"','none');\">X</a></span>";escribe("function_pintarOcultarCapa",str);}
function pintarOcultarCapa2(capa){var str="<span class=\"botactivo_a\"><a href=\"javascript:display('"+capa+"','none');\">X</a></span>";escribe("function_pintarOcultarCapa2",str);}
function display(que,como){document.getElementById(que).style.display=como;}
function masInfoV2(producto,servicio,site){document.formServicios.idProd.value=producto;document.formServicios.idSer.value=servicio;escribe('capaMasInfoSmartBox','');var capa='capaMasInfoSmartBox';var paginaInclude='/servlet/smartbox';forwardPost(capa,paginaInclude,'formServicios');document.getElementById('capaMasInfoSmartBox').style.display='block';if(site=='PEPETRAVEL'){document.getElementById('capaMasInfoSmartBox').style.left='448px';}else{$j('#capaMasInfoSmartBox').css('left','200px');}}
function masInfo(producto,servicio,site){document.formServicios.idProd.value=producto;document.formServicios.idSer.value=servicio;escribe('capaMasInfo','');var capa='capaMasInfo';var paginaInclude='/servlet/smartbox';forwardPost(capa,paginaInclude,'formServicios');document.getElementById('capaMasInfo').style.display='block';var alto=(document.all)?document.documentElement.scrollTop:window.pageYOffset
document.getElementById('capaMasInfo').style.top='132px';if(site=='PEPETRAVEL'){document.getElementById('capaMasInfo').style.left='448px';}else{document.getElementById('capaMasInfo').style.left='205px';}}
function masInfoAct(producto,servicio){escribe('capaMasInfo','');var capa='capaMasInfo';document.formularioSB.productoMasInfo.value=producto;document.formularioSB.metodo.value="ajaxMasInfo";document.getElementById("disponibilidad").value="listaDisponibilidadComplementos";var paginaInclude='/servlet/multiproducto';forwardPost(capa,paginaInclude,'formularioSB');document.getElementById('capaMasInfo').style.display='block';var alto=(document.all)?document.documentElement.scrollTop:window.pageYOffset
document.getElementById('capaMasInfo').style.top=alto-220+'px';document.getElementById('capaMasInfo').style.left='10px';document.getElementById('capaMasInfo').style.width='763px';document.getElementById('capaMasInfo').style.height='490px';WCH.Apply("capaMasInfo");if(document.getElementById("WCHhidercapaMasInfo"))document.getElementById("WCHhidercapaMasInfo").style.top=alto+"px";}
function verCapaSB(tipoMarcado,indice){document.getElementById("capaDatosSB").style.display='block';document.getElementById("InsertarSB").style.display='none';document.getElementById("BorrarSB").style.display='block';confirmarPrecioCompl(tipoMarcado,indice);}
function ocultarCapaSB(tipoMarcado,indice){document.getElementById("capaDatosSB").style.display='none';document.getElementById("InsertarSB").style.display='block';document.getElementById("BorrarSB").style.display='none';document.getElementById("cbUnidades").value=1;cambiarPrecio();confirmarPrecioCompl(tipoMarcado,indice);}
function confirmarPrecioCompl(tipoMarcado,producto){document.formularioSB.metodo.value="ajaxSeleccionarComplemento";document.getElementById("disponibilidadCompl").value="listaDisponibilidadComplementos";document.formularioSB.tipoMarcado.value=tipoMarcado;document.formularioSB.indiceProd.value=producto;document.formularioSB.numUnidades.value=document.formularioSB.cbUnidades.value;var capa='bloqueContenido';var paginaInclude='/servlet/multiproducto';if(!forwardPostSincrono(capa,paginaInclude,'formularioSB')){return false;}
actualizarPrecios();}
function cambiarPrecio(){var precio=document.formularioSB.precioProd.value;var unidades=document.formularioSB.cbUnidades.value;var total=(unidades*precio);var cadEnteros=0;var cadDecimales=0;var strpuntos=""+total;var posPuntoDecimal=0;posPuntoDecimal=strpuntos.indexOf(".",0)
if(posPuntoDecimal<0)
{cadEnteros=total;cadDecimales=".00"}
else
{cadEnteros=total.substring(0,posPuntoDecimal);cadDecimales=total.substring(posPuntoDecimal);}
escribe("importeEnt",cadEnteros);escribe("importeDec",cadDecimales+" &euro;");}
