var dtCh="/",minYear=7,maxYear=99,undefined;
function isInteger(B){var A;
for(A=0;
A<B.length;
A++){var C=B.charAt(A);
if(((C<"0")||(C>"9"))){return false
}}return true
}function stripCharsInBag(C,D){var B,A="";
for(B=0;
B<C.length;
B++){var E=C.charAt(B);
if(D.indexOf(E)==-1){A+=E
}}return A
}function daysInFebruary(A){return(((A%4==0)&&((!(A%100==0))||(A%400==0)))?29:28)
}function DaysArray(B){for(var A=1;
A<=B;
A++){this[A]=31;
if(A==4||A==6||A==9||A==11){this[A]=30
}if(A==2){this[A]=29
}}return this
}function isDate(K){var A=DaysArray(12),J=K.indexOf(dtCh),I=K.indexOf(dtCh,J+1),E=K.substring(0,J),B=K.substring(J+1,I),C=K.substring(I+1),D,F,H,G;
strYr=C;
if(B.charAt(0)=="0"&&B.length>1){B=B.substring(1)
}if(E.charAt(0)=="0"&&E.length>1){E=E.substring(1)
}for(D=1;
D<=3;
D++){if(strYr.charAt(0)=="0"&&strYr.length>1){strYr=strYr.substring(1)
}}F=parseInt(E);
H=parseInt(B);
G=parseInt(strYr);
if(J==-1||I==-1){alert("The date format should be : mm/dd/yy");
return false
}if(E.length<1||F<1||F>12){alert("Please enter a valid month.");
return false
}if(B.length<1||H<1||H>31||(F==2&&H>daysInFebruary(G))||H>A[F]){alert("Please enter a valid day.");
return false
}if(C.length!=2||G==0||G<minYear||G>maxYear){alert("Please enter a valid year.");
return false
}if(K.indexOf(dtCh,I+1)!=-1||isInteger(stripCharsInBag(K,dtCh))==false){alert("Please enter a valid date.");
return false
}return true
}function getHour(){var B=new Date(),A=B.getHours();
if(A>12){A=A-12
}if(A==0){A=12
}return A
}function getMinute(){var A=new Date(),B=A.getMinutes();
if(B<10){B="0"+B
}return B
}function getAmPm(){var B=new Date(),C="am",A=B.getHours();
if(A>11){C="pm"
}return C
}function loadDate(){if(!document.getElementById("tripPlannerExists").value){var B=new Date(),C;
if(navigator.appName.substring(0,1)=="M"){C=B.getYear()+"*";
C=C.substring(2,4)
}else{C=(1900+B.getYear())+"*";
C=C.substring(2,4)
}var A=B.getMonth()+1;
if(A<10){A="0"+A
}var D=B.getDate();
if(B.getDate()<10){D="0"+D
}document.getElementById("travelDate").value=(A+"/"+D+"/"+C);
try{document.featuredAttraction.travelDate.value=(A+"/"+D+"/"+C)
}catch(E){}document.getElementById("hour").value=getHour();
var F=getMinute();
if(F%5!=0){if(F<5){document.getElementById("minute").value="00"
}else{if(F>5&&F<10){document.getElementById("minute").value="05"
}else{document.getElementById("minute").value=F-(F%5)
}}}else{document.getElementById("minute").value=getMinute()
}document.getElementById("ampm").value=getAmPm()
}}function checkCalendar(){if((document.getElementById("calendarOpen").value=="true")&&(document.getElementById("calendarClick").value=="false")){document.getElementById("calendarOpen").value=false;
hideCalendarControl()
}document.getElementById("calendarClick").value=false
}function fillOrigAddress(){var A=document.tripPlan.origRecentLocation.value.split(",");
document.tripPlan.origAddress.value=A[0];
document.tripPlan.origCity.value=A[1];
if(A[4]!="null"&&A[4].length>0&&A[5]!="null"&&A[5].length>0){document.tripPlan.origData.value=A[4]+";"+A[5]+";"+A[6]+";"+A[7]+";"+A[0]+";"+A[1]
}critChanged=true
}function fillDestAddress(){var A=document.tripPlan.destRecentLocation.value.split(",");
document.tripPlan.destAddress.value=A[0];
document.tripPlan.destCity.value=A[1];
if(A[4]!="null"&&A[4].length>0&&A[5]!="null"&&A[5].length>0){document.tripPlan.destData.value=A[4]+";"+A[5]+";"+A[6]+";"+A[7]+";"+A[0]+";"+A[1]
}critChanged=true
}function checkForm(){if(document.tripPlan.origAddress.value==""||document.tripPlan.origAddress.value.toUpperCase()=="ADDRESS, INTERSECTION OR ATTRACTION"){alert("Please enter your from address.");
document.tripPlan.origAddress.focus();
return false
}if(document.tripPlan.destAddress.value==""||document.tripPlan.destAddress.value.toUpperCase()=="ADDRESS, INTERSECTION OR ATTRACTION"){alert("Please enter your to address.");
document.tripPlan.destAddress.focus();
return false
}if(isDate(document.tripPlan.travelDate.value)==false){document.tripPlan.travelDate.focus();
return false
}if(document.tripPlan.origCity.value.toUpperCase()=="ENTER A CITY"){document.tripPlan.origCity.value=""
}if(document.tripPlan.destCity.value.toUpperCase()=="ENTER A CITY"){document.tripPlan.destCity.value=""
}document.tripPlan.takeMeThere.className="disabledButton";
document.tripPlan.takeMeThere.disabled=true;
document.tripPlan.submit();
return true
}function clearLocType(B){var A=document.getElementById(B);
if(A!=null){A.value=""
}critChanged=true
};