function getDateFromString(b,a){return $.datepicker.parseDate(a,b)}function getStringFromDate(b,a){return $.datepicker.formatDate(a,b)}var dateFormat="mm/dd/yy";var dateFormat2="mm/dd/yyyy";var destinationFormat="mm/dd/yy";function isDate(a){try{var c=getDateFromString(a,dateFormat);if(c>0){return true}else{return false}}catch(b){return false}}function computeLaterDate(c,a,d){if(typeof d=="undefined"){d=1}if(isDate($(c).val())){var e=getDateFromString($(c).val(),dateFormat);if(isDate($(a).val())){var b=getDateFromString($(a).val(),dateFormat);if(b<e){b=new Date(e.getTime()+86400000);$(a).val(getStringFromDate(b,dateFormat));$(a).trigger("change")}}else{if(d>0){var b=new Date(e.getTime()+86400000*d);$(a).val(getStringFromDate(b,dateFormat));$(a).trigger("change")}}}}function convertDates(a,d,c,b){if(a!=""&&$(a).val()!=""&&isDate($(a).val())){$(d).val(getStringFromDate(new Date(getDateFromString($(a).val(),dateFormat)),destinationFormat))}if(c!=""&&$(c).val()!=""&&isDate($(c).val())){$(b).val(getStringFromDate(new Date(getDateFromString($(c).val(),dateFormat)),destinationFormat))}return true}var curDateForValidation;$().ready(function(){$("input.datepicker").datepicker({numberOfMonths:2,showAnim:"",showOtherMonths:true,buttonImage:"http://data.travelzoo.com/static/images/calendar.gif",buttonImageOnly:true,buttonText:"calendar",showOn:"both",dateFormat:dateFormat,minDate:0,maxDate:+330})});$().ready(function(){$(".showdateformat").each(function(){if($(this).val()==""){$(this).addClass("dateformatstyle");$(this).val(dateFormat2)}});$(".showdateformat").bind("focus",function(){if($(this).val()==dateFormat2){$(this).val("");$(this).removeClass("dateformatstyle")}});$(".showdateformat").bind("blur",function(){if($(this).val()==""){$(this).addClass("dateformatstyle");$(this).val(dateFormat2)}});$(".showdateformat").bind("change",function(){if($(this).val()!=""&&$(this).val()!=dateFormat2){if(isDate($(this).val())){$(this).removeClass("dateformatstyle")}else{$(this).val(dateFormat2)}}})});