
var nombreCapaCalendario;function abrirCalendario(login,idCombo,titulo,numCalendarios,fechaInicio,fechaSel,diasAnt,accion,idProductoFisico){DWREngine.setVerb("GET");nombreCapaCalendario="capaCal_a";var pos=getAbsoluteElementPosition(idCombo);var alto=pos.top+18;var izda=pos.left;var numDias="";var paginaInclude='/servlet/widget?metodo=ajaxCalendario&login='+login+'&titulo='+titulo+'&accion='+accion+'&numCalendarios='+numCalendarios+'&fechaInicio='+fechaInicio+'&fechaSel='+fechaSel+'&diasAnt='+diasAnt+'&idProductoFisico='+idProductoFisico;forwardGetSincrono("capaCal_a",paginaInclude);if(numCalendarios=="1"){document.getElementById("capaCal_a").style.width="178px";document.getElementById("capaOcultaEnlace2").style.width="180px";if(document.getElementById("numDias"+numCalendarios).value>=36){document.getElementById("capaOcultaEnlace2").style.height="174px";}else{document.getElementById("capaOcultaEnlace2").style.height="149px";}}else{document.getElementById("capaCal_a").style.width="358px";document.getElementById("capaOcultaEnlace2").style.width="311px";if(document.getElementById("numDias0").value>=36||document.getElementById("numDias1").value>=36){document.getElementById("capaOcultaEnlace2").style.height="174px";}else{document.getElementById("capaOcultaEnlace2").style.height="149px";}}
document.getElementById("capaCal_a").style.left=izda+"px";document.getElementById("capaCal_a").style.display="block";document.getElementById("capaOcultaEnlace2").style.display="block";document.getElementById("capaOcultaEnlace2").style.left=izda+"px";document.getElementById("capaOcultaEnlace2").style.top=alto+"px";WCH.Apply("capaCal_a");position=getAbsoluteElementPosition(idCombo);document.getElementById("capaOcultaEnlace2").style.left=position.left;document.getElementById("capaOcultaEnlace2").style.width="152px";document.getElementById("capaCal_a").style.left=position.left;document.getElementById("capaOcultaEnlace2").style.left=position.left;document.getElementById("capaCal_a").style.width="151px";}
function masCalendarios(login,numCalendarios,titulo,accion,fechaInicio,indCalendario,numeroPeticionCalendario,nombreCapa){var ultimo=false;DWREngine.setVerb("GET");nombreCapaCalendario=nombreCapa;if(document.getElementById("calendar"+nombreCapa+(indCalendario+1))){var texto=document.getElementById("calendar"+nombreCapa+(indCalendario+1)).innerHTML;if(texto.indexOf("mesSiguiente",0)==-1&&texto.indexOf("masCalendarios",0)==-1){ultimo=true;}
mesSiguiente(indCalendario,numCalendarios,ultimo,nombreCapa);}else{var paginaInclude='/servlet/calendario?metodo=ajaxCalendario&login='+login+'&titulo='+titulo+'&accion='+accion+'&numCalendarios='+numCalendarios+'&numeroPeticionCalendario='+numeroPeticionCalendario+'&fechaInicio='+fechaInicio+'&numeroPeticionCalendario='+numeroPeticionCalendario+'&nombreCapa='+nombreCapa;var texto=document.getElementById("todoCalendarios").innerHTML;forwardGetSincrono("todoCalendarios",paginaInclude);var dato=document.getElementById("todoCalendarios").innerHTML;if(dato.indexOf("mesSiguiente",0)==-1&&dato.indexOf("masCalendarios",0)==-1){ultimo=true;}
document.getElementById("todoCalendarios").innerHTML=texto+document.getElementById("todoCalendarios").innerHTML;WCH.Apply("todoCalendarios");mesSiguiente(indCalendario,numCalendarios,ultimo,nombreCapa);}}
function abrirCalendarioVacacional(tipo,codigoOrigen,codigoDestino,login,idCombo,titulo,fechaInicio,fechaSel,diasAnt,accion,tipoCal,codTva,codTpr,refPro,pagina){DWREngine.setVerb("GET");var pos=getAbsoluteElementPosition(idCombo);var izda=pos.left;var alto=pos.top;if(idCombo==""){alto=176;izda=410;}
var nombreCapa="capaCal_a";var nombreCapa2="capaOcultaEnlace4";if(tipoCal=="VUELTA"){nombreCapa="capaCalVac_a";nombreCapa2="capaOcultaEnlace3";izda+=180;}else if(tipoCal=="IDA"&&idCombo!=""){alto+=18;}
var paginaInclude='/servlet/widget?metodo=ajaxCalendario&esVacacional=SI&login='+login+'&titulo='+titulo+'&accion='+accion+'&numCalendarios=1&fechaInicio='+fechaInicio+'&fechaSel='+fechaSel+'&diasAnt='+diasAnt+'&tipo='+tipo+'&codigoOrigen='+codigoOrigen+'&codigoDestino='+codigoDestino+'&codTva='+codTva+'&codTpr='+codTpr+'&refPro='+refPro+'&nombreCapa='+nombreCapa+'&pagina='+pagina;forwardGet(nombreCapa,paginaInclude);document.getElementById(nombreCapa).style.width="178px";document.getElementById(nombreCapa).style.top=alto+"px";document.getElementById(nombreCapa).style.left=izda+"px";document.getElementById(nombreCapa).style.display="block";document.getElementById(nombreCapa2).style.width="180px";document.getElementById(nombreCapa2).style.display="block";document.getElementById(nombreCapa2).style.left=izda+"px";document.getElementById(nombreCapa2).style.top=alto+"px";WCH.Apply(nombreCapa);nombreCapaCalendario=nombreCapa;}
function mesSiguiente(indCalendario,numCalendarios,ultimo,nombreCapa){if(numCalendarios==2){document.getElementById("calendar"+nombreCapa+(indCalendario-1)).style.display="none";document.getElementById("calendar"+nombreCapa+(indCalendario)).style.marginLeft="0px";document.getElementById("calendar"+nombreCapa+(indCalendario+1)).style.display="block";document.getElementById("calendar"+nombreCapa+(indCalendario+1)).style.marginLeft="5px";document.getElementById("flechaizda"+nombreCapa+(indCalendario+1)).style.display="none";document.getElementById("flechadcha"+nombreCapa+(indCalendario+1)).style.display="block";document.getElementById("flechaizda"+nombreCapa+(indCalendario)).style.display="block";document.getElementById("flechadcha"+nombreCapa+(indCalendario)).style.display="none";if(ultimo){document.getElementById("flechadcha"+nombreCapa+(indCalendario+1)).style.display="none";}
if(document.getElementById("numDias"+(indCalendario)).value>=36||document.getElementById("numDias"+(indCalendario+1)).value>=36){document.getElementById("capaOcultaEnlace2").style.height="174px";}else{document.getElementById("capaOcultaEnlace2").style.height="149px";}}else if(numCalendarios==1){document.getElementById("calendar"+nombreCapa+(indCalendario+1)).style.display="block";document.getElementById("flechaizda"+nombreCapa+(indCalendario+1)).style.display="block";document.getElementById("flechadcha"+nombreCapa+(indCalendario+1)).style.display="block";document.getElementById("calendar"+nombreCapa+(indCalendario+1)).style.marginLeft="0px";document.getElementById("calendar"+nombreCapa+(indCalendario)).style.display="none";if(ultimo){document.getElementById("flechadcha"+nombreCapa+(indCalendario+1)).style.display="none";}
if(document.getElementById("numDias"+(indCalendario+1)).value>=36){document.getElementById("capaOcultaEnlace2").style.height="174px";}else{document.getElementById("capaOcultaEnlace2").style.height="149px";}}}
function mesAnterior(indCalendario,numCalendarios,nombreCapa){if(numCalendarios==2){document.getElementById("calendar"+nombreCapa+(indCalendario-1)).style.display="block";document.getElementById("calendar"+nombreCapa+(indCalendario-1)).style.marginLeft="0px";document.getElementById("calendar"+nombreCapa+(indCalendario+1)).style.display="none";document.getElementById("calendar"+nombreCapa+(indCalendario)).style.marginLeft="5px";document.getElementById("flechaizda"+nombreCapa+(indCalendario+1)).style.display="block";document.getElementById("flechadcha"+nombreCapa+(indCalendario+1)).style.display="none";document.getElementById("flechaizda"+nombreCapa+(indCalendario)).style.display="none";document.getElementById("flechadcha"+nombreCapa+(indCalendario)).style.display="block";if(document.getElementById("numDias"+(indCalendario-1)).value>=36||document.getElementById("numDias"+(indCalendario)).value>=36){document.getElementById("capaOcultaEnlace2").style.height="174px";}else{document.getElementById("capaOcultaEnlace2").style.height="149px";}}else if(numCalendarios==1){document.getElementById("calendar"+nombreCapa+(indCalendario-1)).style.display="block";document.getElementById("calendar"+nombreCapa+(indCalendario-1)).style.marginLeft="0px";document.getElementById("calendar"+nombreCapa+(indCalendario)).style.display="none";if(document.getElementById("numDias"+(indCalendario-1)).value>=36){document.getElementById("capaOcultaEnlace2").style.height="174px";}else{document.getElementById("capaOcultaEnlace2").style.height="149px";}}}
function cerrarCalendario(){WCH.Discard("capaCal_a");document.getElementById("capaCal_a").style.display="none";document.getElementById("capaOcultaEnlace2").style.display="none";document.getElementById("capaCal_a").innerHTML="";if(document.getElementById("capaCalVac_a")){WCH.Discard("capaCalVac_a");document.getElementById("capaCalVac_a").style.display="none";document.getElementById("capaCalVac_a").innerHTML="";document.getElementById("capaOcultaEnlace4").style.display="none";document.getElementById("capaOcultaEnlace3").style.display="none";}
DWREngine.setVerb("POST");}
