function toUpperCase(ctrl){ var text = new String(ctrl.value); ctrl.value = text.toUpperCase(); } function toLowerCase(ctrl){ var text = new String(ctrl.value); ctrl.value = text.toLowerCase(); } //Sets the checOutDate with the checkInDate + 1 day function setCheckOutDate(checkIn,checkOut){ if(checkIn.value!=''&&isValidDate(checkIn.value,'/')){ var date = checkIn.value.substring(0,2); var month = checkIn.value.substring(3,5); var year = checkIn.value.substring(6,10); if(new Date(year,month-1,date)!=null){ checkOut.value=getDateAsString(addDays(new Date(year,month-1,date),1)); } } } function isValidDate (myDate,sep) { // checks if date passed is in valid dd/mm/yyyy format if (myDate.length == 10) { if (myDate.substring(2,3) == sep && myDate.substring(5,6) == sep) { var date = myDate.substring(0,2); var month = myDate.substring(3,5); var year = myDate.substring(6,10); var test = new Date(year,month-1,date); if (year == y2k(test.getYear()) && (month-1 == test.getMonth()) && (date == test.getDate())) { reason = ''; return true; } else { reason = 'valid format but an invalid date'; return false; } } else { reason = 'invalid spearators'; return false; } } else { reason = 'invalid length'; return false; } } function y2k(number) { return (number < 1000) ? number + 1900 : number; } //Adds the given number of days to the given date function addDays(myDate,days) { return new Date(myDate.getTime() + days*24*60*60*1000); } //Returns a String with format dd/mm/yyyy function getDateAsString(date){ dd = date.getDate(); mm = date.getMonth()+1; // 0 based yy = date.getYear(); if (yy < 1000) yy +=1900; // Y2K fix if(dd<10) dd='0'+dd; if(mm<10) mm='0'+mm; return dd+'/'+mm+'/'+yy; } function toUpperCase(obj){ var valor = obj.value; obj.value = valor.toUpperCase(); } function goURL(url){ if(mSeguro) document.location.href=urlNoSeguro+url+urlSession; else document.location.href=url; } function anchor_submit_form(netuiName, newAction) { for (var i=0; i"); document.write(""); for(i=0;i"+idioma[i]+""); if(maximo!=0){ document.write(" / "); maximo--; } } } document.write(""); } function cambiarURL(idioma){ var parametro="idioma="; url=document.location.href; if(url.indexOf("/p/")>-1){ url=reemplazar(url,idiomaActual,idioma); document.location.href=url; }else{ cambiarIdioma(idioma); } } function cambiarIdioma(idioma){ var parametro="idioma="; url=document.location.href; if(url.indexOf("?")>-1)pre="&"; else pre="?"; if(url.indexOf(parametro)>-1){ url=url.substring(0,url.indexOf(parametro))+parametro+idioma+url.substring(url.indexOf(parametro)+parametro.length+5); document.location.href=url; } else document.location.href+=pre+parametro+idioma; }