function SetFocus(b){var c=0;if(b!=""){for(i=0;i<document.forms.length;i++){if(document.forms[i].name==b){c=i;break}}}var a=document.forms[c];for(i=0;i<a.length;i++){if((a.elements[i].type!="image")&&(a.elements[i].type!="hidden")&&(a.elements[i].type!="reset")&&(a.elements[i].type!="submit")){a.elements[i].focus();if((a.elements[i].type=="text")||(a.elements[i].type=="password")){a.elements[i].select()}break}}}function RemoveFormatString(b,a){if(b.value==a){b.value=""}b.select()}function CheckDateRange(b,a){if(Date.parse(b.value)<=Date.parse(a.value)){return true}else{return false}}function IsValidDate(m,r){var n;var b;var p;var f;var e;var l;var d;var c;var o;var k;var j=-1;var h=-1;var g=new Array("-"," ","/",".");var q=new Array("jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec");var a=new Array(31,28,31,30,31,30,31,31,30,31,30,31);n=m.toLowerCase();f=r.toLowerCase();if(n.length!=f.length){return false}for(i=0;i<g.length;i++){if(f.indexOf(g[i])!=-1){h=i;break}}for(i=0;i<g.length;i++){if(n.indexOf(g[i])!=-1){j=i;break}}if(j!=h){return false}if(j!=-1){p=f.split(g[h]);if(p.length!=3){return false}b=n.split(g[j]);if(b.length!=3){return false}for(i=0;i<p.length;i++){if(p[i]=="mm"||p[i]=="mmm"){l=b[i]}if(p[i]=="dd"){e=b[i]}if(p[i]=="yyyy"){d=b[i]}}}else{if(r.length>7){if(f.indexOf("mmm")==-1){l=n.substring(f.indexOf("mm"),2)}else{l=n.substring(f.indexOf("mmm"),3)}e=n.substring(f.indexOf("dd"),2);d=n.substring(f.indexOf("yyyy"),2)}else{return false}}if(d.length!=4){return false}c=parseInt(e,10);if(isNaN(c)){return false}if(c<1){return false}o=parseInt(l,10);if(isNaN(o)){for(i=0;i<q.length;i++){if(l==q[i]){o=i+1;break}}if(isNaN(o)){return false}}if(o>12||o<1){return false}k=parseInt(d,10);if(isNaN(k)){return false}if(IsLeapYear(k)==true){a[1]=29}if(c>a[o-1]){return false}return true}function IsLeapYear(a){if(a%100==0){if(a%400==0){return true}}else{if((a%4)==0){return true}}return false}var slideimages=new Array();var slidelinks=new Array();function slideshowimages(){for(i=0;i<slideshowimages.arguments.length;i++){slideimages[i]=new Image();slideimages[i].src=slideshowimages.arguments[i]}}function slideshowlinks(){for(i=0;i<slideshowlinks.arguments.length;i++){slidelinks[i]=slideshowlinks.arguments[i]}}function gotoshow(){if(!window.winslide||winslide.closed){winslide=window.open(slidelinks[whichlink])}else{winslide.location=slidelinks[whichlink]}winslide.focus()}function rowOverEffect(a){if(a.className=="moduleRow"){a.className="moduleRowOver"}}function rowOutEffect(a){if(a.className=="moduleRowOver"){a.className="moduleRow"}}function checkBox(a){document.account_newsletter.elements[a].checked=!document.account_newsletter.elements[a].checked;}function check_form(){var k="Errors have occurred during the process of your form.\n\nPlease make the following corrections:\n";var j=false;var f;var e=document.advanced_search.keywords.value;var b=document.advanced_search.dfrom.value;var h=document.advanced_search.dto.value;var a=document.advanced_search.pfrom.value;var c=document.advanced_search.pto.value;var g;var d;if(((e=="")||(e.length<1))&&((b=="")||(b=="mm/dd/yyyy")||(b.length<1))&&((h=="")||(h=="mm/dd/yyyy")||(h.length<1))&&((a=="")||(a.length<1))&&((c=="")||(c.length<1))){k=k+"* At least one of the fields in the search form must be entered.\n";f=document.advanced_search.keywords;j=true}if((b.length>0)&&(b!="mm/dd/yyyy")){if(!IsValidDate(b,"mm/dd/yyyy")){k=k+"* Invalid From Date.\n";f=document.advanced_search.dfrom;j=true}}if((h.length>0)&&(h!="mm/dd/yyyy")){if(!IsValidDate(h,"mm/dd/yyyy")){k=k+"* Invalid To Date.\n";f=document.advanced_search.dto;j=true}}if((b.length>0)&&(b!="mm/dd/yyyy")&&(IsValidDate(b,"mm/dd/yyyy"))&&(h.length>0)&&(h!="mm/dd/yyyy")&&(IsValidDate(h,"mm/dd/yyyy"))){if(!CheckDateRange(document.advanced_search.dfrom,document.advanced_search.dto)){k=k+"* To Date must be greater than or equal to From Date.\n";f=document.advanced_search.dto;j=true}}if(a.length>0){g=parseFloat(a);if(isNaN(g)){k=k+"* Price From must be a number.\n";f=document.advanced_search.pfrom;j=true}}else{g=0}if(c.length>0){d=parseFloat(c);if(isNaN(d)){k=k+"* Price To must be a number.\n";f=document.advanced_search.pto;j=true}}else{d=0}if((a.length>0)&&(c.length>0)){if((!isNaN(g))&&(!isNaN(d))&&(d<g)){k=k+"* Price To must be greater than or equal to Price From.\n";f=document.advanced_search.pto;j=true}}if(j==true){alert(k);f.focus();return false}else{RemoveFormatString(document.advanced_search.dfrom,"mm/dd/yyyy");RemoveFormatString(document.advanced_search.dto,"mm/dd/yyyy");return true}}var selected;function selectRowEffect(a,b){if(!selected){if(document.getElementById){selected=document.getElementById("defaultSelected")}else{selected=document.all.defaultSelected}}if(selected){selected.className="moduleRow"}a.className="moduleRowSelected";selected=a;if(document.checkout_address.shipping[0]){document.checkout_address.shipping[b].checked=true}else{document.checkout_address.shipping.checked=true}}function gotospecials(){document.frm_region1.submit()}function session_win(){window.open("templates/theme055/content/info_shopping_cart.php","height=460,width=430,toolbar=no,statusbar=no,scrollbars=yes").focus()}var i_1=0;var s=0;function resize(){if(navigator.appName=="Netscape"){i_1=40}if(window.navigator.userAgent.indexOf("SV1")!=-1){s=20}if(document.images[0]){window.resizeTo(document.images[0].width+30,document.images[0].height+60-i_1+s)}self.focus();if(document.images[0]){imgHeight=document.images[0].height+65-i_1;imgWidth=document.images[0].width+30;var a=screen.height;var b=screen.width;var d=b/2-imgWidth/2;var c=a/2-imgHeight/2;window.moveTo(d,c);window.resizeTo(imgWidth,imgHeight)}self.focus()}function doLoad(b,j){var l=""+document.getElementById("categories_id").value;var o=j;var m=new Subsys_JsHttpRequest_Js();var k=false;var h=new Array();var e=new Array();var n="";var c="";n=document.forms.quick_find_extra.elements.categories_id.selectedIndex;var f=document.forms.quick_find_extra.elements.categories_id[n].value;var d=0;m.onreadystatechange=function(){if(m.readyState==4){e=m.responseJS.ar;if(m.responseJS){document.getElementById("extra_fields_table").innerHTML=m.responseJS.extra_fields_table_st}}};m.caching=false;m.open("POST","load.php",true);for(var g=0;g<(document.forms.quick_find_extra.elements.length);g++){if(document.forms.quick_find_extra.elements[g].type=="select-one"){if((document.forms.quick_find_extra.elements[g].name!="")&&(document.forms.quick_find_extra.elements[g].name!="categories_id")){obj=document.forms.quick_find_extra.elements[g];n=obj.selectedIndex;if(n){c=obj[n].value;if(c!=-1){h[ar_old[g]]=c}}}}}if(!(j=="0")){var a=document.getElementById(o).innerHTML;}else{a=""}document.getElementById("extra_fields_table").innerHTML='<p class="main"><font color="#FF0000">Loading...</font></p>';m.send({q:l,php_div_id:o,ar:e,ar_value:h,next_i:d,categories_id:f,sel_code:a})}var timeout=null;function reset_extra(){for(var a=0;a<(document.forms.quick_find_extra.elements.length);a++){if(document.forms.quick_find_extra.elements[a].type=="select-one"){if((document.forms.quick_find_extra.elements[a].name!="")&&(document.forms.quick_find_extra.elements[a].name!="categories_id")){obj=document.forms.quick_find_extra.elements[a];selected_value=obj.selectedIndex;obj.selectedIndex="0"}}}doLoad(0,0)}function flir_replace(){FLIR.init({path:"http://www.mondoadventuretravel.com/facelift-1.2/generate.php/"});FLIR.onreplacedchild=function(){document.getElementById("h6_flir").style.visibility="hidden"};FLIR.onreplaced=function(){document.getElementById("h6_flir").style.visibility="visible"};FLIR.replace("h6")}function checkCheckBox(a){if(a.agree.checked==false){alert("<?php echo CONDITION_AGREEMENT_WARNING; ?>");return false}else{return true}}function usePage(d,a){for(var c=0,b=d.elements;c<b.length;c++){if(b[c].name==a&&b[c].checked){d.action=b[c].value}}}function checkForm1(){var a=document.form1.agree[document.form1.agree.selectedIndex].value;if(a=="no"){alert("You are required to Agree to Terms and Conditions! \n Please Select Yes from dropdown menu")}else{document.form1.submit()}}function checkForm2(){var a=document.form2.num_passengers[document.form2.num_passengers.selectedIndex].value;if(a=="SORRY THIS TOUR IS FULL"){alert("SORRY THIS TOUR IS FULL <n No more bookings are allowed")}else{document.form2.submit()}}function checkForm3(a){document.form3.submit()}function checkForm4(){document.form4.submit()}function checkForm5(){var l="";var f=new Array();var j=new Date();var b=j.getFullYear();var e=0;var g=document.form5.cc_type.value;var c=document.form5.cc_no.value;var h=parseInt(document.form5.cc_year.value);if(document.form5.cc_name.value==""){f[e]="Missing Name";e++}if(document.form5.cc_month.value==""){f[e]="Missing Expiry Month";e++}if(document.form5.cc_year.value==""){f[e]="Missing Expiry Year";e++}if(h<b){f[e]="Invalid Expiry Year";e++}if(document.form5.cc_ccv.value==""){f[e]="Missing CCV";e++}if(document.form5.billing_check.checked){if((document.form5.bil_address1.value=="")||(document.form5.bil_city.value=="")||(document.form5.bil_zip.value=="")||(document.form5.bil_country.value=="")||(document.form5.bil_state.value=="")){f[e]="\n Missing Billing Address Fields! \n If Billing Address is same as your Profile Address, \nplease Uncheck Billing Address Box";e++}}if(g==""){f[e]="Missing Card Type";e++}if(c==""){f[e]="Missing Card Number";e++}if(g!=""&&c!=""){if(!isValidCreditCard(g,c)){f[e]="Invalid Credit Card number";e++}}if(f.length>0){for(var k=0;k<f.length;k++){l+=f[k]+"\n"}alert("Following Errors ocurred\n Please check out these fields: \n\n"+l)}else{document.form5.submit()}}function showBillingTable(){var a=document.getElementById("billingTable");if(a.style.display==""){a.style.display="none"}else{a.style.display=""}}function showCCVHelp(){var a=document.getElementById("ccvHelp");if(a.style.display==""){a.style.display="none"}else{a.style.display=""}}function isValidCreditCard(d,a){if(d=="visa"){var c=/^4\d{3}-?\d{4}-?\d{4}-?\d{4}$/}else{if(d=="mastercard"){var c=/^5[1-5]\d{2}-?\d{4}-?\d{4}-?\d{4}$/}else{if(d=="Disc"){var c=/^6011-?\d{4}-?\d{4}-?\d{4}$/}else{if(d=="amex"){var c=/^3[4,7]\d{13}$/}else{if(d=="Diners"){var c=/^3[0,6,8]\d{12}$/}}}}}if(!c.test(a)){return false}a=a.split("-").join("");var e=0;for(var b=(2-(a.length%2));b<=a.length;b+=2){e+=parseInt(a.charAt(b-1))}for(var b=(a.length%2)+1;b<a.length;b+=2){var f=parseInt(a.charAt(b-1))*2;if(f<10){e+=f}else{e+=(f-9)}}if((e%10)==0){return true}else{return false}}function showTotalAmount_booktour(c){var a=document.form2.num_passengers_choose.value;var d=document.form2.supplier.value;if(document.form2.payment.checked){ if(document.form2.payment.value=="full") {var b="$ "+(a*c)+".00 CAD";}} else {if(document.form2.payment[1].checked){var b="$ "+(a*c)+".00 CAD"}if(document.form2.payment[0].checked){var e=document.form2.payment[0].value;var b="$ "+(a*e)+".00 CAD"}}document.form2.tot_amount.value=b}function showTotalAmount_3_booktour(c){var a=document.form2.num_passengers_choose.value;var d=document.form2.supplier.value;if(document.form2.payment.checked){ if(document.form2.payment.value=="full") {var b="$ "+(a*c)+".00 CAD";}} else {if(document.form2.payment[2].checked){var b="$ "+(a*c)+".00 CAD"}if(document.form2.payment[0].checked){var e=document.form2.payment[0].value;var b="$ "+(a*e)+".00 CAD"}if(document.form2.payment[1].checked){var e=document.form2.payment[1].value;var b="$ "+(a*e)+".00 CAD"}}document.form2.tot_amount.value=b}function checkForm5_booktour(){document.form5.submit()}function autofillCC(){document.form5.cc_name.value="NAME";document.form5.cc_month.value="01";document.form5.cc_year.value="2009";document.form5.cc_type.value="mastercard";document.form5.cc_no.value="5155565656565656";document.form5.cc_ccv.value="123";document.form5.billing_check.checked=false}function clearCC(){document.form5.cc_name.value="";document.form5.cc_month.value="";document.form5.cc_year.value="";document.form5.cc_type.value="";document.form5.cc_no.value="";document.form5.cc_ccv.value="";document.form5.billing_check.checked=false}function showTotalAmount_holdtour(b){var c=document.form2.num_passengers_choose.value;var a="$ "+(c*b)+".00 CAD";document.form2.tot_amount.value=a}function popupWindow_all(b,c,a,d){window.open(b,"popupWindow","toolbar="+d+",location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width="+c+",height="+a+",screenX=150,screenY=150,top=150,left=150")}function popupWindow(a){window.open(a,"popupWindow","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=650,height=500,screenX=150,screenY=150,top=150,left=150")}var scImgPath="./includes/javascript/spiffyCal/images/";var scIE=((navigator.appName=="Microsoft Internet Explorer")||((navigator.appName=="Netscape")&&(parseInt(navigator.appVersion)==5)));var scNN6=((navigator.appName=="Netscape")&&(parseInt(navigator.appVersion)==5));var scNN=((navigator.appName=="Netscape")&&(document.layers));var img_Del=new Image();var img_Close=new Image();img_Del.src=scImgPath+"btn_del_small.gif";img_Close.src=scImgPath+"btn_close_small.gif";var scBTNMODE_DEFAULT=0;var scBTNMODE_CUSTOMBLUE=1;var scBTNMODE_CALBTN=2;var focusHack;function spiffyCalManager(){this.showHelpAlerts=false;this.defaultDateFormat="dd-MMM-yyyy";this.lastSelectedDate=new Date();this.calendars=new Array();this.matchedFormat="";this.DefBtnImgPath=scImgPath;this.getCount=new Function("return this.calendars.length;");function addCalendar(objWhatCal){var intIndex=this.calendars.length;this.calendars[intIndex]=objWhatCal}this.addCalendar=addCalendar;function hideAllCalendars(objExceptThisOne){var i=0;for(i=0;i<this.calendars.length;i++){if(objExceptThisOne!=this.calendars[i]){this.calendars[i].hide()}}}this.hideAllCalendars=hideAllCalendars;function swapImg(objWhatCal,strToWhat,blnStick){if(document.images){if((!(objWhatCal.visible)||(blnStick))&&(objWhatCal.enabled)){document.images[objWhatCal.btnName].src=eval(objWhatCal.varName+strToWhat+".src")}}window.status=" "}this.swapImg=swapImg;this.Holidays=new Array("Dec-25","Jul-4","Feb-14","Mar-17","Oct-31");this.HolidaysDesc=new Array("Christmas Day","Independance Day","Valentine's Day","St. Patrick's Day","Halloween");function isHoliday(whatDate){var i=0;var found=-1;for(i=0;i<this.Holidays.length;i++){if(whatDate==this.Holidays[i]){found=i;break}}return found}this.isHoliday=isHoliday;this.AllowedFormats=new Array("d.M","d-M","d/M","d.MMM","d-MMM","d/MMM","d.M.yy","d-M-yy","d/M/yy","d.M.yyyy","d-M-yyyy","d/M/yyyy","d.MM.yyyy","d-MM-yyyy","d/MM/yyyy","d.MMM.yy","d-MMM-yy","d/MMM/yy","d.MMM.yyyy","d-MMM-yyyy","d/MMM/yyyy","d.MM.yy","d-MM-yy","d/MM/yy","dd.MM.yy","dd-MM-yy","dd/MM/yy","dd.M.yy","dd-M-yy","dd/M/yy","dd.MM.yyyy","dd-MM-yyyy","dd/MM/yyyy","dd.MMM.yy","dd-MMM-yy","dd/MMM/yy","dd.MMM.yyyy","dd-MMM-yyyy","dd/MMM/yyyy","M.d","M-d","M/d","MMM.d","MMM-d","MMM/d","M.d.yy","M-d-yy","M/d/yy","MM.d.yyyy","MM-d-yyyy","MM/d/yyyy","MMM.d.yy","MMM-d-yy","MMM/d/yy","MMM.d.yyyy","MMM-d-yyyy","MMM/d/yyyy","MM.d.yy","MM-d-yy","MM/d/yy","MM.dd.yy","MM-dd-yy","MM/dd/yy","M.dd.yy","M-dd-yy","M/dd/yy","MM.dd.yyyy","MM-dd-yyyy","MM/dd/yyyy","MMM.dd.yy","MMM-dd-yy","MMM/dd/yy","MMM.dd.yyyy","MMM-dd-yyyy","MMM/dd/yyyy");var MONTH_NAMES=new Array("January","February","March","April","May","June","July","August","September","October","November","December","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");this.lastBoxValidated=null;function validateDate(eInput,bRequired,dStartDate,dEndDate){var i=0;var strTemp="";var formatMatchCount=0;var firstMatchAt=0;var secondMatchAt=0;var bOK=false;var bIsEmpty=false;if(typeof(dStartDate)!="undefined"){var strStart=MONTH_NAMES[dStartDate.getMonth()]+"-"+dStartDate.getDate()+"-"+dStartDate.getFullYear()}else{var strStart=""}if(typeof(dEndDate)!="undefined"){var strEnd=MONTH_NAMES[dEndDate.getMonth()]+"-"+dEndDate.getDate()+"-"+dEndDate.getFullYear()}else{var strEnd=""}var rangeMsg="This input box is set up to accept dates between:\n\n   "+strStart+"\n\nand\n\n   "+strEnd+"\n\nPlease enter a date no ";this.lastBoxValidated=eInput;this.matchedFormat="";bIsEmpty=(eInput.value==""||eInput.value==null);if(!(bRequired&&bIsEmpty)){for(i=0;i<this.AllowedFormats.length;i++){if(isDate(eInput.value,this.AllowedFormats[i])==true){bOK=true;formatMatchCount+=1;if(formatMatchCount==1){firstMatchAt=i}if(formatMatchCount>1){if(this.AllowedFormats[i].substr(0,1)!=this.AllowedFormats[firstMatchAt].substr(0,1)){secondMatchAt=i;break}else{formatMatchCount=1}}}}}if(formatMatchCount>1){if(this.showHelpAlerts){var date1=getDateFromFormat(eInput.value,this.AllowedFormats[firstMatchAt]);var choice1=MONTH_NAMES[date1.getMonth()]+"-"+date1.getDate()+"-"+date1.getFullYear();var date2=getDateFromFormat(eInput.value,this.AllowedFormats[secondMatchAt]);var choice2=MONTH_NAMES[date2.getMonth()]+"-"+date2.getDate()+"-"+date2.getFullYear();if(date1.getTime()!=date2.getTime()){var Msg="You have entered an ambiguous date.\n\n Click OK for:\n"+choice1+"\n\nor Click Cancel for:\n"+choice2;if(confirm(Msg)){bOK=true}else{firstMatchAt=secondMatchAt;bOK=true}eInput.focus();eInput.select()}}else{bOK=true}}if(bOK==true){eInput.className="cal-TextBox";if(dStartDate!=null){var dThis=getDateFromFormat(eInput.value,this.AllowedFormats[i]);if(dStartDate>dThis){eInput.className="cal-TextBoxInvalid";if(this.showHelpAlerts){alert(rangeMsg+"earlier than  "+strStart+".")}eInput.focus();eInput.select();return false}}if(dEndDate!=null){var dThis=getDateFromFormat(eInput.value,this.AllowedFormats[i]);if(dEndDate<dThis){eInput.className="cal-TextBoxInvalid";if(this.showHelpAlerts){alert(rangeMsg+"later than  "+strEnd+".")}eInput.focus();eInput.select();return false}}this.matchedFormat=this.AllowedFormats[firstMatchAt];this.lastBoxValidated=null}else{if(bRequired&&bIsEmpty){eInput.className="cal-TextBoxInvalid";if(this.showHelpAlerts){alert("This date field is required.\n\nPlease enter a valid date before proceeding.")}}else{if(!bRequired&&bIsEmpty){eInput.className="cal-TextBox"}else{eInput.className="cal-TextBoxInvalid";if(this.showHelpAlerts){for(i=0;i<this.AllowedFormats.length;i++){strTemp+=this.AllowedFormats[i]+"\t"}alert("Please enter a valid date.\n\nExample 01-Jan-2002\n\nValid formats are:\n\n"+strTemp)}}}eInput.focus();eInput.select();focusHack=eInput;setTimeout("focusHack.focus();focusHack.select();");return false}}this.validateDate=validateDate;function formatDate(eInput,strFormat){if(this.matchedFormat!=""){var d=getDateFromFormat(eInput.value,this.matchedFormat);if(d!=0){eInput.value=scFormatDate(d,strFormat)}}}this.formatDate=formatDate;function isDate(val,format){var date=getDateFromFormat(val,format);if(date==0){return false}return true}this.isDate=isDate;function scFormatDate(date,format){format=format+"";var result="";var i_format=0;var c="";var token="";var y=date.getFullYear()+"";var M=date.getMonth()+1;var d=date.getDate();var h=date.getHours();var m=date.getMinutes();var s=date.getSeconds();var yyyy,yy,MMM,MM,dd;if(y.length<4){y=y-0+1900}y=""+y;yyyy=y;yy=y.substring(2,4);if(M<10){MM="0"+M}else{MM=M}MMM=MONTH_NAMES[M-1+12];if(d<10){dd="0"+d}else{dd=d}var value=new Object();value.yyyy=yyyy;value.yy=yy;value.y=y;value.MMM=MMM;value.MM=MM;value.M=M;value.dd=dd;value.d=d;while(i_format<format.length){c=format.charAt(i_format);token="";while((format.charAt(i_format)==c)&&(i_format<format.length)){token+=format.charAt(i_format);i_format++}if(value[token]!=null){result=result+value[token]}else{result=result+token}}return result}this.scFormatDate=scFormatDate;function _isInteger(val){var digits="1234567890";for(var i=0;i<val.length;i++){if(digits.indexOf(val.charAt(i))==-1){return false}}return true}function _getInt(str,i,minlength,maxlength){for(x=maxlength;x>=minlength;x--){var token=str.substring(i,i+x);if(_isInteger(token)){return token}}return null}function getDateFromFormat(val,format){val=val+"";format=format+"";var i_val=0;var i_format=0;var c="";var token="";var token2="";var x,y;var year=0;var month=0;var date=0;var bYearProvided=false;while(i_format<format.length){c=format.charAt(i_format);token="";while((format.charAt(i_format)==c)&&(i_format<format.length)){token+=format.charAt(i_format);i_format++}if(token=="yyyy"||token=="yy"||token=="y"){if(token=="yyyy"){x=4;y=4}if(token=="yy"){x=2;y=2}if(token=="y"){x=2;y=4}year=_getInt(val,i_val,x,y);bYearProvided=true;if(year==null){return 0}if(year.length!=token.length){return 0}i_val+=year.length}else{if(token=="MMM"){month=0;for(var i=0;i<MONTH_NAMES.length;i++){var month_name=MONTH_NAMES[i];if(val.substring(i_val,i_val+month_name.length).toLowerCase()==month_name.toLowerCase()){month=i+1;if(month>12){month-=12}i_val+=month_name.length;break}}if(month==0){return 0}if((month<1)||(month>12)){return 0}}else{if(token=="MM"||token=="M"){x=token.length;y=2;month=_getInt(val,i_val,x,y);if(month==null){return 0}if((month<1)||(month>12)){return 0}i_val+=month.length}else{if(token=="dd"||token=="d"){x=token.length;y=2;date=_getInt(val,i_val,x,y);if(date==null){return 0}if((date<1)||(date>31)){return 0}i_val+=date.length}else{if(val.substring(i_val,i_val+token.length)!=token){return 0}else{i_val+=token.length}}}}}}if(i_val!=val.length){return 0}if(month==2){if(((year%4==0)&&(year%100!=0))||(year%400==0)){if(date>29){return false}}else{if(date>28){return false}}}if((month==4)||(month==6)||(month==9)||(month==11)){if(date>30){return false}}month=month-1;if(bYearProvided==false){var dCurrent=new Date();year=dCurrent.getFullYear()}var lYear=parseInt(year);if(lYear<=20){year=2000+lYear}else{if(lYear>=21&&lYear<=99){year=1900+lYear}}var newdate=new Date(year,month,date,0,0,0);return newdate}this.getDateFromFormat=getDateFromFormat}var calMgr=new spiffyCalManager();function ctlSpiffyCalendarBox(strVarName,strFormName,strTextBoxName,strBtnName,strDefaultValue,intBtnMode){var msNames=new makeArray0("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");var msDays=new makeArray0(31,28,31,30,31,30,31,31,30,31,30,31);var msDOW=new makeArray0("S","M","T","W","T","F","S");var blnInConstructor=true;var img_DateBtn_UP=new Image();var img_DateBtn_OVER=new Image();var img_DateBtn_DOWN=new Image();var img_DateBtn_DISABLED=new Image();var strBtnW;var strBtnH;var strBtnImg;var dteToday=new Date;var dteCur=new Date;var dteMin=new Date;var dteMax=new Date;var scX=4;var scY=4;var strDefDateFmt="dd-MMM-yyyy";var intDefBtnMode=0;var strDefBtnImgPath=calMgr.DefBtnImgPath;this.varName=strVarName;this.enabled=true;this.readonly=false;this.focusClick=false;this.hideButton=false;this.visible=false;this.displayLeft=false;this.displayTop=false;this.formName=strFormName;this.textBoxName=strTextBoxName;this.btnName=strBtnName;this.required=false;this.x=scX;this.y=scY;this.imgUp=img_DateBtn_UP;this.imgOver=img_DateBtn_OVER;this.imgDown=img_DateBtn_DOWN;this.imgDisabled=img_DateBtn_DISABLED;this.showWeekends=true;this.showHolidays=true;this.disableWeekends=false;this.disableHolidays=false;this.textBoxWidth=160;this.textBoxHeight=20;this.btnImgWidth=strBtnW;this.btnImgHeight=strBtnH;if((intBtnMode==null)||(intBtnMode<0&&intBtnMode>2)){intBtnMode=intDefBtnMode}switch(intBtnMode){case 0:strBtnImg=strDefBtnImgPath+"btn_date_up.gif";img_DateBtn_UP.src=strDefBtnImgPath+"btn_date_up.gif";img_DateBtn_OVER.src=strDefBtnImgPath+"btn_date_over.gif";img_DateBtn_DOWN.src=strDefBtnImgPath+"btn_date_down.gif";img_DateBtn_DISABLED.src=strDefBtnImgPath+"btn_date_disabled.gif";strBtnW="18";strBtnH="20";break;case 1:strBtnImg=strDefBtnImgPath+"btn_date1_up.gif";img_DateBtn_UP.src=strDefBtnImgPath+"btn_date1_up.gif";img_DateBtn_OVER.src=strDefBtnImgPath+"btn_date1_over.gif";img_DateBtn_DOWN.src=strDefBtnImgPath+"btn_date1_down.gif";img_DateBtn_DISABLED.src=strDefBtnImgPath+"btn_date1_disabled.gif";strBtnW="22";strBtnH="17";break;case 2:strBtnImg=strDefBtnImgPath+"btn_date2_up.gif";img_DateBtn_UP.src=strDefBtnImgPath+"btn_date2_up.gif";img_DateBtn_OVER.src=strDefBtnImgPath+"btn_date2_over.gif";img_DateBtn_DOWN.src=strDefBtnImgPath+"btn_date2_down.gif";img_DateBtn_DISABLED.src=strDefBtnImgPath+"btn_date2_disabled.gif";strBtnW="34";strBtnH="21";break}this.dateFormat=strDefDateFmt;this.useDateRange=false;this.minDate=new Date;this.maxDate=new Date(dteToday.getFullYear()+1,dteToday.getMonth(),dteToday.getDate());this.minDay=function(){return this.minDate.getDate()};this.minMonth=function(){return this.minDate.getMonth()};this.minYear=function(){return this.minDate.getFullYear()};this.maxDay=function(){return this.maxDate.getDate()};this.maxMonth=function(){return this.maxDate.getMonth()};this.maxYear=function(){return this.maxYear.getFullYear()};function setMinDate(intYear,intMonth,intDay){this.minDate=new Date(intYear,intMonth-1,intDay)}this.setMinDate=setMinDate;function setMaxDate(intYear,intMonth,intDay){this.maxDate=new Date(intYear,intMonth-1,intDay)}this.setMaxDate=setMaxDate;this.minYearChoice=dteToday.getFullYear()-10;this.maxYearChoice=dteToday.getFullYear()+10;this.textBox=function(){if(!blnInConstructor){return eval("document."+this.formName+"."+this.textBoxName)}};this.getSelectedDate=function(){var strTempVal="";var objEle;if((typeof this.formName!="undefined")&&(typeof this.textBoxName!="undefined")){objEle=eval("document."+this.formName+"."+this.textBoxName);if(objEle&&!blnInConstructor){strTempVal=eval("document."+this.formName+"."+this.textBoxName+".value")}else{strTempVal=strDefaultValue}}else{strTempVal=strDefaultValue}return strTempVal};function setSelectedDate(strWhat){var strTempVal="";var objEle;eval("document."+this.formName+"."+this.textBoxName).value=strWhat;if(!calMgr.isDate(quote(strWhat),quote(this.dateFormat))){eval("document."+this.formName+"."+this.textBoxName).className="cal-TextBoxInvalid"}else{eval("document."+this.formName+"."+this.textBoxName).className="cal-TextBox"}}this.setSelectedDate=setSelectedDate;function disable(){this.hide();calMgr.swapImg(this,".imgDisabled",false);this.enabled=false;eval("document."+this.formName+"."+this.textBoxName).disabled=true;eval("document."+this.formName+"."+this.textBoxName).className="cal-TextBoxDisabled";if(scNN){eval("document."+this.formName+"."+this.textBoxName).onFocus=function(){this.blur()}}}this.disable=disable;function enable(){this.enabled=true;calMgr.swapImg(this,".imgUp",false);eval("document."+this.formName+"."+this.textBoxName).disabled=false;eval("document."+this.formName+"."+this.textBoxName).className="cal-TextBox";if(scNN){eval("document."+this.formName+"."+this.textBoxName).onFocus=null}if(!calMgr.isDate(quote(this.getSelectedDate()),quote(this.dateFormat))){eval("document."+this.formName+"."+this.textBoxName).className="cal-TextBoxInvalid"}}this.enable=enable;this.JStoRunOnSelect="";this.JStoRunOnClear="";this.JStoRunOnCancel="";this.hideCombos=true;function makeCalendar(intWhatMonth,intWhatYear,bViewOnly){if(bViewOnly){intWhatMonth-=1}var strOutput="";var intStartMonth=intWhatMonth;var intStartYear=intWhatYear;var intLoop;var strTemp="";var strDateColWidth;var isWE=false;dteCur.setMonth(intWhatMonth);dteCur.setFullYear(intWhatYear);dteCur.setDate(dteToday.getDate());dteCur.setHours(0);dteCur.setMinutes(0);dteCur.setSeconds(0);dteCur.setMilliseconds(0);if(!(bViewOnly)){strTemp='<form name="spiffyCal">'}if(scNN6){strOutput+=strTemp+'<table width="185" border="3" class="cal-Table" cellspacing="0" cellpadding="0"><tr>'}else{strOutput+='<table width="185" border="3" class="cal-Table" cellspacing="0" cellpadding="0">'+strTemp+"<tr>"}if(!(bViewOnly)){strOutput+='<td class="cal-HeadCell" align="center" width="100%"><a href="javascript:'+this.varName+'.clearDay();"><img name="calbtn1" src="'+strDefBtnImgPath+'btn_del_small.gif" border="0" width="12" height="10"></a>&nbsp;&nbsp;<a href="javascript:'+this.varName+'.scrollMonth(-1);" class="cal-DayLink">&lt;</a>&nbsp;<SELECT class="cal-ComboBox" NAME="cboMonth" onChange="'+this.varName+'.changeMonth();">';for(intLoop=0;intLoop<12;intLoop++){if(intLoop==intWhatMonth){strOutput+='<OPTION VALUE="'+intLoop+'" SELECTED>'+msNames[intLoop]+"</OPTION>"}else{strOutput+='<OPTION VALUE="'+intLoop+'">'+msNames[intLoop]+"</OPTION>"}}strOutput+='</SELECT><SELECT class="cal-ComboBox" NAME="cboYear" onChange="'+this.varName+'.changeYear();">';for(intLoop=this.minYearChoice;intLoop<this.maxYearChoice;intLoop++){if(intLoop==intWhatYear){strOutput+='<OPTION VALUE="'+intLoop+'" SELECTED>'+intLoop+"</OPTION>"}else{strOutput+='<OPTION VALUE="'+intLoop+'">'+intLoop+"</OPTION>"}}strOutput+='</SELECT>&nbsp;<a href="javascript:'+this.varName+'.scrollMonth(1);" class="cal-DayLink">&gt;</a>&nbsp;&nbsp;<a href="javascript:'+this.varName+'.hide();"><img name="calbtn2" src="'+strDefBtnImgPath+'btn_close_small.gif" border="0" width="12" height="10"></a></td></tr><tr><td width="100%" align="center">'}else{strOutput+='<td class="cal-HeadCell" align="center" width="100%">'+msNames[intWhatMonth]+"-"+intWhatYear+'</td></tr><tr><td width="100%" align="center">'}firstDay=new Date(intWhatYear,intWhatMonth,1);startDay=firstDay.getDay();if(((intWhatYear%4==0)&&(intWhatYear%100!=0))||(intWhatYear%400==0)){msDays[1]=29}else{msDays[1]=28}strOutput+='<table width="185" cellspacing="1" cellpadding="2" border="0"><tr>';for(intLoop=0;intLoop<7;intLoop++){if(intLoop==0||intLoop==6){strDateColWidth="15%"}else{strDateColWidth="14%"}strOutput+='<td class="cal-HeadCell" width="'+strDateColWidth+'" align="center" valign="middle">'+msDOW[intLoop]+"</td>"}strOutput+="</tr><tr>";var intColumn=0;var intLastMonth=intWhatMonth-1;var intLastYear=intWhatYear;if(intLastMonth==-1){intLastMonth=11;intLastYear=intLastYear-1}for(intLoop=0;intLoop<startDay;intLoop++,intColumn++){strOutput+=this.getDayLink(true,(msDays[intLastMonth]-startDay+intLoop+1),intLastMonth,intLastYear,bViewOnly,isWE)}for(intLoop=1;intLoop<=msDays[intWhatMonth];intLoop++,intColumn++){if((intColumn%6)==0){isWE=true}else{isWE=false}strOutput+=this.getDayLink(false,intLoop,intWhatMonth,intWhatYear,bViewOnly,isWE);if(intColumn==6){strOutput+="</tr><tr>";intColumn=-1}}var intNextMonth=intWhatMonth+1;var intNextYear=intWhatYear;if(intNextMonth==12){intNextMonth=0;intNextYear=intNextYear+1}if(intColumn>0){for(intLoop=1;intColumn<7;intLoop++,intColumn++){strOutput+=this.getDayLink(true,intLoop,intNextMonth,intNextYear,bViewOnly)}strOutput+="</tr></table></td></tr>"}else{strOutput=strOutput.substr(0,strOutput.length-4);strOutput+='</table><div style="background-color:#000000;text-align:left"><font color=yellow>Please Note: </font><font color=white>Specifying a date range will substantially slow the search. Please be patient.</font></div></td></tr>'}if(scNN6){strOutput+="</table></form>"}else{strOutput+="</form></table>"}dteCur.setDate(1);dteCur.setHours(0);dteCur.setMinutes(0);dteCur.setSeconds(0);dteCur.setMilliseconds(0);dteCur.setMonth(intStartMonth);dteCur.setFullYear(intStartYear);return strOutput}this.makeCalendar=makeCalendar;function writeControl(){var strHold="";var strTemp="";var strTempMinDate="";var strTempMaxDate="";if(this.readonly){strTemp=' onFocus="this.blur();" readonly '}if(this.focusClick){strTemp=' onFocus="'+this.varName+'.show();" '}if(!(this.useDateRange)){strTemp+=' onChange="calMgr.validateDate(document.'+this.formName+"."+this.textBoxName+","+this.varName+'.required);" onBlur="calMgr.formatDate(document.'+this.formName+"."+this.textBoxName+","+this.varName+'.dateFormat);" '}else{strTempMinDate=this.minDate.getDate()+"-"+msNames[this.minDate.getMonth()]+"-"+this.minDate.getFullYear();strTempMaxDate=this.maxDate.getDate()+"-"+msNames[this.maxDate.getMonth()]+"-"+this.maxDate.getFullYear();strTemp+=' onChange="calMgr.validateDate(document.'+this.formName+"."+this.textBoxName+","+this.varName+".required,"+this.varName+".minDate,"+this.varName+'.maxDate);" onBlur="calMgr.formatDate(document.'+this.formName+"."+this.textBoxName+","+this.varName+'.dateFormat);" '}strHold='<input class="cal-TextBox" type="text" name="'+this.textBoxName+'"'+strTemp+'size="12" value="'+this.getSelectedDate()+'">';if(!scIE){strTemp=' href="javascript:calClick();return false;" '}else{strTemp=""}if((this.focusClick==false)||(this.focusClick==true&&this.hideButton==false)){strHold+='<a class="so-BtnLink"'+strTemp;strHold+=' onmouseover="calMgr.swapImg('+this.varName+",'.imgOver',false);\" ";strHold+='onmouseout="calMgr.swapImg('+this.varName+",'.imgUp',false);\" ";strHold+='onclick="calMgr.swapImg('+this.varName+",'.imgDown',true);";strHold+=this.varName+'.show();">';strHold+='<img align="absmiddle" border="0" name="'+this.btnName+'" src="'+strBtnImg+'" width="'+strBtnW+'" height="'+strBtnH+'"></a>'}document.write(strHold)}this.writeControl=writeControl;function show(){var strCurSelDate=calMgr.lastSelectedDate;if(!this.enabled){return}calMgr.hideAllCalendars(this);if(this.visible){this.hide()}else{if(document.images.calbtn1!=null){document.images.calbtn1.src=img_Del.src}if(document.images.calbtn2!=null){document.images.calbtn2.src=img_Close.src}if(this.focusClick==true&&this.hideButton==true){scX=this.x;scY=this.y}else{if(scIE){if(this.displayLeft){scX=getOffsetLeft(document.images[this.btnName])-192+document.images[this.btnName].width}else{scX=getOffsetLeft(document.images[this.btnName])}if(this.displayTop){scY=getOffsetTop(document.images[this.btnName])-138}else{scY=getOffsetTop(document.images[this.btnName])+document.images[this.btnName].height+2}}else{if(scNN){if(this.displayLeft){scX=document.images[this.btnName].x-192+document.images[this.btnName].width}else{scX=document.images[this.btnName].x}if(this.displayTop){scY=document.images[this.btnName].y-134}else{scY=document.images[this.btnName].y+document.images[this.btnName].height+2}}}}if(this.hideCombos){toggleCombos("hidden")}if(this.getSelectedDate()==""){if(!(dteCur)){domlay("spiffycalendar",1,scX,scY,this.makeCalendar(dteToday.getMonth(),dteToday.getFullYear()))}else{domlay("spiffycalendar",1,scX,scY,this.makeCalendar(dteCur.getMonth(),dteCur.getFullYear()))}}else{if(calMgr.isDate(quote(this.getSelectedDate()),quote(this.dateFormat))){dteCur=calMgr.getDateFromFormat(quote(this.getSelectedDate()),quote(this.dateFormat));dteCur.setHours(0);dteCur.setMinutes(0);dteCur.setSeconds(0);dteCur.setMilliseconds(0)}else{dteCur=calMgr.lastSelectedDate}domlay("spiffycalendar",1,scX,scY,this.makeCalendar(dteCur.getMonth(),dteCur.getFullYear()))}this.visible=true}}this.show=show;function hide(){domlay("spiffycalendar",0,scX,scY);this.visible=false;calMgr.swapImg(this,".imgUp",false);if(this.hideCombos){toggleCombos("visible")}}this.hide=hide;function clearDay(){eval("document."+this.formName+"."+this.textBoxName+".value = ''");this.hide();if(this.JStoRunOnClear!=null){eval(unescape(this.JStoRunOnClear))}eval("document."+this.formName+"."+this.textBoxName).className="cal-TextBox";if(this.required){eval("document."+this.formName+"."+this.textBoxName).className="cal-TextBoxInvalid"}}this.clearDay=clearDay;function changeDay(intWhatDay){dteCur.setDate(intWhatDay);dteCur.setHours(0);dteCur.setMinutes(0);dteCur.setSeconds(0);dteCur.setMilliseconds(0);this.textBox().value=calMgr.scFormatDate(dteCur,this.dateFormat);this.hide();if(this.JStoRunOnSelect!=null){eval(unescape(this.JStoRunOnSelect))}eval("document."+this.formName+"."+this.textBoxName).className="cal-TextBox"}this.changeDay=changeDay;function scrollMonth(intAmount){var intMonthCheck;var intYearCheck;if(scIE){intMonthCheck=document.forms.spiffyCal.cboMonth.selectedIndex+intAmount}else{if(scNN){intMonthCheck=document.spiffycalendar.document.forms.spiffyCal.cboMonth.selectedIndex+intAmount}}if(intMonthCheck<0){intYearCheck=dteCur.getFullYear()-1;if(intYearCheck<this.minYearChoice){intYearCheck=this.minYearChoice;intMonthCheck=0}else{intMonthCheck=11}dteCur.setFullYear(intYearCheck)}else{if(intMonthCheck>11){intYearCheck=dteCur.getFullYear()+1;if(intYearCheck>this.maxYearChoice-1){intYearCheck=this.maxYearChoice-1;intMonthCheck=11}else{intMonthCheck=0}dteCur.setFullYear(intYearCheck)}}if(scIE){dteCur.setMonth(document.forms.spiffyCal.cboMonth.options[intMonthCheck].value)}else{if(scNN){dteCur.setMonth(document.spiffycalendar.document.forms.spiffyCal.cboMonth.options[intMonthCheck].value)}}domlay("spiffycalendar",1,scX,scY,this.makeCalendar(dteCur.getMonth(),dteCur.getFullYear()))}this.scrollMonth=scrollMonth;function changeMonth(){if(scIE){dteCur.setMonth(document.forms.spiffyCal.cboMonth.options[document.forms.spiffyCal.cboMonth.selectedIndex].value);domlay("spiffycalendar",1,scX,scY,this.makeCalendar(dteCur.getMonth(),dteCur.getFullYear()))}else{if(scNN){dteCur.setMonth(document.spiffycalendar.document.forms.spiffyCal.cboMonth.options[document.spiffycalendar.document.forms.spiffyCal.cboMonth.selectedIndex].value);domlay("spiffycalendar",1,scX,scY,this.makeCalendar(dteCur.getMonth(),dteCur.getFullYear()))}}}this.changeMonth=changeMonth;function changeYear(){if(scIE){dteCur.setFullYear(document.forms.spiffyCal.cboYear.options[document.forms.spiffyCal.cboYear.selectedIndex].value);domlay("spiffycalendar",1,scX,scY,this.makeCalendar(dteCur.getMonth(),dteCur.getFullYear()))}else{if(scNN){dteCur.setFullYear(document.spiffycalendar.document.forms.spiffyCal.cboYear.options[document.spiffycalendar.document.forms.spiffyCal.cboYear.selectedIndex].value);domlay("spiffycalendar",1,scX,scY,this.makeCalendar(dteCur.getMonth(),dteCur.getFullYear()))}}}this.changeYear=changeYear;function getDayLink(blnIsGreyDate,intLinkDay,intLinkMonth,intLinkYear,bViewOnly,isWE){var templink;var tempLinkClass="calDay-Link";var tempClass="cal-DayCell";var tempDt="";var isHol=-1;var holTxt="";if(isWE==true&&this.showWeekends==true){tempClass="cal-WeekendCell"}tempDt=msNames[intLinkMonth]+"-"+intLinkDay;if(this.showHolidays){isHol=calMgr.isHoliday(tempDt);if(isHol!=-1){holTxt=' title="'+calMgr.HolidaysDesc[isHol]+'"';tempClass="cal-HolidayCell"}}if(!(this.useDateRange)){if(blnIsGreyDate){templink='<td align="center" class="cal-GreyDate">'+intLinkDay+"</td>"}else{if(isDayToday(intLinkDay)){if(!(bViewOnly)){templink='<td align="center" class="'+tempClass+'"><a class="cal-TodayLink" '+holTxt+' onmouseover="self.status=\' \';return true" href="javascript:'+this.varName+".changeDay("+intLinkDay+');">'+intLinkDay+"</a></td>"}else{templink='<td align="center" class="'+tempClass+'"><span class="cal-Today">'+intLinkDay+"</span></td>"}}else{if(!(bViewOnly)){templink='<td align="center" class="'+tempClass+'"><a class="cal-DayLink" '+holTxt+' onmouseover="self.status=\' \';return true" href="javascript:'+this.varName+".changeDay("+intLinkDay+');">'+intLinkDay+"</a></td>"}else{templink='<td align="center" class="'+tempClass+'"><span class="cal-Day">'+intLinkDay+"</span></td>"}}}}else{if(this.isDayValid(intLinkDay,intLinkMonth,intLinkYear)){if(blnIsGreyDate){templink='<td align="center" class="cal-GreyDate">'+intLinkDay+"</td>"}else{if(isDayToday(intLinkDay)){if(!(bViewOnly)){templink='<td align="center" class="'+tempClass+'"><a class="cal-TodayLink" '+holTxt+' onmouseover="self.status=\' \';return true" href="javascript:'+this.varName+".changeDay("+intLinkDay+');">'+intLinkDay+"</a></td>"}else{templink='<td align="center" class="'+tempClass+'"><span class="cal-Today">'+intLinkDay+"</span></td>"}}else{if(!(bViewOnly)){templink='<td align="center" class="'+tempClass+'"><a class="cal-DayLink" '+holTxt+' onmouseover="self.status=\' \';return true" href="javascript:'+this.varName+".changeDay("+intLinkDay+');">'+intLinkDay+"</a></td>"}else{templink='<td align="center" class="'+tempClass+'"><span class="cal-Day">'+intLinkDay+"</span></td>"}}}}else{templink='<td align="center" class="cal-GreyInvalidDate">'+intLinkDay+"</td>"}}return templink}this.getDayLink=getDayLink;function toggleCombos(showHow){var i;var j;var cboX;var cboY;for(i=0;i<document.forms.length;i++){for(j=0;j<document.forms[i].elements.length;j++){if(document.forms[i].elements[j].tagName=="SELECT"){if(document.forms[i].name!="spiffyCal"){cboX=getOffsetLeft(document.forms[i].elements[j]);cboY=getOffsetTop(document.forms[i].elements[j]);if(((cboX>=scX-15)&&(cboX<=scX+200))&&((cboY>=scY-15)&&(cboY<=scY+145))){document.forms[i].elements[j].style.visibility=showHow}cboX=cboX+parseInt(document.forms[i].elements[j].style.width);cboY=cboY+15;if(((cboX>=scX+15)&&(cboX<=scX+200))&&((cboY>=scY-15)&&(cboY<=scY+145))){document.forms[i].elements[j].style.visibility=showHow}}}}}}function isDayToday(intWhatDay){if((dteCur.getFullYear()==dteToday.getFullYear())&&(dteCur.getMonth()==dteToday.getMonth())&&(intWhatDay==dteToday.getDate())){return true}else{return false}}function isDayValid(intWhatDay,intWhatMonth,intWhatYear){dteCur.setDate(intWhatDay);dteCur.setMonth(intWhatMonth);dteCur.setFullYear(intWhatYear);dteCur.setHours(0);dteCur.setMinutes(0);dteCur.setSeconds(0);dteCur.setMilliseconds(0);if((dteCur>=this.minDate)&&(dteCur<=this.maxDate)){return true}else{return false}}this.isDayValid=isDayValid;calMgr.addCalendar(this);blnInConstructor=false}function quote(a){return"'"+a+"'"}function getOffsetLeft(b){var a=b.offsetLeft;while((b=b.offsetParent)!=null){a+=b.offsetLeft}return a}function getOffsetTop(a){var b=a.offsetTop;while((a=a.offsetParent)!=null){b+=a.offsetTop}return b}function calClick(){window.focus()}function domlay(e,b,c,a,d){if(b=="1"){if(document.layers){document.layers[""+e+""].visibility="show"}else{if(document.all){document.all[""+e+""].style.visibility="visible"}else{if(document.getElementById){document.getElementById(""+e+"").style.visibility="visible"}}}}else{if(b=="0"){if(document.layers){document.layers[""+e+""].visibility="hide"}else{if(document.all){document.all[""+e+""].style.visibility="hidden"}else{if(document.getElementById){document.getElementById(""+e+"").style.visibility="hidden"}}}}}if(c){if(document.layers){document.layers[""+e+""].left=c}else{if(document.all){document.all[""+e+""].style.left=c}else{if(document.getElementById){document.getElementById(""+e+"").style.left=c+"px"}}}}if(a){if(document.layers){document.layers[""+e+""].top=a}else{if(document.all){document.all[""+e+""].style.top=a}else{if(document.getElementById){document.getElementById(""+e+"").style.top=a+"px"}}}}if(d){if(document.layers){sprite=document.layers[""+e+""].document;sprite.open();sprite.write(d);sprite.close()}else{if(document.all){document.all[""+e+""].innerHTML=d}else{if(document.getElementById){rng=document.createRange();el=document.getElementById(""+e+"");rng.setStartBefore(el);htmlFrag=rng.createContextualFragment(d);while(el.hasChildNodes()){el.removeChild(el.lastChild)}el.appendChild(htmlFrag)}}}}}function makeArray0(){for(i=0;i<makeArray0.arguments.length;i++){this[i]=makeArray0.arguments[i]}}function Subsys_JsHttpRequest_Js(){this._construct()}(function(){var COUNT=0;var PENDING={};var CACHE={};Subsys_JsHttpRequest_Js.dataReady=function(id,text,js){var undef;var th=PENDING[id];delete PENDING[id];if(th){delete th._xmlReq;if(th.caching){CACHE[th.hash]=[text,js]}th._dataReady(text,js)}else{if(typeof(th)!=typeof(undef)){alert("ScriptLoader: unknown pending id: "+id)}}};Subsys_JsHttpRequest_Js.prototype={onreadystatechange:null,readyState:0,responseText:null,responseXML:null,status:200,statusText:"OK",session_name:"PHPSESSID",responseJS:null,caching:false,fallbackToScript:false,_span:null,_id:null,_xmlReq:null,_openArg:null,_reqHeaders:null,dummy:function(){},abort:function(){if(this._xmlReq){return this._xmlReq.abort()}if(this._span){this.readyState=0;if(this.onreadystatechange){this.onreadystatechange()}this._cleanupScript()}},open:function(method,url,asyncFlag,username,password){this._openArg={method:method,url:url,asyncFlag:asyncFlag,username:username!=null?username:"",password:password!=null?password:""};this._id=null;this._xmlReq=null;this._reqHeaders=[];return true},send:function(content){var id=(new Date().getTime())+""+COUNT++;var query=this._hash2query(content);var url=this._openArg.url;var sid=this._getSid();if(sid){url+=(url.indexOf("?")>=0?"&":"?")+this.session_name+"="+this.escape(sid)}var hash=this.hash=url+"?"+query;if(this.caching&&CACHE[hash]){var c=CACHE[hash];this._dataReady(c[0],c[1]);return false}this._xmlReq=this._obtainXmlReq(id,url);var hasSetHeader=this._xmlReq&&(window.ActiveXObject||this._xmlReq.setRequestHeader);var href,body;var method=(""+this._openArg.method).toUpperCase();if(this._xmlReq&&hasSetHeader&&method=="POST"){this._openArg.method="POST";href=url;body=query}else{if(method!="GET"&&!this.fallbackToScript&&query.length>2000){throw"Cannot use XMLHttpRequest nor Microsoft.XMLHTTP for long POST query: object not implemented or disabled in browser."}this._openArg.method="GET";href=url+(url.indexOf("?")>=0?"&":"?")+query;body=null}href=href+(href.indexOf("?")>=0?"&":"?")+id;PENDING[id]=this;if(this._xmlReq){var a=this._openArg;this._xmlReq.open(a.method,href+"-xml",a.asyncFlag,a.username,a.password);if(hasSetHeader){for(var i=0;i<this._reqHeaders.length;i++){this._xmlReq.setRequestHeader(this._reqHeaders[i][0],this._reqHeaders[i][1])}this._xmlReq.setRequestHeader("Content-Type","application/octet-stream")}return this._xmlReq.send(body)}else{this._obtainScript(id,href);return true}},getAllResponseHeaders:function(){if(this._xmlReq){return this._xmlReq.getAllResponseHeaders()}return""},getResponseHeader:function(label){if(this._xmlReq){return this._xmlReq.getResponseHeader(label)}return""},setRequestHeader:function(label,value){this._reqHeaders[this._reqHeaders.length]=[label,value]},_construct:function(){},_dataReady:function(text,js){with(this){if(text!==null||js!==null){readyState=4;responseText=responseXML=text;responseJS=js}else{readyState=0;responseText=responseXML=responseJS=null}if(onreadystatechange){onreadystatechange()}_cleanupScript()}},_obtainXmlReq:function(id,url){var p=url.match(new RegExp("^[a-z]+://(.*)","i"));if(p){var curHost=document.location.host.toLowerCase();if(p[1].substring(0,curHost.length).toLowerCase()==curHost){url=p[1].substring(curHost.length,p[1].length)}else{return null}}var req=null;if(window.XMLHttpRequest){try{req=new XMLHttpRequest()}catch(e){}}else{if(window.ActiveXObject){try{req=new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}if(!req){try{req=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){}}}}if(req){var th=this;req.onreadystatechange=function(){var s=req.readyState;if(s==4){req.onreadystatechange=th.dummy;var responseText=req.responseText;try{eval(responseText)}catch(e){Subsys_JsHttpRequest_Js.dataReady(id,"JavaScript code generated by backend is invalid!\n"+responseText,null)}}else{th.readyState=s;if(th.onreadystatechange){th.onreadystatechange()}}};this._id=id}return req},_obtainScript:function(id,href){with(document){var span=null;var span=createElement("SPAN");span.style.display="none";body.appendChild(span);span.innerHTML="Text for stupid IE.<script><\/script>";setTimeout(function(){var s=span.getElementsByTagName("script")[0];s.language="JavaScript";if(s.setAttribute){s.setAttribute("src",href)}else{s.src=href}},10);this._id=id;this._span=span}},_cleanupScript:function(){var span=this._span;if(span){this._span=null;setTimeout(function(){span.parentNode.removeChild(span)},50)}return false},_hash2query:function(content,prefix){if(prefix==null){prefix=""}var query=[];if(content instanceof Object){for(var k in content){var v=content[k];if(v==null||((v.constructor||{}).prototype||{})[k]){continue}var curPrefix=prefix?prefix+"["+this.escape(k)+"]":this.escape(k);if(v instanceof Object){query[query.length]=this._hash2query(v,curPrefix)}else{query[query.length]=curPrefix+"="+this.escape(v)}}}else{query=[content]}return query.join("&")},_getSid:function(){var m=document.location.search.match(new RegExp("[&?]"+this.session_name+"=([^&?]*)"));var sid=null;if(m){sid=m[1]}else{var m=document.cookie.match(new RegExp("(;|^)\\s*"+this.session_name+"=([^;]*)"));if(m){sid=m[2]}}return sid},escape:function(s){return escape(s).replace(new RegExp("\\+","g"),"%2B")}}})();function chk_pfield(){if(document.form4.p1_f_nm.value=='' || document.form4.p2_f_nm.value=='' || document.form4.p3_f_nm.value=='' || document.form4.p1_l_nm.value=='' || document.form4.p2_l_nm.value=='' || document.form4.p3_l_nm.value=='' || document.form4.p1_email.value=='' || document.form4.p2_email.value=='' || document.form4.p3_email.value==''){alert("Passengers First name and Last name must be entered.");return false;}else{return true;}}function showTotalAmount_galapagos_holdtour(b){var c=document.form2.num_passengers_choose.value;var a="$ "+(c*b)+".00 USD";document.form2.tot_amount.value=a}