function getAnchorPosition(B){var E=false;var J=new Object();var I=0,G=0;var D=false,F=false,H=false;if(document.getElementById){D=true}else{if(document.all){F=true}else{if(document.layers){H=true}}}if(D&&document.all){I=AnchorPosition_getPageOffsetLeft(document.all[B]);G=AnchorPosition_getPageOffsetTop(document.all[B])}else{if(D){var A=document.getElementById(B);I=AnchorPosition_getPageOffsetLeft(A);G=AnchorPosition_getPageOffsetTop(A)}else{if(F){I=AnchorPosition_getPageOffsetLeft(document.all[B]);G=AnchorPosition_getPageOffsetTop(document.all[B])}else{if(H){var K=0;for(var C=0;C<document.anchors.length;C++){if(document.anchors[C].name==B){K=1;break}}if(K==0){J.x=0;J.y=0;return J}I=document.anchors[C].x;G=document.anchors[C].y}else{J.x=0;J.y=0;return J}}}}J.x=I;J.y=G;return J}function getAnchorWindowPosition(B){var C=getAnchorPosition(B);var A=0;var D=0;if(document.getElementById){if(isNaN(window.screenX)){A=C.x-document.body.scrollLeft+window.screenLeft;D=C.y-document.body.scrollTop+window.screenTop}else{A=C.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;D=C.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset}}else{if(document.all){A=C.x-document.body.scrollLeft+window.screenLeft;D=C.y-document.body.scrollTop+window.screenTop}else{if(document.layers){A=C.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;D=C.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset}}}C.x=A;C.y=D;return C}function AnchorPosition_getPageOffsetLeft(B){var A=B.offsetLeft;while((B=B.offsetParent)!=null){A+=B.offsetLeft}return A}function AnchorPosition_getWindowOffsetLeft(A){return AnchorPosition_getPageOffsetLeft(A)-document.body.scrollLeft}function AnchorPosition_getPageOffsetTop(A){var B=A.offsetTop;while((A=A.offsetParent)!=null){B+=A.offsetTop}return B}function AnchorPosition_getWindowOffsetTop(A){return AnchorPosition_getPageOffsetTop(A)-document.body.scrollTop}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");var DAY_NAMES=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sun","Mon","Tue","Wed","Thu","Fri","Sat");function LZ(A){return(A<0||A>9?"":"0")+A}function isDate(C,B){var A=getDateFromFormat(C,B);if(A==0){return false}return true}function compareDates(E,F,C,D){var B=getDateFromFormat(E,F);var A=getDateFromFormat(C,D);if(B==0||A==0){return -1}else{if(B>A){return 1}}return 0}function formatDate(f,a){a=a+"";var J="";var T=0;var e="";var D="";var I=f.getYear()+"";var F=f.getMonth()+1;var b=f.getDate();var N=f.getDay();var L=f.getHours();var V=f.getMinutes();var P=f.getSeconds();var R,S,B,Q,g,C,Z,Y,W,O,l,L,j,G,A,X;var U=new Object();if(I.length<4){I=""+(I-0+1900)}U.y=""+I;U.yyyy=I;U.yy=I.substring(2,4);U.M=F;U.MM=LZ(F);U.MMM=MONTH_NAMES[F-1];U.NNN=MONTH_NAMES[F+11];U.d=b;U.dd=LZ(b);U.E=DAY_NAMES[N+7];U.EE=DAY_NAMES[N];U.H=L;U.HH=LZ(L);if(L==0){U.h=12}else{if(L>12){U.h=L-12}else{U.h=L}}U.hh=LZ(U.h);if(L>11){U.K=L-12}else{U.K=L}U.k=L+1;U.KK=LZ(U.K);U.kk=LZ(U.k);if(L>11){U.a="PM"}else{U.a="AM"}U.m=V;U.mm=LZ(V);U.s=P;U.ss=LZ(P);while(T<a.length){e=a.charAt(T);D="";while((a.charAt(T)==e)&&(T<a.length)){D+=a.charAt(T++)}if(U[D]!=null){J=J+U[D]}else{J=J+D}}return J}function _isInteger(C){var B="1234567890";for(var A=0;A<C.length;A++){if(B.indexOf(C.charAt(A))==-1){return false}}return true}function _getInt(F,D,E,C){for(var A=C;A>=E;A--){var B=F.substring(D,D+A);if(B.length<E){return null}if(_isInteger(B)){return B}}return null}function getDateFromFormat(U,N){U=U+"";N=N+"";var T=0;var J=0;var P="";var E="";var S="";var G,F;var B=new Date();var H=B.getYear();var R=B.getMonth()+1;var Q=1;var C=B.getHours();var O=B.getMinutes();var L=B.getSeconds();var I="";while(J<N.length){P=N.charAt(J);E="";while((N.charAt(J)==P)&&(J<N.length)){E+=N.charAt(J++)}if(E=="yyyy"||E=="yy"||E=="y"){if(E=="yyyy"){G=4;F=4}if(E=="yy"){G=2;F=2}if(E=="y"){G=2;F=4}H=_getInt(U,T,G,F);if(H==null){return 0}T+=H.length;if(H.length==2){if(H>70){H=1900+(H-0)}else{H=2000+(H-0)}}}else{if(E=="MMM"||E=="NNN"){R=0;for(var M=0;M<MONTH_NAMES.length;M++){var D=MONTH_NAMES[M];if(U.substring(T,T+D.length).toLowerCase()==D.toLowerCase()){if(E=="MMM"||(E=="NNN"&&M>11)){R=M+1;if(R>12){R-=12}T+=D.length;break}}}if((R<1)||(R>12)){return 0}}else{if(E=="EE"||E=="E"){for(var M=0;M<DAY_NAMES.length;M++){var K=DAY_NAMES[M];if(U.substring(T,T+K.length).toLowerCase()==K.toLowerCase()){T+=K.length;break}}}else{if(E=="MM"||E=="M"){R=_getInt(U,T,E.length,2);if(R==null||(R<1)||(R>12)){return 0}T+=R.length}else{if(E=="dd"||E=="d"){Q=_getInt(U,T,E.length,2);if(Q==null||(Q<1)||(Q>31)){return 0}T+=Q.length}else{if(E=="hh"||E=="h"){C=_getInt(U,T,E.length,2);if(C==null||(C<1)||(C>12)){return 0}T+=C.length}else{if(E=="HH"||E=="H"){C=_getInt(U,T,E.length,2);if(C==null||(C<0)||(C>23)){return 0}T+=C.length}else{if(E=="KK"||E=="K"){C=_getInt(U,T,E.length,2);if(C==null||(C<0)||(C>11)){return 0}T+=C.length}else{if(E=="kk"||E=="k"){C=_getInt(U,T,E.length,2);if(C==null||(C<1)||(C>24)){return 0}T+=C.length;C--}else{if(E=="mm"||E=="m"){O=_getInt(U,T,E.length,2);if(O==null||(O<0)||(O>59)){return 0}T+=O.length}else{if(E=="ss"||E=="s"){L=_getInt(U,T,E.length,2);if(L==null||(L<0)||(L>59)){return 0}T+=L.length}else{if(E=="a"){if(U.substring(T,T+2).toLowerCase()=="am"){I="AM"}else{if(U.substring(T,T+2).toLowerCase()=="pm"){I="PM"}else{return 0}}T+=2}else{if(U.substring(T,T+E.length)!=E){return 0}else{T+=E.length}}}}}}}}}}}}}}if(T!=U.length){return 0}if(R==2){if(((H%4==0)&&(H%100!=0))||(H%400==0)){if(Q>29){return 0}}else{if(Q>28){return 0}}}if((R==4)||(R==6)||(R==9)||(R==11)){if(Q>30){return 0}}if(C<12&&I=="PM"){C=C-0+12}else{if(C>11&&I=="AM"){C-=12}}var A=new Date(H,R-1,Q,C,O,L);return A.getTime()}function parseDate(G){var E=(arguments.length==2)?arguments[1]:false;generalFormats=new Array("y-M-d","MMM d, y","MMM d,y","y-MMM-d","d-MMM-y","MMM d");monthFirst=new Array("M/d/y","M-d-y","M.d.y","MMM-d","M/d","M-d");dateFirst=new Array("d/M/y","d-M-y","d.M.y","d-MMM","d/M","d-M");var B=new Array("generalFormats",E?"dateFirst":"monthFirst",E?"monthFirst":"dateFirst");var F=null;for(var D=0;D<B.length;D++){var A=window[B[D]];for(var C=0;C<A.length;C++){F=getDateFromFormat(G,A[C]);if(F!=0){return new Date(F)}}}return null}function PopupWindow_getXYPosition(A){var B;if(this.type=="WINDOW"){B=getAnchorWindowPosition(A)}else{B=getAnchorPosition(A)}this.x=B.x;this.y=B.y}function PopupWindow_setSize(B,A){this.width=B;this.height=A}function PopupWindow_populate(A){this.contents=A;this.populated=false}function PopupWindow_setUrl(A){this.url=A}function PopupWindow_setWindowProperties(A){this.windowProperties=A}function PopupWindow_refresh(){if(this.divName!=null){if(this.use_gebi){document.getElementById(this.divName).innerHTML=this.contents}else{if(this.use_css){document.all[this.divName].innerHTML=this.contents}else{if(this.use_layers){var A=document.layers[this.divName];A.document.open();A.document.writeln(this.contents);A.document.close()}}}}else{if(this.popupWindow!=null&&!this.popupWindow.closed){if(this.url!=""){this.popupWindow.location.href=this.url}else{this.popupWindow.document.open();this.popupWindow.document.writeln(this.contents);this.popupWindow.document.close()}this.popupWindow.focus()}}}function PopupWindow_showPopup(A){this.getXYPosition(A);this.x+=this.offsetX;this.y+=this.offsetY;if(!this.populated&&(this.contents!="")){this.populated=true;this.refresh()}if(this.divName!=null){if(this.use_gebi){document.getElementById(this.divName).style.visibility="visible"}else{if(this.use_css){document.all[this.divName].style.visibility="visible"}else{if(this.use_layers){document.layers[this.divName].visibility="visible"}}}}else{if(this.popupWindow==null||this.popupWindow.closed){if(this.x<0){this.x=0}if(this.y<0){this.y=0}if(screen&&screen.availHeight){if((this.y+this.height)>screen.availHeight){this.y=screen.availHeight-this.height}}if(screen&&screen.availWidth){if((this.x+this.width)>screen.availWidth){this.x=screen.availWidth-this.width}}var B=window.opera||(document.layers&&!navigator.mimeTypes["*"])||navigator.vendor=="KDE"||(document.childNodes&&!document.all&&!navigator.taintEnabled);this.popupWindow=window.open(B?"":"about:blank","window_"+A,this.windowProperties+",width="+this.width+",height="+this.height+",screenX="+this.x+",left="+this.x+",screenY="+this.y+",top="+this.y+"")}this.refresh()}}function PopupWindow_hidePopup(){if(this.divName!=null&&document.getElementById(this.divName)!=null){if(this.use_gebi){document.getElementById(this.divName).style.visibility="hidden"}else{if(this.use_css){document.all[this.divName].style.visibility="hidden"}else{if(this.use_layers){document.layers[this.divName].visibility="hidden"}}}}else{if(this.popupWindow&&!this.popupWindow.closed){this.popupWindow.close();this.popupWindow=null}}}function PopupWindow_isClicked(C){if(this.divName!=null){if(this.use_layers){var D=C.pageX;var B=C.pageY;var A=document.layers[this.divName];if((D>A.left)&&(D<A.left+A.clip.width)&&(B>A.top)&&(B<A.top+A.clip.height)){return true}else{return false}}else{if(document.all){var A=window.event.srcElement;while(A.parentElement!=null){if(A.id==this.divName){return true}A=A.parentElement}return false}else{if(this.use_gebi&&C){var A=C.target;while(A.parentNode!=null){if(A.id==this.divName){return true}A=A.parentNode}return false}}}return false}return false}function PopupWindow_hideIfNotClicked(A){if(this.autoHideEnabled&&!this.isClicked(A)){this.hidePopup()}}function PopupWindow_autoHide(){this.autoHideEnabled=true}function PopupWindow_hidePopupWindows(C){for(var A=0;A<popupWindowObjects.length;A++){if(popupWindowObjects[A]!=null){var B=popupWindowObjects[A];B.hideIfNotClicked(C)}}}function PopupWindow_attachListener(){if(document.layers){document.captureEvents(Event.MOUSEUP)}window.popupWindowOldEventListener=document.onmouseup;if(window.popupWindowOldEventListener!=null){document.onmouseup=new Function("window.popupWindowOldEventListener(); PopupWindow_hidePopupWindows();")}else{document.onmouseup=PopupWindow_hidePopupWindows}}function PopupWindow(){if(!window.popupWindowIndex){window.popupWindowIndex=0}if(!window.popupWindowObjects){window.popupWindowObjects=new Array()}if(!window.listenerAttached){window.listenerAttached=true;PopupWindow_attachListener()}this.index=popupWindowIndex++;popupWindowObjects[this.index]=this;this.divName=null;this.popupWindow=null;this.width=0;this.height=0;this.populated=false;this.visible=false;this.autoHideEnabled=false;this.contents="";this.url="";this.windowProperties="toolbar=no,location=no,status=no,menubar=no,scrollbars=auto,resizable,alwaysRaised,dependent,titlebar=no";if(arguments.length>0){this.type="DIV";this.divName=arguments[0]}else{this.type="WINDOW"}this.use_gebi=false;this.use_css=false;this.use_layers=false;if(document.getElementById){this.use_gebi=true}else{if(document.all){this.use_css=true}else{if(document.layers){this.use_layers=true}else{this.type="WINDOW"}}}this.offsetX=0;this.offsetY=0;this.getXYPosition=PopupWindow_getXYPosition;this.populate=PopupWindow_populate;this.setUrl=PopupWindow_setUrl;this.setWindowProperties=PopupWindow_setWindowProperties;this.refresh=PopupWindow_refresh;this.showPopup=PopupWindow_showPopup;this.hidePopup=PopupWindow_hidePopup;this.setSize=PopupWindow_setSize;this.isClicked=PopupWindow_isClicked;this.autoHide=PopupWindow_autoHide;this.hideIfNotClicked=PopupWindow_hideIfNotClicked}function CalendarPopup(){var A;if(arguments.length>0){A=new PopupWindow(arguments[0])}else{A=new PopupWindow();A.setSize(150,175)}A.offsetX=-152;A.offsetY=25;A.autoHide();A.monthNames=new Array("January","February","March","April","May","June","July","August","September","October","November","December");A.monthAbbreviations=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");A.dayHeaders=new Array("S","M","T","W","T","F","S");A.returnFunction="CP_tmpReturnFunction";A.returnMonthFunction="CP_tmpReturnMonthFunction";A.returnQuarterFunction="CP_tmpReturnQuarterFunction";A.returnYearFunction="CP_tmpReturnYearFunction";A.weekStartDay=0;A.isShowYearNavigation=false;A.displayType="date";A.disabledWeekDays=new Object();A.disabledDatesExpression="";A.yearSelectStartOffset=2;A.currentDate=null;A.todayText="Today";A.cssPrefix="";A.isShowNavigationDropdowns=false;A.isShowYearNavigationInput=false;window.CP_calendarObject=null;window.CP_targetInput=null;window.CP_dateFormat="MM/dd/yyyy";A.copyMonthNamesToWindow=CP_copyMonthNamesToWindow;A.setReturnFunction=CP_setReturnFunction;A.setReturnMonthFunction=CP_setReturnMonthFunction;A.setReturnQuarterFunction=CP_setReturnQuarterFunction;A.setReturnYearFunction=CP_setReturnYearFunction;A.setMonthNames=CP_setMonthNames;A.setMonthAbbreviations=CP_setMonthAbbreviations;A.setDayHeaders=CP_setDayHeaders;A.setWeekStartDay=CP_setWeekStartDay;A.setDisplayType=CP_setDisplayType;A.setDisabledWeekDays=CP_setDisabledWeekDays;A.addDisabledDates=CP_addDisabledDates;A.setYearSelectStartOffset=CP_setYearSelectStartOffset;A.setTodayText=CP_setTodayText;A.showYearNavigation=CP_showYearNavigation;A.showCalendar=CP_showCalendar;A.hideCalendar=CP_hideCalendar;A.getStyles=getCalendarStyles;A.refreshCalendar=CP_refreshCalendar;A.getCalendar=CP_getCalendar;A.select=CP_select;A.setCssPrefix=CP_setCssPrefix;A.showNavigationDropdowns=CP_showNavigationDropdowns;A.showYearNavigationInput=CP_showYearNavigationInput;A.copyMonthNamesToWindow();return A}function CP_copyMonthNamesToWindow(){if(typeof (window.MONTH_NAMES)!="undefined"&&window.MONTH_NAMES!=null){window.MONTH_NAMES=new Array();for(var A=0;A<this.monthNames.length;A++){window.MONTH_NAMES[window.MONTH_NAMES.length]=this.monthNames[A]}for(var A=0;A<this.monthAbbreviations.length;A++){window.MONTH_NAMES[window.MONTH_NAMES.length]=this.monthAbbreviations[A]}}}function CP_tmpReturnFunction(G,A,F){if(window.CP_targetInput!=null){var E=new Date(G,A-1,F,0,0,0);if(window.CP_calendarObject!=null){window.CP_calendarObject.copyMonthNamesToWindow()}window.CP_targetInput.value=formatDate(E,window.CP_dateFormat);if(window.CP_targetInput.id=="pickup-date-date-input"){if(document.getElementById("return-date-date-input")){var C=getDateFromFormat(document.getElementById("return-date-date-input").value,window.CP_dateFormat);var B=new Date();B.setTime(C);if(E>B){B=E;B.setDate(E.getDate()+1);document.getElementById("return-date-date-input").value=formatDate(B,window.CP_dateFormat)}}}else{if(document.getElementById("pickup-date-date-input")){var D=getDateFromFormat(document.getElementById("pickup-date-date-input").value,window.CP_dateFormat);var B=new Date();B.setTime(D);if(E<B){B=E;B.setDate(E.getDate()-1);document.getElementById("pickup-date-date-input").value=formatDate(B,window.CP_dateFormat)}}}}else{alert("Use setReturnFunction() to define which function will get the clicked results!")}}function CP_tmpReturnMonthFunction(B,A){alert("Use setReturnMonthFunction() to define which function will get the clicked results!\nYou clicked: year="+B+" , month="+A)}function CP_tmpReturnQuarterFunction(B,A){alert("Use setReturnQuarterFunction() to define which function will get the clicked results!\nYou clicked: year="+B+" , quarter="+A)}function CP_tmpReturnYearFunction(A){alert("Use setReturnYearFunction() to define which function will get the clicked results!\nYou clicked: year="+A)}function CP_setReturnFunction(A){this.returnFunction=A}function CP_setReturnMonthFunction(A){this.returnMonthFunction=A}function CP_setReturnQuarterFunction(A){this.returnQuarterFunction=A}function CP_setReturnYearFunction(A){this.returnYearFunction=A}function CP_setMonthNames(){for(var A=0;A<arguments.length;A++){this.monthNames[A]=arguments[A]}this.copyMonthNamesToWindow()}function CP_setMonthAbbreviations(){for(var A=0;A<arguments.length;A++){this.monthAbbreviations[A]=arguments[A]}this.copyMonthNamesToWindow()}function CP_setDayHeaders(){for(var A=0;A<arguments.length;A++){this.dayHeaders[A]=arguments[A]}}function CP_setWeekStartDay(A){this.weekStartDay=A}function CP_showYearNavigation(){this.isShowYearNavigation=(arguments.length>0)?arguments[0]:true}function CP_setDisplayType(A){if(A!="date"&&A!="week-end"&&A!="month"&&A!="quarter"&&A!="year"){alert("Invalid display type! Must be one of: date,week-end,month,quarter,year");return false}this.displayType=A}function CP_setYearSelectStartOffset(A){this.yearSelectStartOffset=A}function CP_setDisabledWeekDays(){this.disabledWeekDays=new Object();for(var A=0;A<arguments.length;A++){this.disabledWeekDays[arguments[A]]=true}}function CP_addDisabledDates(B,A){if(arguments.length==1){A=B}if(B==null&&A==null){return }if(this.disabledDatesExpression!=""){this.disabledDatesExpression+="||"}if(B!=null){B=parseDate(B);B=""+B.getFullYear()+LZ(B.getMonth()+1)+LZ(B.getDate())}if(A!=null){A=parseDate(A);A=""+A.getFullYear()+LZ(A.getMonth()+1)+LZ(A.getDate())}if(B==null){this.disabledDatesExpression+="(ds<="+A+")"}else{if(A==null){this.disabledDatesExpression+="(ds>="+B+")"}else{this.disabledDatesExpression+="(ds>="+B+"&&ds<="+A+")"}}}function CP_setTodayText(A){this.todayText=A}function CP_setCssPrefix(A){this.cssPrefix=A}function CP_showNavigationDropdowns(){this.isShowNavigationDropdowns=(arguments.length>0)?arguments[0]:true}function CP_showYearNavigationInput(){this.isShowYearNavigationInput=(arguments.length>0)?arguments[0]:true}function CP_hideCalendar(){if(arguments.length>0){window.popupWindowObjects[arguments[0]].hidePopup()}else{this.hidePopup()}}function CP_refreshCalendar(A){var B=window.popupWindowObjects[A];if(arguments.length>1){B.populate(B.getCalendar(arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]))}else{B.populate(B.getCalendar())}B.refresh()}function CP_showCalendar(A){if(arguments.length>1){if(arguments[1]==null||arguments[1]==""){this.currentDate=new Date()}else{this.currentDate=new Date(parseDate(arguments[1]))}}this.populate(this.getCalendar());this.showPopup(A)}function CP_select(C,A,E){var B=(arguments.length>3)?arguments[3]:null;if(!window.getDateFromFormat){alert("calendar.select: To use this method you must also include 'date.js' for date formatting");return }if(this.displayType!="date"&&this.displayType!="week-end"){alert("calendar.select: This function can only be used with displayType 'date' or 'week-end'");return }if(C.type!="text"&&C.type!="hidden"&&C.type!="textarea"){alert("calendar.select: Input object passed is not a valid form input object");window.CP_targetInput=null;return }if(C.disabled){return }window.CP_targetInput=C;window.CP_calendarObject=this;this.currentDate=null;var D=0;if(B!=null){D=getDateFromFormat(B,E)}else{if(C.value!=""){D=getDateFromFormat(C.value,E)}}if(B!=null||C.value!=""){if(D==0){this.currentDate=null}else{this.currentDate=new Date(D)}}window.CP_dateFormat=E;this.showCalendar(A)}function getCalendarStyles(){var A="";var B="";if(this!=null&&typeof (this.cssPrefix)!="undefined"&&this.cssPrefix!=null&&this.cssPrefix!=""){B=this.cssPrefix}A+="<STYLE>\n";A+="."+B+"cpYearNavigation,."+B+"cpMonthNavigation { background-color:#C0C0C0; text-align:center; vertical-align:center; text-decoration:none; color:#000000; font-weight:bold; }\n";A+="."+B+"cpDayColumnHeader, ."+B+"cpYearNavigation,."+B+"cpMonthNavigation,."+B+"cpCurrentMonthDate,."+B+"cpCurrentMonthDateDisabled,."+B+"cpOtherMonthDate,."+B+"cpOtherMonthDateDisabled,."+B+"cpCurrentDate,."+B+"cpCurrentDateDisabled,."+B+"cpTodayText,."+B+"cpTodayTextDisabled,."+B+"cpText { font-family:arial; font-size:8pt; }\n";A+="TD."+B+"cpDayColumnHeader { text-align:right; border:solid thin #C0C0C0;border-width:0px 0px 1px 0px; }\n";A+="."+B+"cpCurrentMonthDate, ."+B+"cpOtherMonthDate, ."+B+"cpCurrentDate  { text-align:right; text-decoration:none; }\n";A+="."+B+"cpCurrentMonthDateDisabled, ."+B+"cpOtherMonthDateDisabled, ."+B+"cpCurrentDateDisabled { color:#D0D0D0; text-align:right; text-decoration:line-through; }\n";A+="."+B+"cpCurrentMonthDate, .cpCurrentDate { color:#000000; }\n";A+="."+B+"cpOtherMonthDate { color:#808080; }\n";A+="TD."+B+"cpCurrentDate { color:white; background-color: #C0C0C0; border-width:1px; border:solid thin #800000; }\n";A+="TD."+B+"cpCurrentDateDisabled { border-width:1px; border:solid thin #FFAAAA; }\n";A+="TD."+B+"cpTodayText, TD."+B+"cpTodayTextDisabled { border:solid thin #C0C0C0; border-width:1px 0px 0px 0px;}\n";A+="A."+B+"cpTodayText, SPAN."+B+"cpTodayTextDisabled { height:20px; }\n";A+="A."+B+"cpTodayText { color:black; }\n";A+="."+B+"cpTodayTextDisabled { color:#D0D0D0; }\n";A+="."+B+"cpBorder { border:solid thin #2182B7; }\n";A+="</STYLE>\n";return A}function CP_getCalendar(){var now=new Date();if(this.type=="WINDOW"){var windowref="window.opener."}else{var windowref=""}var result="";if(this.type=="WINDOW"){result+="<HTML><HEAD><TITLE>Calendar</TITLE>"+this.getStyles()+"</HEAD><BODY MARGINWIDTH=0 MARGINHEIGHT=0 TOPMARGIN=0 RIGHTMARGIN=0 LEFTMARGIN=0>\n";result+="<CENTER><TABLE WIDTH=100% BORDER=0 BORDERWIDTH=0 CELLSPACING=0 CELLPADDING=0>\n"}else{result+='<TABLE CLASS="'+this.cssPrefix+'cpBorder" WIDTH=144 CELLSPACING=0 CELLPADDING=1>\n';result+="<TR><TD ALIGN=CENTER>\n";result+="<CENTER>\n"}if(this.displayType=="date"||this.displayType=="week-end"){if(this.currentDate==null){this.currentDate=now}if(arguments.length>0){var month=arguments[0]}else{var month=this.currentDate.getMonth()+1}if(arguments.length>1&&arguments[1]>0&&arguments[1]-0==arguments[1]){var year=arguments[1]}else{var year=this.currentDate.getFullYear()}var daysinmonth=new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);if(((year%4==0)&&(year%100!=0))||(year%400==0)){daysinmonth[2]=29}var current_month=new Date(year,month-1,1);var display_year=year;var display_month=month;var display_date=1;var weekday=current_month.getDay();var offset=0;offset=(weekday>=this.weekStartDay)?weekday-this.weekStartDay:7-this.weekStartDay+weekday;if(offset>0){display_month--;if(display_month<1){display_month=12;display_year--}display_date=daysinmonth[display_month]-offset+1}var next_month=month+1;var next_month_year=year;if(next_month>12){next_month=1;next_month_year++}var last_month=month-1;var last_month_year=year;if(last_month<1){last_month=12;last_month_year--}var date_class;if(this.type!="WINDOW"){result+="<TABLE WIDTH=144 BORDER=0 BORDERWIDTH=0 CELLSPACING=0 CELLPADDING=0>"}result+="<TR>\n";var refresh=windowref+"CP_refreshCalendar";var refreshLink="javascript:"+refresh;if(this.isShowNavigationDropdowns){result+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="78" COLSPAN="3"><select CLASS="'+this.cssPrefix+'cpMonthNavigation" name="cpMonth" onChange="'+refresh+"("+this.index+",this.options[this.selectedIndex].value-0,"+(year-0)+');">';for(var monthCounter=1;monthCounter<=12;monthCounter++){var selected=(monthCounter==month)?"SELECTED":"";result+='<option value="'+monthCounter+'" '+selected+">"+this.monthNames[monthCounter-1]+"</option>"}result+="</select></TD>";result+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="10">&nbsp;</TD>';result+='<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="56" COLSPAN="3"><select CLASS="'+this.cssPrefix+'cpYearNavigation" name="cpYear" onChange="'+refresh+"("+this.index+","+month+',this.options[this.selectedIndex].value-0);">';for(var yearCounter=year-this.yearSelectStartOffset;yearCounter<=year+this.yearSelectStartOffset;yearCounter++){var selected=(yearCounter==year)?"SELECTED":"";result+='<option value="'+yearCounter+'" '+selected+">"+yearCounter+"</option>"}result+="</select></TD>"}else{if(this.isShowYearNavigation){result+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="10"><A CLASS="'+this.cssPrefix+'cpMonthNavigation" HREF="'+refreshLink+"("+this.index+","+last_month+","+last_month_year+');">&lt;</A></TD>';result+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="58"><SPAN CLASS="'+this.cssPrefix+'cpMonthNavigation">'+this.monthNames[month-1]+"</SPAN></TD>";result+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="10"><A CLASS="'+this.cssPrefix+'cpMonthNavigation" HREF="'+refreshLink+"("+this.index+","+next_month+","+next_month_year+');">&gt;</A></TD>';result+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="10">&nbsp;</TD>';result+='<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="10"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="'+refreshLink+"("+this.index+","+month+","+(year-1)+');">&lt;</A></TD>';if(this.isShowYearNavigationInput){result+='<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="36"><INPUT NAME="cpYear" CLASS="'+this.cssPrefix+'cpYearNavigation" SIZE="4" MAXLENGTH="4" VALUE="'+year+'" onBlur="'+refresh+"("+this.index+","+month+',this.value-0);"></TD>'}else{result+='<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="36"><SPAN CLASS="'+this.cssPrefix+'cpYearNavigation">'+year+"</SPAN></TD>"}result+='<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="10"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="'+refreshLink+"("+this.index+","+month+","+(year+1)+');">&gt;</A></TD>'}else{result+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="22"><A CLASS="'+this.cssPrefix+'cpMonthNavigation" HREF="'+refreshLink+"("+this.index+","+last_month+","+last_month_year+');">&lt;&lt;</A></TD>\n';result+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="100"><SPAN CLASS="'+this.cssPrefix+'cpMonthNavigation">'+this.monthNames[month-1]+" "+year+"</SPAN></TD>\n";result+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="22"><A CLASS="'+this.cssPrefix+'cpMonthNavigation" HREF="'+refreshLink+"("+this.index+","+next_month+","+next_month_year+');">&gt;&gt;</A></TD>\n'}}result+="</TR></TABLE>\n";result+="<TABLE WIDTH=120 BORDER=0 CELLSPACING=0 CELLPADDING=1 ALIGN=CENTER>\n";result+="<TR>\n";for(var j=0;j<7;j++){result+='<TD CLASS="'+this.cssPrefix+'cpDayColumnHeader" WIDTH="14%"><SPAN CLASS="'+this.cssPrefix+'cpDayColumnHeader">'+this.dayHeaders[(this.weekStartDay+j)%7]+"</TD>\n"}result+="</TR>\n";for(var row=1;row<=6;row++){result+="<TR>\n";for(var col=1;col<=7;col++){var disabled=false;if(this.disabledDatesExpression!=""){var ds=""+display_year+LZ(display_month)+LZ(display_date);eval("disabled=("+this.disabledDatesExpression+")")}var dateClass="";if((display_month==this.currentDate.getMonth()+1)&&(display_date==this.currentDate.getDate())&&(display_year==this.currentDate.getFullYear())){dateClass="cpCurrentDate"}else{if(display_month==month){dateClass="cpCurrentMonthDate"}else{dateClass="cpOtherMonthDate"}}if(disabled||this.disabledWeekDays[col-1]){result+='	<TD CLASS="'+this.cssPrefix+dateClass+'"><SPAN CLASS="'+this.cssPrefix+dateClass+'Disabled">'+display_date+"</SPAN></TD>\n"}else{var selected_date=display_date;var selected_month=display_month;var selected_year=display_year;if(this.displayType=="week-end"){var d=new Date(selected_year,selected_month-1,selected_date,0,0,0,0);d.setDate(d.getDate()+(7-col));selected_year=d.getYear();if(selected_year<1000){selected_year+=1900}selected_month=d.getMonth()+1;selected_date=d.getDate()}result+='	<TD CLASS="'+this.cssPrefix+dateClass+'"><A HREF="javascript:'+windowref+this.returnFunction+"("+selected_year+","+selected_month+","+selected_date+");"+windowref+"CP_hideCalendar('"+this.index+'\');" CLASS="'+this.cssPrefix+dateClass+'">'+display_date+"</A></TD>\n"}display_date++;if(display_date>daysinmonth[display_month]){display_date=1;display_month++}if(display_month>12){display_month=1;display_year++}}result+="</TR>"}var current_weekday=now.getDay()-this.weekStartDay;if(current_weekday<0){current_weekday+=7}result+="<TR>\n";result+='	<TD COLSPAN=7 ALIGN=CENTER CLASS="'+this.cssPrefix+'cpTodayText">\n';if(this.disabledDatesExpression!=""){var ds=""+now.getFullYear()+LZ(now.getMonth()+1)+LZ(now.getDate());eval("disabled=("+this.disabledDatesExpression+")")}if(disabled||this.disabledWeekDays[current_weekday+1]){result+='		<SPAN CLASS="'+this.cssPrefix+'cpTodayTextDisabled">'+this.todayText+"</SPAN>\n"}else{result+='		<A CLASS="'+this.cssPrefix+'cpTodayText" HREF="javascript:'+windowref+this.returnFunction+"('"+now.getFullYear()+"','"+(now.getMonth()+1)+"','"+now.getDate()+"');"+windowref+"CP_hideCalendar('"+this.index+"');\">"+this.todayText+"</A>\n"}result+="		<BR>\n";result+="	</TD></TR></TABLE></CENTER></TD></TR></TABLE>\n"}if(this.displayType=="month"||this.displayType=="quarter"||this.displayType=="year"){if(arguments.length>0){var year=arguments[0]}else{if(this.displayType=="year"){var year=now.getFullYear()-this.yearSelectStartOffset}else{var year=now.getFullYear()}}if(this.displayType!="year"&&this.isShowYearNavigation){result+="<TABLE WIDTH=144 BORDER=0 BORDERWIDTH=0 CELLSPACING=0 CELLPADDING=0>";result+="<TR>\n";result+='	<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="22"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="javascript:'+windowref+"CP_refreshCalendar("+this.index+","+(year-1)+');">&lt;&lt;</A></TD>\n';result+='	<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="100">'+year+"</TD>\n";result+='	<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="22"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="javascript:'+windowref+"CP_refreshCalendar("+this.index+","+(year+1)+');">&gt;&gt;</A></TD>\n';result+="</TR></TABLE>\n"}}if(this.displayType=="month"){result+="<TABLE WIDTH=120 BORDER=0 CELLSPACING=1 CELLPADDING=0 ALIGN=CENTER>\n";for(var i=0;i<4;i++){result+="<TR>";for(var j=0;j<3;j++){var monthindex=((i*3)+j);result+='<TD WIDTH=33% ALIGN=CENTER><A CLASS="'+this.cssPrefix+'cpText" HREF="javascript:'+windowref+this.returnMonthFunction+"("+year+","+(monthindex+1)+");"+windowref+"CP_hideCalendar('"+this.index+'\');" CLASS="'+date_class+'">'+this.monthAbbreviations[monthindex]+"</A></TD>"}result+="</TR>"}result+="</TABLE></CENTER></TD></TR></TABLE>\n"}if(this.displayType=="quarter"){result+="<BR><TABLE WIDTH=120 BORDER=1 CELLSPACING=0 CELLPADDING=0 ALIGN=CENTER>\n";for(var i=0;i<2;i++){result+="<TR>";for(var j=0;j<2;j++){var quarter=((i*2)+j+1);result+='<TD WIDTH=50% ALIGN=CENTER><BR><A CLASS="'+this.cssPrefix+'cpText" HREF="javascript:'+windowref+this.returnQuarterFunction+"("+year+","+quarter+");"+windowref+"CP_hideCalendar('"+this.index+'\');" CLASS="'+date_class+'">Q'+quarter+"</A><BR><BR></TD>"}result+="</TR>"}result+="</TABLE></CENTER></TD></TR></TABLE>\n"}if(this.displayType=="year"){var yearColumnSize=4;result+="<TABLE WIDTH=144 BORDER=0 BORDERWIDTH=0 CELLSPACING=0 CELLPADDING=0>";result+="<TR>\n";result+='	<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="50%"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="javascript:'+windowref+"CP_refreshCalendar("+this.index+","+(year-(yearColumnSize*2))+');">&lt;&lt;</A></TD>\n';result+='	<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="50%"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="javascript:'+windowref+"CP_refreshCalendar("+this.index+","+(year+(yearColumnSize*2))+');">&gt;&gt;</A></TD>\n';result+="</TR></TABLE>\n";result+="<TABLE WIDTH=120 BORDER=0 CELLSPACING=1 CELLPADDING=0 ALIGN=CENTER>\n";for(var i=0;i<yearColumnSize;i++){for(var j=0;j<2;j++){var currentyear=year+(j*yearColumnSize)+i;result+='<TD WIDTH=50% ALIGN=CENTER><A CLASS="'+this.cssPrefix+'cpText" HREF="javascript:'+windowref+this.returnYearFunction+"("+currentyear+");"+windowref+"CP_hideCalendar('"+this.index+'\');" CLASS="'+date_class+'">'+currentyear+"</A></TD>"}result+="</TR>"}result+="</TABLE></CENTER></TD></TR></TABLE>\n"}if(this.type=="WINDOW"){result+="</BODY></HTML>\n"}return result}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");var DAY_NAMES=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sun","Mon","Tue","Wed","Thu","Fri","Sat");function LZ(A){return(A<0||A>9?"":"0")+A}function isDate(C,B){var A=getDateFromFormat(C,B);if(A==0){return false}return true}function compareDates(E,F,C,D){var B=getDateFromFormat(E,F);var A=getDateFromFormat(C,D);if(B==0||A==0){return -1}else{if(B>A){return 1}}return 0}function formatDate(f,a){a=a+"";var J="";var T=0;var e="";var D="";var I=f.getYear()+"";var F=f.getMonth()+1;var b=f.getDate();var N=f.getDay();var L=f.getHours();var V=f.getMinutes();var P=f.getSeconds();var R,S,B,Q,g,C,Z,Y,W,O,l,L,j,G,A,X;var U=new Object();if(I.length<4){I=""+(I-0+1900)}U.y=""+I;U.yyyy=I;U.yy=I.substring(2,4);U.M=F;U.MM=LZ(F);U.MMM=MONTH_NAMES[F-1];U.NNN=MONTH_NAMES[F+11];U.d=b;U.dd=LZ(b);U.E=DAY_NAMES[N+7];U.EE=DAY_NAMES[N];U.H=L;U.HH=LZ(L);if(L==0){U.h=12}else{if(L>12){U.h=L-12}else{U.h=L}}U.hh=LZ(U.h);if(L>11){U.K=L-12}else{U.K=L}U.k=L+1;U.KK=LZ(U.K);U.kk=LZ(U.k);if(L>11){U.a="PM"}else{U.a="AM"}U.m=V;U.mm=LZ(V);U.s=P;U.ss=LZ(P);while(T<a.length){e=a.charAt(T);D="";while((a.charAt(T)==e)&&(T<a.length)){D+=a.charAt(T++)}if(U[D]!=null){J=J+U[D]}else{J=J+D}}return J}function _isInteger(C){var B="1234567890";for(var A=0;A<C.length;A++){if(B.indexOf(C.charAt(A))==-1){return false}}return true}function _getInt(F,D,E,C){for(var A=C;A>=E;A--){var B=F.substring(D,D+A);if(B.length<E){return null}if(_isInteger(B)){return B}}return null}function getDateFromFormat(U,N){U=U+"";N=N+"";var T=0;var J=0;var P="";var E="";var S="";var G,F;var B=new Date();var H=B.getYear();var R=B.getMonth()+1;var Q=1;var C=B.getHours();var O=B.getMinutes();var L=B.getSeconds();var I="";while(J<N.length){P=N.charAt(J);E="";while((N.charAt(J)==P)&&(J<N.length)){E+=N.charAt(J++)}if(E=="yyyy"||E=="yy"||E=="y"){if(E=="yyyy"){G=4;F=4}if(E=="yy"){G=2;F=2}if(E=="y"){G=2;F=4}H=_getInt(U,T,G,F);if(H==null){return 0}T+=H.length;if(H.length==2){if(H>70){H=1900+(H-0)}else{H=2000+(H-0)}}}else{if(E=="MMM"||E=="NNN"){R=0;for(var M=0;M<MONTH_NAMES.length;M++){var D=MONTH_NAMES[M];if(U.substring(T,T+D.length).toLowerCase()==D.toLowerCase()){if(E=="MMM"||(E=="NNN"&&M>11)){R=M+1;if(R>12){R-=12}T+=D.length;break}}}if((R<1)||(R>12)){return 0}}else{if(E=="EE"||E=="E"){for(var M=0;M<DAY_NAMES.length;M++){var K=DAY_NAMES[M];if(U.substring(T,T+K.length).toLowerCase()==K.toLowerCase()){T+=K.length;break}}}else{if(E=="MM"||E=="M"){R=_getInt(U,T,E.length,2);if(R==null||(R<1)||(R>12)){return 0}T+=R.length}else{if(E=="dd"||E=="d"){Q=_getInt(U,T,E.length,2);if(Q==null||(Q<1)||(Q>31)){return 0}T+=Q.length}else{if(E=="hh"||E=="h"){C=_getInt(U,T,E.length,2);if(C==null||(C<1)||(C>12)){return 0}T+=C.length}else{if(E=="HH"||E=="H"){C=_getInt(U,T,E.length,2);if(C==null||(C<0)||(C>23)){return 0}T+=C.length}else{if(E=="KK"||E=="K"){C=_getInt(U,T,E.length,2);if(C==null||(C<0)||(C>11)){return 0}T+=C.length}else{if(E=="kk"||E=="k"){C=_getInt(U,T,E.length,2);if(C==null||(C<1)||(C>24)){return 0}T+=C.length;C--}else{if(E=="mm"||E=="m"){O=_getInt(U,T,E.length,2);if(O==null||(O<0)||(O>59)){return 0}T+=O.length}else{if(E=="ss"||E=="s"){L=_getInt(U,T,E.length,2);if(L==null||(L<0)||(L>59)){return 0}T+=L.length}else{if(E=="a"){if(U.substring(T,T+2).toLowerCase()=="am"){I="AM"}else{if(U.substring(T,T+2).toLowerCase()=="pm"){I="PM"}else{return 0}}T+=2}else{if(U.substring(T,T+E.length)!=E){return 0}else{T+=E.length}}}}}}}}}}}}}}if(T!=U.length){return 0}if(R==2){if(((H%4==0)&&(H%100!=0))||(H%400==0)){if(Q>29){return 0}}else{if(Q>28){return 0}}}if((R==4)||(R==6)||(R==9)||(R==11)){if(Q>30){return 0}}if(C<12&&I=="PM"){C=C-0+12}else{if(C>11&&I=="AM"){C-=12}}var A=new Date(H,R-1,Q,C,O,L);return A.getTime()}function parseDate(G){var E=(arguments.length==2)?arguments[1]:false;generalFormats=new Array("y-M-d","MMM d, y","MMM d,y","y-MMM-d","d-MMM-y","MMM d");monthFirst=new Array("M/d/y","M-d-y","M.d.y","MMM-d","M/d","M-d");dateFirst=new Array("d/M/y","d-M-y","d.M.y","d-MMM","d/M","d-M");var B=new Array("generalFormats",E?"dateFirst":"monthFirst",E?"monthFirst":"dateFirst");var F=null;for(var D=0;D<B.length;D++){var A=window[B[D]];for(var C=0;C<A.length;C++){F=getDateFromFormat(G,A[C]);if(F!=0){return new Date(F)}}}return null}if(dwr==null){var dwr={}}if(dwr.engine==null){dwr.engine={}}if(DWREngine==null){var DWREngine=dwr.engine}if(Booking==null){var Booking={}}Booking._path="/AjaxClient/dwr";Booking.getLocation=function(B,A){dwr.engine._execute(Booking._path,"Booking","getLocation",B,A)};Booking.createSession=function(B,A){dwr.engine._execute(Booking._path,"Booking","createSession",B,A)};Booking.getRates=function(B,A){dwr.engine._execute(Booking._path,"Booking","getRates",B,A)};Booking.getRates=function(B,A){dwr.engine._execute(Booking._path,"Booking","getRates",B,A)};Booking.retrieveReservation=function(B,A){dwr.engine._execute(Booking._path,"Booking","retrieveReservation",B,A)};Booking.cancelReservation=function(B,A){dwr.engine._execute(Booking._path,"Booking","cancelReservation",B,A)};Booking.getCountries=function(B,A){dwr.engine._execute(Booking._path,"Booking","getCountries",B,A)};Booking.getCountryLocations=function(B,A){dwr.engine._execute(Booking._path,"Booking","getCountryLocations",B,A)};Booking.getSupplierLocation=function(B,A){dwr.engine._execute(Booking._path,"Booking","getSupplierLocation",B,A)};Booking.submitItineraryGetRates=function(B,A){dwr.engine._execute(Booking._path,"Booking","submitItineraryGetRates",B,A)};Booking.submitRateGetQuote=function(B,A){dwr.engine._execute(Booking._path,"Booking","submitRateGetQuote",B,A)};Booking.submitRenterDetailsCreateReservation=function(B,A){dwr.engine._execute(Booking._path,"Booking","submitRenterDetailsCreateReservation",B,A)};Booking.processConfirmations=function(A){dwr.engine._execute(Booking._path,"Booking","processConfirmations",A)};Booking.getRenterCountries=function(B,A){dwr.engine._execute(Booking._path,"Booking","getRenterCountries",B,A)};Booking.getCountriesFlattened=function(B,A){dwr.engine._execute(Booking._path,"Booking","getCountriesFlattened",B,A)};Booking.getCountryLocationsFlattened=function(B,A){dwr.engine._execute(Booking._path,"Booking","getCountryLocationsFlattened",B,A)};if(dwr==null){var dwr={}}if(dwr.engine==null){dwr.engine={}}if(DWREngine==null){var DWREngine=dwr.engine}dwr.engine.setErrorHandler=function(A){dwr.engine._errorHandler=A};dwr.engine.setWarningHandler=function(A){dwr.engine._warningHandler=A};dwr.engine.setTextHtmlHandler=function(A){dwr.engine._textHtmlHandler=A};dwr.engine.setTimeout=function(A){dwr.engine._timeout=A};dwr.engine.setPreHook=function(A){dwr.engine._preHook=A};dwr.engine.setPostHook=function(A){dwr.engine._postHook=A};dwr.engine.setHeaders=function(A){dwr.engine._headers=A};dwr.engine.setParameters=function(A){dwr.engine._parameters=A};dwr.engine.XMLHttpRequest=1;dwr.engine.IFrame=2;dwr.engine.ScriptTag=3;dwr.engine.setRpcType=function(A){if(A!=dwr.engine.XMLHttpRequest&&A!=dwr.engine.IFrame&&A!=dwr.engine.ScriptTag){dwr.engine._handleError(null,{name:"dwr.engine.invalidRpcType",message:"RpcType must be one of dwr.engine.XMLHttpRequest or dwr.engine.IFrame or dwr.engine.ScriptTag"});return }dwr.engine._rpcType=A};dwr.engine.setHttpMethod=function(A){if(A!="GET"&&A!="POST"){dwr.engine._handleError(null,{name:"dwr.engine.invalidHttpMethod",message:"Remoting method must be one of GET or POST"});return }dwr.engine._httpMethod=A};dwr.engine.setOrdered=function(A){dwr.engine._ordered=A};dwr.engine.setAsync=function(A){dwr.engine._async=A};dwr.engine.setActiveReverseAjax=function(A){if(A){if(dwr.engine._activeReverseAjax){return }dwr.engine._activeReverseAjax=true;dwr.engine._poll()}else{if(dwr.engine._activeReverseAjax&&dwr.engine._pollReq){dwr.engine._pollReq.abort()}dwr.engine._activeReverseAjax=false}};dwr.engine.defaultErrorHandler=function(B,A){dwr.engine._debug("Error: "+A.name+", "+A.message,true);if(B==null||B==""){alert("A server error has occured.")}else{if(B.indexOf("0x80040111")!=-1){dwr.engine._debug(B)}else{alert(B)}}};dwr.engine.defaultWarningHandler=function(B,A){dwr.engine._debug(B)};dwr.engine.beginBatch=function(){if(dwr.engine._batch){dwr.engine._handleError(null,{name:"dwr.engine.batchBegun",message:"Batch already begun"});return }dwr.engine._batch=dwr.engine._createBatch()};dwr.engine.endBatch=function(B){var A=dwr.engine._batch;if(A==null){dwr.engine._handleError(null,{name:"dwr.engine.batchNotBegun",message:"No batch in progress"});return }dwr.engine._batch=null;if(A.map.callCount==0){return }if(B){dwr.engine._mergeBatch(A,B)}if(dwr.engine._ordered&&dwr.engine._batchesLength!=0){dwr.engine._batchQueue[dwr.engine._batchQueue.length]=A}else{dwr.engine._sendData(A)}};dwr.engine.setPollMethod=function(A){dwr.engine.setPollType(A)};dwr.engine.setMethod=function(A){dwr.engine.setRpcType(A)};dwr.engine.setVerb=function(A){dwr.engine.setHttpMethod(A)};dwr.engine.setPollType=function(){dwr.engine._debug("Manually setting the Poll Type is not supported")};dwr.engine._origScriptSessionId="91C8A580E5AABF464DDF568D5E83BC6F";dwr.engine._sessionCookieName="JSESSIONID";dwr.engine._allowGetForSafariButMakeForgeryEasier="true";dwr.engine._scriptTagProtection="throw 'allowScriptTagRemoting is false.';";dwr.engine._defaultPath="/AjaxClient/dwr";dwr.engine._pollWithXhr="false";dwr.engine._scriptSessionId=null;dwr.engine._getScriptSessionId=function(){if(dwr.engine._scriptSessionId==null){dwr.engine._scriptSessionId=dwr.engine._origScriptSessionId+Math.floor(Math.random()*1000)}return dwr.engine._scriptSessionId};dwr.engine._errorHandler=dwr.engine.defaultErrorHandler;dwr.engine._warningHandler=dwr.engine.defaultWarningHandler;dwr.engine._preHook=null;dwr.engine._postHook=null;dwr.engine._batches={};dwr.engine._batchesLength=0;dwr.engine._batchQueue=[];dwr.engine._rpcType=dwr.engine.XMLHttpRequest;dwr.engine._httpMethod="POST";dwr.engine._ordered=false;dwr.engine._async=true;dwr.engine._batch=null;dwr.engine._timeout=0;dwr.engine._DOMDocument=["Msxml2.DOMDocument.6.0","Msxml2.DOMDocument.5.0","Msxml2.DOMDocument.4.0","Msxml2.DOMDocument.3.0","MSXML2.DOMDocument","MSXML.DOMDocument","Microsoft.XMLDOM"];dwr.engine._XMLHTTP=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.5.0","Msxml2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"];dwr.engine._activeReverseAjax=false;dwr.engine._outstandingIFrames=[];dwr.engine._pollReq=null;dwr.engine._pollCometInterval=200;dwr.engine._pollRetries=0;dwr.engine._maxPollRetries=0;dwr.engine._textHtmlHandler=null;dwr.engine._headers=null;dwr.engine._parameters=null;dwr.engine._postSeperator="\n";dwr.engine._defaultInterceptor=function(A){return A};dwr.engine._urlRewriteHandler=dwr.engine._defaultInterceptor;dwr.engine._contentRewriteHandler=dwr.engine._defaultInterceptor;dwr.engine._replyRewriteHandler=dwr.engine._defaultInterceptor;dwr.engine._nextBatchId=0;dwr.engine._propnames=["rpcType","httpMethod","async","timeout","errorHandler","warningHandler","textHtmlHandler"];dwr.engine._partialResponseNo=0;dwr.engine._partialResponseYes=1;dwr.engine._partialResponseFlush=2;dwr.engine._unloading=false;dwr.engine._execute=function(K,B,I,H){var E=false;if(dwr.engine._batch==null){dwr.engine.beginBatch();E=true}var D=dwr.engine._batch;var G=[];for(var C=0;C<arguments.length-3;C++){G[C]=arguments[C+3]}if(D.path==null){D.path=K}else{if(D.path!=K){dwr.engine._handleError(D,{name:"dwr.engine.multipleServlets",message:"Can't batch requests to multiple DWR Servlets."});return }}var A;var J=G[G.length-1];if(typeof J=="function"||J==null){A={callback:G.pop()}}else{A=G.pop()}dwr.engine._mergeBatch(D,A);D.handlers[D.map.callCount]={exceptionHandler:A.exceptionHandler,callback:A.callback};var F="c"+D.map.callCount+"-";D.map[F+"scriptName"]=B;D.map[F+"methodName"]=I;D.map[F+"id"]=D.map.callCount;for(C=0;C<G.length;C++){dwr.engine._serializeAll(D,[],G[C],F+"param"+C)}D.map.callCount++;if(E){dwr.engine.endBatch()}};dwr.engine._poll=function(){if(!dwr.engine._activeReverseAjax){return }var A=dwr.engine._createBatch();A.map.id=0;A.map.callCount=1;A.isPoll=true;if(dwr.engine._pollWithXhr=="true"){A.rpcType=dwr.engine.XMLHttpRequest;A.map.partialResponse=dwr.engine._partialResponseNo}else{if(navigator.userAgent.indexOf("Gecko/")!=-1){A.rpcType=dwr.engine.XMLHttpRequest;A.map.partialResponse=dwr.engine._partialResponseYes}else{A.rpcType=dwr.engine.XMLHttpRequest;A.map.partialResponse=dwr.engine._partialResponseNo}}A.httpMethod="POST";A.async=true;A.timeout=0;A.path=dwr.engine._defaultPath;A.preHooks=[];A.postHooks=[];A.errorHandler=dwr.engine._pollErrorHandler;A.warningHandler=dwr.engine._pollErrorHandler;A.handlers[0]={callback:function(B){dwr.engine._pollRetries=0;setTimeout(dwr.engine._poll,B)}};dwr.engine._sendData(A);if(A.rpcType==dwr.engine.XMLHttpRequest&&A.map.partialResponse==dwr.engine._partialResponseYes){dwr.engine._checkCometPoll()}};dwr.engine._pollErrorHandler=function(B,A){dwr.engine._pollRetries++;dwr.engine._debug("Reverse Ajax poll failed (pollRetries="+dwr.engine._pollRetries+"): "+A.name+" : "+A.message);if(dwr.engine._pollRetries<dwr.engine._maxPollRetries){setTimeout(dwr.engine._poll,10000)}else{dwr.engine._activeReverseAjax=false;dwr.engine._debug("Giving up.")}};dwr.engine._createBatch=function(){var A={map:{callCount:0,page:window.location.pathname+window.location.search,httpSessionId:dwr.engine._getJSessionId(),scriptSessionId:dwr.engine._getScriptSessionId()},charsProcessed:0,paramCount:0,parameters:{},headers:{},isPoll:false,handlers:{},preHooks:[],postHooks:[],rpcType:dwr.engine._rpcType,httpMethod:dwr.engine._httpMethod,async:dwr.engine._async,timeout:dwr.engine._timeout,errorHandler:dwr.engine._errorHandler,warningHandler:dwr.engine._warningHandler,textHtmlHandler:dwr.engine._textHtmlHandler};if(dwr.engine._preHook){A.preHooks.push(dwr.engine._preHook)}if(dwr.engine._postHook){A.postHooks.push(dwr.engine._postHook)}var C,B;if(dwr.engine._headers){for(C in dwr.engine._headers){B=dwr.engine._headers[C];if(typeof B!="function"){A.headers[C]=B}}}if(dwr.engine._parameters){for(C in dwr.engine._parameters){B=dwr.engine._parameters[C];if(typeof B!="function"){A.parameters[C]=B}}}return A};dwr.engine._mergeBatch=function(A,D){var E,C;for(var B=0;B<dwr.engine._propnames.length;B++){E=dwr.engine._propnames[B];if(D[E]!=null){A[E]=D[E]}}if(D.preHook!=null){A.preHooks.unshift(D.preHook)}if(D.postHook!=null){A.postHooks.push(D.postHook)}if(D.headers){for(E in D.headers){C=D.headers[E];if(typeof C!="function"){A.headers[E]=C}}}if(D.parameters){for(E in D.parameters){C=D.parameters[E];if(typeof C!="function"){A.map["p-"+E]=""+C}}}};dwr.engine._getJSessionId=function(){var C=document.cookie.split(";");for(var B=0;B<C.length;B++){var A=C[B];while(A.charAt(0)==" "){A=A.substring(1,A.length)}if(A.indexOf(dwr.engine._sessionCookieName+"=")==0){return A.substring(dwr.engine._sessionCookieName.length+1,A.length)}}return""};dwr.engine._checkCometPoll=function(){for(var B=0;B<dwr.engine._outstandingIFrames.length;B++){var E="";var C=dwr.engine._outstandingIFrames[B];try{E=dwr.engine._getTextFromCometIFrame(C)}catch(A){dwr.engine._handleWarning(C.batch,A)}if(E!=""){dwr.engine._processCometResponse(E,C.batch)}}if(dwr.engine._pollReq){var D=dwr.engine._pollReq;var E=D.responseText;if(E!=null){dwr.engine._processCometResponse(E,D.batch)}}if(dwr.engine._outstandingIFrames.length>0||dwr.engine._pollReq){setTimeout(dwr.engine._checkCometPoll,dwr.engine._pollCometInterval)}};dwr.engine._getTextFromCometIFrame=function(B){var A=B.contentWindow.document.body;if(A==null){return""}var C=A.innerHTML;if(C.indexOf("<PRE>")==0||C.indexOf("<pre>")==0){C=C.substring(5,C.length-7)}return C};dwr.engine._processCometResponse=function(D,E){if(E.charsProcessed==D.length){return }if(D.length==0){E.charsProcessed=0;return }var B=D.indexOf("//#DWR-START#",E.charsProcessed);if(B==-1){E.charsProcessed=D.length;return }var A=D.lastIndexOf("//#DWR-END#");if(A==-1){return }if(D.charCodeAt(A+11)==13&&D.charCodeAt(A+12)==10){E.charsProcessed=A+13}else{E.charsProcessed=A+11}var C=D.substring(B+13,A);dwr.engine._receivedBatch=E;dwr.engine._eval(C);dwr.engine._receivedBatch=null};dwr.engine._sendData=function(E){E.map.batchId=dwr.engine._nextBatchId;dwr.engine._nextBatchId++;dwr.engine._batches[E.map.batchId]=E;dwr.engine._batchesLength++;E.completed=false;for(var D=0;D<E.preHooks.length;D++){E.preHooks[D]()}E.preHooks=null;if(E.timeout&&E.timeout!=0){E.timeoutId=setTimeout(function(){dwr.engine._abortRequest(E)},E.timeout)}if(E.rpcType==dwr.engine.XMLHttpRequest){if(window.XMLHttpRequest){E.req=new XMLHttpRequest()}else{if(window.ActiveXObject&&!(navigator.userAgent.indexOf("Mac")>=0&&navigator.userAgent.indexOf("MSIE")>=0)){E.req=dwr.engine._newActiveXObject(dwr.engine._XMLHTTP)}}}var A,C;if(E.req){if(E.async){E.req.onreadystatechange=function(){if(typeof dwr!="undefined"){dwr.engine._stateChange(E)}}}if(E.isPoll){dwr.engine._pollReq=E.req;if(!(document.all&&!window.opera)){E.req.batch=E}}var B=navigator.userAgent.indexOf("Safari/");if(B>=0){var G=navigator.userAgent.substring(B+7);if(parseInt(G,10)<400){if(dwr.engine._allowGetForSafariButMakeForgeryEasier=="true"){E.httpMethod="GET"}else{dwr.engine._handleWarning(E,{name:"dwr.engine.oldSafari",message:"Safari GET support disabled. See getahead.org/dwr/server/servlet and allowGetForSafariButMakeForgeryEasier."})}}}E.mode=E.isPoll?dwr.engine._ModePlainPoll:dwr.engine._ModePlainCall;C=dwr.engine._constructRequest(E);try{E.req.open(E.httpMethod,C.url,E.async);try{for(A in E.headers){var I=E.headers[A];if(typeof I=="string"){E.req.setRequestHeader(A,I)}}if(!E.headers["Content-Type"]){E.req.setRequestHeader("Content-Type","text/plain")}}catch(H){dwr.engine._handleWarning(E,H)}E.req.send(C.body);if(!E.async){dwr.engine._stateChange(E)}}catch(H){dwr.engine._handleError(E,H)}}else{if(E.rpcType!=dwr.engine.ScriptTag){var F=E.isPoll?"dwr-if-poll-"+E.map.batchId:"dwr-if-"+E.map.batchId;E.div=document.createElement("div");document.body.appendChild(E.div);E.div.innerHTML="<iframe src='javascript:void(0)' frameborder='0' style='width:0px;height:0px;border:0;' id='"+F+"' name='"+F+"' onload='dwr.engine._iframeLoadingComplete ("+E.map.batchId+");'></iframe>";E.document=document;E.iframe=E.document.getElementById(F);E.iframe.batch=E;E.mode=E.isPoll?dwr.engine._ModeHtmlPoll:dwr.engine._ModeHtmlCall;if(E.isPoll){dwr.engine._outstandingIFrames.push(E.iframe)}C=dwr.engine._constructRequest(E);if(E.httpMethod=="GET"){E.iframe.setAttribute("src",C.url)}else{E.form=E.document.createElement("form");E.form.setAttribute("id","dwr-form");E.form.setAttribute("action",C.url);E.form.setAttribute("style","display:none;");E.form.setAttribute("target",F);E.form.target=F;E.form.setAttribute("method",E.httpMethod);for(A in E.map){var I=E.map[A];if(typeof I!="function"){var J=E.document.createElement("input");J.setAttribute("type","hidden");J.setAttribute("name",A);J.setAttribute("value",I);E.form.appendChild(J)}}E.document.body.appendChild(E.form);E.form.submit()}}else{E.httpMethod="GET";E.mode=E.isPoll?dwr.engine._ModePlainPoll:dwr.engine._ModePlainCall;C=dwr.engine._constructRequest(E);E.script=document.createElement("script");E.script.id="dwr-st-"+E.map["c0-id"];E.script.src=C.url;document.body.appendChild(E.script)}}};dwr.engine._ModePlainCall="/call/plaincall/";dwr.engine._ModeHtmlCall="/call/htmlcall/";dwr.engine._ModePlainPoll="/call/plainpoll/";dwr.engine._ModeHtmlPoll="/call/htmlpoll/";dwr.engine._constructRequest=function(B){var C={url:B.path+B.mode,body:null};if(B.isPoll==true){C.url+="ReverseAjax.dwr"}else{if(B.map.callCount==1){C.url+=B.map["c0-scriptName"]+"."+B.map["c0-methodName"]+".dwr"}else{C.url+="Multiple."+B.map.callCount+".dwr"}}var E=location.href.match(/jsessionid=([^?]+)/);if(E!=null){C.url+=";jsessionid="+E[1]}var D;if(B.httpMethod=="GET"){B.map.callCount=""+B.map.callCount;C.url+="?";for(D in B.map){if(typeof B.map[D]!="function"){C.url+=encodeURIComponent(D)+"="+encodeURIComponent(B.map[D])+"&"}}C.url=C.url.substring(0,C.url.length-1)}else{C.body="";if(document.all&&!window.opera){var A=[];for(D in B.map){if(typeof B.map[D]!="function"){A.push(D+"="+B.map[D]+dwr.engine._postSeperator)}}C.body=A.join("")}else{for(D in B.map){if(typeof B.map[D]!="function"){C.body+=D+"="+B.map[D]+dwr.engine._postSeperator}}}C.body=dwr.engine._contentRewriteHandler(C.body)}C.url=dwr.engine._urlRewriteHandler(C.url);return C};dwr.engine._stateChange=function(C){var B;if(C.completed){dwr.engine._debug("Error: _stateChange() with batch.completed");return }var F=C.req;try{if(F.readyState!=4){return }}catch(D){dwr.engine._handleWarning(C,D);dwr.engine._clearUp(C);return }if(dwr.engine._unloading){dwr.engine._debug("Ignoring reply from server as page is unloading.");return }try{var E=F.responseText;E=dwr.engine._replyRewriteHandler(E);var A=F.status;if(E==null||E==""){dwr.engine._handleWarning(C,{name:"dwr.engine.missingData",message:"No data received from server"})}else{if(A!=200){dwr.engine._handleError(C,{name:"dwr.engine.http."+A,message:F.statusText})}else{var G=F.getResponseHeader("Content-Type");if(!G.match(/^text\/plain/)&&!G.match(/^text\/javascript/)){if(G.match(/^text\/html/)&&typeof C.textHtmlHandler=="function"){C.textHtmlHandler({status:A,responseText:E,contentType:G})}else{dwr.engine._handleWarning(C,{name:"dwr.engine.invalidMimeType",message:"Invalid content type: '"+G+"'"})}}else{if(C.isPoll&&C.map.partialResponse==dwr.engine._partialResponseYes){dwr.engine._processCometResponse(E,C)}else{if(E.search("//#DWR")==-1){dwr.engine._handleWarning(C,{name:"dwr.engine.invalidReply",message:"Invalid reply from server"})}else{B=E}}}}}}catch(D){dwr.engine._handleWarning(C,D)}dwr.engine._callPostHooks(C);dwr.engine._receivedBatch=C;if(B!=null){B=B.replace(dwr.engine._scriptTagProtection,"")}dwr.engine._eval(B);dwr.engine._receivedBatch=null;dwr.engine._validateBatch(C);if(!C.completed){dwr.engine._clearUp(C)}};dwr.engine._validateBatch=function(A){if(!A.completed){for(var B=0;B<A.map.callCount;B++){if(A.handlers[B]!=null){dwr.engine._handleWarning(A,{name:"dwr.engine.incompleteReply",message:"Incomplete reply from server"});break}}}};dwr.engine._iframeLoadingComplete=function(A){var B=dwr.engine._batches[A];if(B){dwr.engine._validateBatch(B)}};dwr.engine._remoteHandleCallback=function(A,F,E){var C=dwr.engine._batches[A];if(C==null){dwr.engine._debug("Warning: batch == null in remoteHandleCallback for batchId="+A,true);return }try{var B=C.handlers[F];C.handlers[F]=null;if(!B){dwr.engine._debug("Warning: Missing handlers. callId="+F,true)}else{if(typeof B.callback=="function"){B.callback(E)}}}catch(D){dwr.engine._handleError(C,D)}};dwr.engine._remoteHandleException=function(A,E,D){var C=dwr.engine._batches[A];if(C==null){dwr.engine._debug("Warning: null batch in remoteHandleException",true);return }var B=C.handlers[E];C.handlers[E]=null;if(B==null){dwr.engine._debug("Warning: null handlers in remoteHandleException",true);return }if(D.message==undefined){D.message=""}if(typeof B.exceptionHandler=="function"){B.exceptionHandler(D.message,D)}else{if(typeof C.errorHandler=="function"){C.errorHandler(D.message,D)}}};dwr.engine._remoteHandleBatchException=function(C,A){var B=(dwr.engine._receivedBatch==null&&A!=null);if(B){dwr.engine._receivedBatch=dwr.engine._batches[A]}if(C.message==undefined){C.message=""}dwr.engine._handleError(dwr.engine._receivedBatch,C);if(B){dwr.engine._receivedBatch=null;dwr.engine._clearUp(dwr.engine._batches[A])}};dwr.engine._remotePollCometDisabled=function(C,A){dwr.engine.setActiveReverseAjax(false);var B=(dwr.engine._receivedBatch==null&&A!=null);if(B){dwr.engine._receivedBatch=dwr.engine._batches[A]}if(C.message==undefined){C.message=""}dwr.engine._handleError(dwr.engine._receivedBatch,C);if(B){dwr.engine._receivedBatch=null;dwr.engine._clearUp(dwr.engine._batches[A])}};dwr.engine._remoteBeginIFrameResponse=function(B,A){if(B!=null){dwr.engine._receivedBatch=B.batch}dwr.engine._callPostHooks(dwr.engine._receivedBatch)};dwr.engine._remoteEndIFrameResponse=function(A){dwr.engine._clearUp(dwr.engine._receivedBatch);dwr.engine._receivedBatch=null};dwr.engine._eval=function(script){if(script==null){return null}if(script==""){dwr.engine._debug("Warning: blank script",true);return null}return eval(script)};dwr.engine._abortRequest=function(A){if(A&&!A.completed){dwr.engine._clearUp(A);if(A.req){A.req.abort()}dwr.engine._handleError(A,{name:"dwr.engine.timeout",message:"Timeout"})}};dwr.engine._callPostHooks=function(A){if(A.postHooks){for(var B=0;B<A.postHooks.length;B++){A.postHooks[B]()}A.postHooks=null}};dwr.engine._clearUp=function(B){if(!B){dwr.engine._debug("Warning: null batch in dwr.engine._clearUp()",true);return }if(B.completed){dwr.engine._debug("Warning: Double complete",true);return }if(B.div){B.div.parentNode.removeChild(B.div)}if(B.iframe){for(var C=0;C<dwr.engine._outstandingIFrames.length;C++){if(dwr.engine._outstandingIFrames[C]==B.iframe){dwr.engine._outstandingIFrames.splice(C,1)}}B.iframe.parentNode.removeChild(B.iframe)}if(B.form){B.form.parentNode.removeChild(B.form)}if(B.req){if(B.req==dwr.engine._pollReq){dwr.engine._pollReq=null}delete B.req}if(B.timeoutId){clearTimeout(B.timeoutId);delete B.timeoutId}if(B.map&&(B.map.batchId||B.map.batchId==0)){delete dwr.engine._batches[B.map.batchId];dwr.engine._batchesLength--}B.completed=true;if(dwr.engine._batchQueue.length!=0){var A=dwr.engine._batchQueue.shift();dwr.engine._sendData(A)}};dwr.engine._unloader=function(){dwr.engine._unloading=true;dwr.engine._batchQueue.length=0;for(var A in dwr.engine._batches){var B=dwr.engine._batches[A];if(B&&B.map){if(B.req){B.req.abort()}dwr.engine._clearUp(B)}}};if(window.addEventListener){window.addEventListener("unload",dwr.engine._unloader,false)}else{if(window.attachEvent){window.attachEvent("onunload",dwr.engine._unloader)}}dwr.engine._handleError=function(A,B){if(typeof B=="string"){B={name:"unknown",message:B}}if(B.message==null){B.message=""}if(B.name==null){B.name="unknown"}if(A&&typeof A.errorHandler=="function"){A.errorHandler(B.message,B)}else{if(dwr.engine._errorHandler){dwr.engine._errorHandler(B.message,B)}}if(A){dwr.engine._clearUp(A)}};dwr.engine._handleWarning=function(A,B){if(typeof B=="string"){B={name:"unknown",message:B}}if(B.message==null){B.message=""}if(B.name==null){B.name="unknown"}if(A&&typeof A.warningHandler=="function"){A.warningHandler(B.message,B)}else{if(dwr.engine._warningHandler){dwr.engine._warningHandler(B.message,B)}}if(A){dwr.engine._clearUp(A)}};dwr.engine._serializeAll=function(B,D,C,A){if(C==null){B.map[A]="null:null";return }switch(typeof C){case"boolean":B.map[A]="boolean:"+C;break;case"number":B.map[A]="number:"+C;break;case"string":B.map[A]="string:"+encodeURIComponent(C);break;case"object":if(C instanceof String){B.map[A]="String:"+encodeURIComponent(C)}else{if(C instanceof Boolean){B.map[A]="Boolean:"+C}else{if(C instanceof Number){B.map[A]="Number:"+C}else{if(C instanceof Date){B.map[A]="Date:"+C.getTime()}else{if(C&&C.join){B.map[A]=dwr.engine._serializeArray(B,D,C,A)}else{B.map[A]=dwr.engine._serializeObject(B,D,C,A)}}}}}break;case"function":break;default:dwr.engine._handleWarning(null,{name:"dwr.engine.unexpectedType",message:"Unexpected type: "+typeof C+", attempting default converter."});B.map[A]="default:"+C;break}};dwr.engine._lookup=function(E,C,A){var D;for(var B=0;B<E.length;B++){if(E[B].data==C){D=E[B];break}}if(D){return"reference:"+D.name}E.push({data:C,name:A});return null};dwr.engine._serializeObject=function(C,H,G,B){var F=dwr.engine._lookup(H,G,B);if(F){return F}if(G.nodeName&&G.nodeType){return dwr.engine._serializeXml(C,H,G,B)}var E="Object_"+dwr.engine._getObjectClassName(G)+":{";var D;for(D in G){if(typeof G[D]!="function"){C.paramCount++;var A="c"+dwr.engine._batch.map.callCount+"-e"+C.paramCount;dwr.engine._serializeAll(C,H,G[D],A);E+=encodeURIComponent(D)+":reference:"+A+", "}}if(E.substring(E.length-2)==", "){E=E.substring(0,E.length-2)}E+="}";return E};dwr.engine._errorClasses={Error:Error,EvalError:EvalError,RangeError:RangeError,ReferenceError:ReferenceError,SyntaxError:SyntaxError,TypeError:TypeError,URIError:URIError};dwr.engine._getObjectClassName=function(C){if(C&&C.constructor&&C.constructor.toString){var D=C.constructor.toString();var A=D.match(/function\s+(\w+)/);if(A&&A.length==2){return A[1]}}if(C&&C.constructor){for(var B in dwr.engine._errorClasses){if(C.constructor==dwr.engine._errorClasses[B]){return B}}}if(C){var D=Object.prototype.toString.call(C);var A=D.match(/\[object\s+(\w+)/);if(A&&A.length==2){return A[1]}}return"Object"};dwr.engine._serializeXml=function(C,F,E,B){var D=dwr.engine._lookup(F,E,B);if(D){return D}var A;if(window.XMLSerializer){A=new XMLSerializer().serializeToString(E)}else{if(E.toXml){A=E.toXml}else{A=E.innerHTML}}return"XML:"+encodeURIComponent(A)};dwr.engine._serializeArray=function(H,C,F,A){var D=dwr.engine._lookup(C,F,A);if(D){return D}if(document.all&&!window.opera){var B=["Array:["];for(var G=0;G<F.length;G++){if(G!=0){B.push(",")}H.paramCount++;var I="c"+dwr.engine._batch.map.callCount+"-e"+H.paramCount;dwr.engine._serializeAll(H,C,F[G],I);B.push("reference:");B.push(I)}B.push("]");E=B.join("")}else{var E="Array:[";for(var G=0;G<F.length;G++){if(G!=0){E+=","}H.paramCount++;var I="c"+dwr.engine._batch.map.callCount+"-e"+H.paramCount;dwr.engine._serializeAll(H,C,F[G],I);E+="reference:";E+=I}E+="]"}return E};dwr.engine._unserializeDocument=function(A){var C;if(window.DOMParser){var E=new DOMParser();C=E.parseFromString(A,"text/xml");if(!C.documentElement||C.documentElement.tagName=="parsererror"){var B=C.documentElement.firstChild.data;B+="\n"+C.documentElement.firstChild.nextSibling.firstChild.data;throw B}return C}else{if(window.ActiveXObject){C=dwr.engine._newActiveXObject(dwr.engine._DOMDocument);C.loadXML(A);return C}else{var D=document.createElement("div");D.innerHTML=A;return D}}};dwr.engine._newActiveXObject=function(A){var D;for(var C=0;C<A.length;C++){try{D=new ActiveXObject(A[C]);break}catch(B){}}return D};dwr.engine._debug=function(F,D){var A=false;try{if(window.console){if(D&&window.console.trace){window.console.trace()}window.console.log(F);A=true}else{if(window.opera&&window.opera.postError){window.opera.postError(F);A=true}}}catch(C){}if(!A){var B=document.getElementById("dwr-debug");if(B){var E=F+"<br/>"+B.innerHTML;if(E.length>2048){E=E.substring(0,2048)}B.innerHTML=E}}};var enableCache=true;var jsCache=new Array();var dynamicContent_ajaxObjects=new Array();function ajax_showContent(A,D,B){var C=document.getElementById(A);C.innerHTML=dynamicContent_ajaxObjects[D].response;if(enableCache){jsCache[B]=dynamicContent_ajaxObjects[D].response}dynamicContent_ajaxObjects[D]=false;ajax_parseJs(C)}function ajax_loadContent(A,B){if(enableCache&&jsCache[B]){document.getElementById(A).innerHTML=jsCache[B];return }var C=dynamicContent_ajaxObjects.length;document.getElementById(A).innerHTML="Loading content - please wait";dynamicContent_ajaxObjects[C]=new sack();dynamicContent_ajaxObjects[C].requestFile=B;dynamicContent_ajaxObjects[C].onCompletion=function(){ajax_showContent(A,C,B)};dynamicContent_ajaxObjects[C].runAJAX()}function ajax_parseJs(F){var E=F.getElementsByTagName("SCRIPT");var B="";var D="";for(var G=0;G<E.length;G++){if(E[G].src){var C=document.getElementsByTagName("head")[0];var A=document.createElement("script");A.setAttribute("type","text/javascript");A.setAttribute("src",E[G].src)}else{if(navigator.userAgent.indexOf("Opera")>=0){D=D+E[G].text+"\n"}else{D=D+E[G].innerHTML}}}if(D){ajax_installScript(D)}}function ajax_installScript(A){if(!A){return }if(window.execScript){window.execScript(A)}else{if(window.jQuery&&jQuery.browser.safari){window.setTimeout(A,0)}else{window.setTimeout(A,0)}}}function sack(file){this.xmlhttp=null;this.resetData=function(){this.method="POST";this.queryStringSeparator="?";this.argumentSeparator="&";this.URLString="";this.encodeURIString=true;this.execute=false;this.element=null;this.elementObj=null;this.requestFile=file;this.vars=new Object();this.responseStatus=new Array(2)};this.resetFunctions=function(){this.onLoading=function(){};this.onLoaded=function(){};this.onInteractive=function(){};this.onCompletion=function(){};this.onError=function(){};this.onFail=function(){}};this.reset=function(){this.resetFunctions();this.resetData()};this.createAJAX=function(){try{this.xmlhttp=new ActiveXObject("Msxml2.XMLHTTP")}catch(e1){try{this.xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")}catch(e2){this.xmlhttp=null}}if(!this.xmlhttp){if(typeof XMLHttpRequest!="undefined"){this.xmlhttp=new XMLHttpRequest()}else{this.failed=true}}};this.setVar=function(name,value){this.vars[name]=Array(value,false)};this.encVar=function(name,value,returnvars){if(true==returnvars){return Array(encodeURIComponent(name),encodeURIComponent(value))}else{this.vars[encodeURIComponent(name)]=Array(encodeURIComponent(value),true)}};this.processURLString=function(string,encode){encoded=encodeURIComponent(this.argumentSeparator);regexp=new RegExp(this.argumentSeparator+"|"+encoded);varArray=string.split(regexp);for(i=0;i<varArray.length;i++){urlVars=varArray[i].split("=");if(true==encode){this.encVar(urlVars[0],urlVars[1])}else{this.setVar(urlVars[0],urlVars[1])}}};this.createURLString=function(urlstring){if(this.encodeURIString&&this.URLString.length){this.processURLString(this.URLString,true)}if(urlstring){if(this.URLString.length){this.URLString+=this.argumentSeparator+urlstring}else{this.URLString=urlstring}}this.setVar("rndval",new Date().getTime());urlstringtemp=new Array();for(key in this.vars){if(false==this.vars[key][1]&&true==this.encodeURIString){encoded=this.encVar(key,this.vars[key][0],true);delete this.vars[key];this.vars[encoded[0]]=Array(encoded[1],true);key=encoded[0]}urlstringtemp[urlstringtemp.length]=key+"="+this.vars[key][0]}if(urlstring){this.URLString+=this.argumentSeparator+urlstringtemp.join(this.argumentSeparator)}else{this.URLString+=urlstringtemp.join(this.argumentSeparator)}};this.runResponse=function(){eval(this.response)};this.runAJAX=function(urlstring){if(this.failed){this.onFail()}else{this.createURLString(urlstring);if(this.element){this.elementObj=document.getElementById(this.element)}if(this.xmlhttp){var self=this;if(this.method=="GET"){totalurlstring=this.requestFile+this.queryStringSeparator+this.URLString;this.xmlhttp.open(this.method,totalurlstring,true)}else{this.xmlhttp.open(this.method,this.requestFile,true);try{this.xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}catch(e){}}this.xmlhttp.onreadystatechange=function(){switch(self.xmlhttp.readyState){case 1:self.onLoading();break;case 2:self.onLoaded();break;case 3:self.onInteractive();break;case 4:self.response=self.xmlhttp.responseText;self.responseXML=self.xmlhttp.responseXML;self.responseStatus[0]=self.xmlhttp.status;self.responseStatus[1]=self.xmlhttp.statusText;if(self.execute){self.runResponse()}if(self.elementObj){elemNodeName=self.elementObj.nodeName;elemNodeName.toLowerCase();if(elemNodeName=="input"||elemNodeName=="select"||elemNodeName=="option"||elemNodeName=="textarea"){self.elementObj.value=self.response}else{self.elementObj.innerHTML=self.response}}if(self.responseStatus[0]=="200"){self.onCompletion()}else{self.onError()}self.URLString="";break}};this.xmlhttp.send(this.URLString)}}};this.reset();this.createAJAX()}DHTML_modalMessage=function(){var A;var G;var D;var L;var F;var C;var B;var M;var J;var K;var I;var E;var N;var H;this.url="";this.htmlOfModalMessage="";this.layoutCss="modal-message.css";this.height=200;this.width=400;this.cssClassOfMessageBox=false;this.shadowDivVisible=true;this.shadowOffset=5;this.MSIE=false;this.bodyElement;if(navigator.userAgent.indexOf("MSIE")>=0){this.MSIE=true}};DHTML_modalMessage.prototype={setSource:function(A){this.url=A},setHtmlContent:function(A){this.htmlOfModalMessage=A},setSize:function(B,A){if(B){this.width=B}if(A){this.height=A}},setCssClassMessageBox:function(A){this.cssClassOfMessageBox=A;if(this.divs_content){if(this.cssClassOfMessageBox){this.divs_content.className=this.cssClassOfMessageBox}else{this.divs_content.className="modalDialog_contentDiv"}}},setShadowOffset:function(A){this.shadowOffset=A},display:function(){if(!this.divs_transparentDiv){this.__createDivs()}this.divs_transparentDiv.style.display="block";this.divs_content.style.display="block";this.divs_shadow.style.display="block";if(this.MSIE){this.iframe.style.display="block"}this.__resizeDivs();window.refToThisModalBoxObj=this;setTimeout("window.refToThisModalBoxObj.__resizeDivs()",150);this.__insertContent()},setShadowDivVisible:function(A){this.shadowDivVisible=A},close:function(){this.divs_transparentDiv.style.display="none";this.divs_content.style.display="none";this.divs_shadow.style.display="none";if(this.MSIE){this.iframe.style.display="none"}},addEvent:function(B,A,C,D){if(!D){D=""}if(B.attachEvent){B["e"+A+C+D]=C;B[A+C+D]=function(){B["e"+A+C+D](window.event)};B.attachEvent("on"+A,B[A+C+D])}else{B.addEventListener(A,C,false)}},__createDivs:function(){this.divs_transparentDiv=document.createElement("DIV");this.divs_transparentDiv.className="modalDialog_transparentDivs";this.divs_transparentDiv.style.left="0px";this.divs_transparentDiv.style.top="0px";if(this.bodyElement){this.bodyElement.appendChild(this.divs_transparentDiv)}else{document.body.appendChild(this.divs_transparentDiv)}this.divs_content=document.createElement("DIV");this.divs_content.className="modalDialog_contentDiv";this.divs_content.id="DHTMLSuite_modalBox_contentDiv";this.divs_content.style.zIndex=100000;if(this.MSIE){this.iframe=document.createElement('<IFRAME src="about:blank" frameborder=0>');this.iframe.style.zIndex=90000;this.iframe.style.position="absolute";if(this.bodyElement){document.body.appendChild(this.iframe)}else{document.body.appendChild(this.iframe)}}document.body.appendChild(this.divs_content);this.divs_shadow=document.createElement("DIV");this.divs_shadow.className="modalDialog_contentDiv_shadow";this.divs_shadow.style.zIndex=95000;document.body.appendChild(this.divs_shadow);window.refToModMessage=this;this.addEvent(window,"scroll",function(A){window.refToModMessage.__repositionTransparentDiv()});this.addEvent(window,"resize",function(A){window.refToModMessage.__repositionTransparentDiv()})},__getBrowserSize:function(){var A=document.documentElement.clientWidth;var B=document.documentElement.clientHeight;var A,B;if(self.innerHeight){A=self.innerWidth;B=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){A=document.documentElement.clientWidth;B=document.documentElement.clientHeight}else{if(document.body){A=document.body.clientWidth;B=document.body.clientHeight}}}return[A,B]},__resizeDivs:function(){var E=Math.max(document.body.scrollTop,document.documentElement.scrollTop);if(this.cssClassOfMessageBox){this.divs_content.className=this.cssClassOfMessageBox}else{this.divs_content.className="modalDialog_contentDiv"}if(!this.divs_transparentDiv){return }var D=Math.max(document.body.scrollTop,document.documentElement.scrollTop);var C=Math.max(document.body.scrollLeft,document.documentElement.scrollLeft);window.scrollTo(C,D);setTimeout("window.scrollTo("+C+","+D+");",10);this.__repositionTransparentDiv();var F=this.__getBrowserSize();var B=F[0];var H=F[1];this.divs_content.style.width=this.width+"px";this.divs_content.style.height=this.height+"px";var A=this.divs_content.offsetWidth;var G=this.divs_content.offsetHeight;this.divs_content.style.left=Math.ceil((B-A)/2)+"px";this.divs_content.style.top=(Math.ceil((H-G)/2)+E)+"px";if(this.MSIE){this.iframe.style.left=this.divs_content.style.left;this.iframe.style.top=this.divs_content.style.top;this.iframe.style.width=this.divs_content.style.width;this.iframe.style.height=this.divs_content.style.height}this.divs_shadow.style.left=(this.divs_content.style.left.replace("px","")/1+this.shadowOffset)+"px";this.divs_shadow.style.top=(this.divs_content.style.top.replace("px","")/1+this.shadowOffset)+"px";this.divs_shadow.style.height=G+"px";this.divs_shadow.style.width=A+"px";if(!this.shadowDivVisible){this.divs_shadow.style.display="none"}},__repositionTransparentDiv:function(){this.divs_transparentDiv.style.top=Math.max(document.body.scrollTop,document.documentElement.scrollTop)+"px";this.divs_transparentDiv.style.left=Math.max(document.body.scrollLeft,document.documentElement.scrollLeft)+"px";var B=this.__getBrowserSize();var A=B[0];var C=B[1];this.divs_transparentDiv.style.width=A+"px";this.divs_transparentDiv.style.height=C+"px"},__insertContent:function(){if(this.url){ajax_loadContent("DHTMLSuite_modalBox_contentDiv",this.url)}else{this.divs_content.innerHTML=this.htmlOfModalMessage}}};function initBooking(){DWREngine.setMethod(DWREngine.ScriptTag);Booking._path=accelerate.bookingUrl;dwr.engine._defaultPath=accelerate.bookingUrl;session.product=accelerate.product;hashListener.init();hashListener.onHashChanged=function(){setSessionFromHash()};if(urlIsRedirect()){findUrlVars();if(session.sessionId){loadRatesFromSession()}else{if(session.hasItineraryVars){createNewSessionAndLoadRates()}else{startNewProcess()}}}else{startNewProcess()}}function loadRatesFromSession(){analytics.log("url.session.rates");analytics.log("submit.itinerary");waitMessage.setMessage(WAIT_TEXT.Searching);var A={sessionId:session.sessionId};Booking.getRates(A,function(B){session.pickupLocation=B.pickupLocation;session.returnLocation=B.returnLocation;session.pickupLocationId=B.pickupLocation.locationId;session.returnLocationId=B.returnLocation.locationId;session.pickupDate=B.pickupDate;session.returnDate=B.returnDate;processGetRatesResponse(B)})}function createNewSessionAndLoadRates(){createContentDiv();waitMessage.setMessage(WAIT_TEXT.Loading);session.step="1";hashListener.setStep("1");var A={affiliateCode:accelerate.affCode,vehicleType:session.product};Booking.createSession(A,function(B){analytics.log("create.session");session.sessionId=B.sessionId;session.renterCountries=B.countries;if(session.hasItineraryVars){processGetRatesRequest()}else{errorMessage.setMessageByStatus("UnknownError");errorMessage.show()}})}function startNewProcess(){createContentDiv();analytics.log("product.type."+session.product);waitMessage.setMessage(WAIT_TEXT.Loading);var A={affiliateCode:accelerate.affCode,vehicleType:session.product};Booking.createSession(A,function(B){analytics.log("create.session");session.sessionId=B.sessionId;session.renterCountries=B.countries;loadItinerary(null,null,null,null,null,null,B.countries);scrollTo(0,0);waitMessage.hide()})}function DateWidget(C){this.id=C;var E=document.createElement("INPUT");var J=document.createElement("LABEL");var B=document.createElement("DIV");B.id="date-input";var I=document.createElement("DIV");var F=document.createElement("A");var K=document.createElement("DIV");I.id=C+"-cal";I.name=C+"-cal";var D=new Date();D.setDate(D.getDate()-1);var A=new CalendarPopup(C+"-cal");A.addDisabledDates(null,formatDate(D,"yyyy-MM-dd"));E.id=C+"-date-input";E.size=16;E.onchange=function(){alert("date changed")};F.name=C+"anchor";F.id=C+"anchor";F.appendChild(getCalDiv());F.href="#";F.onclick=function(){A.select(document.getElementById(C+"-date-input"),C+"anchor","NNN d, y");return false};E.onclick=function(){A.select(document.getElementById(C+"-date-input"),C+"anchor","NNN d, y");return false};var G=document.createElement("SELECT");G.id=C+"-time-select";var L=0;var H=function(){for(x=1;x<=24;x++){var M="";if(x<10){M="0"+x}else{M=x}L=L+1;var N=new Option(M+":00");N.value=M+":00";G.options[L]=N;L=L+1;var N=new Option(M+":30");N.value=M+":30";G.options[L]=N}};this.build=function(){H();this.setTime("12:00")};this.setLabel=function(M){J.appendChild(document.createTextNode(M))};this.getDate=function(){d=new Date(getDateFromFormat(E.value,"NNN d, y"));t=this.getTime().split(":");d.setHours(t[0],t[1],0);return d};this.getDateValue=function(){return getDateFromFormat(E.value,"NNN d, y")};this.setDate=function(M){E.value=formatDate(M,"NNN d, y");if(formatDate(M,"mm")=="30"||formatDate(M,"mm")=="00"){this.setTime(formatDate(M,"HH:mm"))}else{this.setTime(formatDate(M,"HH")+":00")}};this.getTime=function(){return G.value};this.setTime=function(M){for(i=0;i<G.options.length;i++){if(G.options[i].value==M){G.options[i].selected=true;G.selectedIndex=i;break}}};this.getWidget=function(){B.appendChild(J);B.appendChild(E);B.appendChild(F);B.appendChild(G);K.appendChild(B);document.getElementById("accelerate-content").appendChild(I);return K}}function LocationBlock(){var A=document.createElement("DIV");var C=document.createElement("DIV");var B=document.createElement("DIV");this.dateTime;this.locationObj;this.allowModify=true;A.id="heading";this.heading="";this.id="";this.build=function(){B.id=this.id;C.id="location-summary-section";var D=document.createElement("BUTTON");var E=document.createElement("BUTTON");D.id="modify-button";D.appendChild(document.createTextNode(BUTTON_TEXT.Modify));D.onclick=function(){window.location="#1"};var E=document.createElement("BUTTON");E.id="modify-button-image";E.onclick=function(){window.location="#1"};A.appendChild(document.createTextNode(this.heading));C.appendChild(A);C.appendChild(getLocationDiv(this.locationObj));C.appendChild(getDateDiv(this.dateTime));if(this.allowModify){C.appendChild(D);C.appendChild(E)}B.appendChild(C)};this.getWidget=function(){return B}}function ProgressWidget(){var C=document.createElement("DIV");C.id="progress-bar";var B=document.createElement("DIV");B.id="stage-one";var H=document.createElement("DIV");B.appendChild(H);var F=document.createElement("DIV");F.id="stage-two";var G=document.createElement("DIV");F.appendChild(G);var E=document.createElement("DIV");E.id="stage-three";var I=document.createElement("DIV");E.appendChild(I);var D=document.createElement("DIV");D.id="stage-four";var A=document.createElement("DIV");D.appendChild(A);H.appendChild(document.createTextNode("Search"));G.appendChild(document.createTextNode("Choose"));I.appendChild(document.createTextNode("Book"));A.appendChild(document.createTextNode("Confirmed"));C.appendChild(B);C.appendChild(F);C.appendChild(E);C.appendChild(D);this.setStage=function(J){switch(J){case 1:H.id="active";G.id="pending";I.id="pending";A.id="pending";break;case 2:H.id="complete";G.id="active";I.id="pending";A.id="pending";break;case 3:H.id="complete";G.id="complete";I.id="active";A.id="pending";break;case 4:H.id="complete";G.id="complete";I.id="complete";A.id="active";break}};this.reset=function(){};this.getWidget=function(){return C}}function StepInfoWidget(){var B=document.createElement("DIV");B.id="step-info";var E=document.createElement("DIV");E.id="step-info-one";E.appendChild(document.createTextNode(""));var D=document.createElement("DIV");D.id="step-info-two";D.appendChild(document.createTextNode("All prices are inclusive of taxes and fees. No surprise charges and no cancellation fees."));var C=document.createElement("DIV");C.id="step-info-three";C.appendChild(document.createTextNode("Book now to guarantee this rate. No surprise charges, no cancellation fees and no upfront payment."));var A=document.createElement("DIV");A.id="step-info-four";A.appendChild(document.createTextNode(""));B.appendChild(E);B.appendChild(D);B.appendChild(C);B.appendChild(A);this.setStage=function(F){switch(F){case 1:document.getElementById("step-info-one").style.display="none";document.getElementById("step-info-two").style.display="none";document.getElementById("step-info-three").style.display="none";document.getElementById("step-info-four").style.display="none";break;case 2:document.getElementById("step-info-one").style.display="none";document.getElementById("step-info-two").style.display="block";document.getElementById("step-info-three").style.display="none";document.getElementById("step-info-four").style.display="none";break;case 3:document.getElementById("step-info-one").style.display="none";document.getElementById("step-info-two").style.display="none";document.getElementById("step-info-three").style.display="block";document.getElementById("step-info-four").style.display="none";break;case 4:document.getElementById("step-info-one").style.display="none";document.getElementById("step-info-two").style.display="none";document.getElementById("step-info-three").style.display="none";document.getElementById("step-info-four").style.display="none";break}};this.clear=function(){document.getElementById("step-info-one").style.display="none";document.getElementById("step-info-two").style.display="none";document.getElementById("step-info-three").style.display="none";document.getElementById("step-info-four").style.display="none"};this.getWidget=function(){return B}}function SupplierLocationBlock(){var A=document.createElement("DIV");var C=document.createElement("DIV");var B=document.createElement("DIV");this.dateTime;this.supplierLocationObj;this.heading="";this.id="";this.allowModify=true;A.id="heading";this.build=function(){B.id=this.id;C.id="location-section";var D=document.createElement("BUTTON");D.id="modify-button";D.appendChild(document.createTextNode(BUTTON_TEXT.Modify));D.onclick=function(){window.location="#1"};var E=document.createElement("BUTTON");E.id="modify-button-image";E.onclick=function(){window.location="#1"};A.appendChild(document.createTextNode(this.heading));C.appendChild(A);C.appendChild(getSupplierLocationDiv(this.supplierLocationObj));C.appendChild(getDateDiv(this.dateTime));if(this.allowModify){C.appendChild(D);C.appendChild(E)}B.appendChild(C)};this.getWidget=function(){return B}}function TimerWidget(){this.timerText="";this.timerFinishedText="";this.setTimerText=function(E){this.timerText=E};this.setTimerFinishedText=function(E){this.timerFinishedText=E};this.TimerFunction="";var D=document.createElement("DIV");D.id="timer";var B=false;var A=null;var C=null;this.startTimer=function(){B=true;now=new Date();now=now.getTime();A=now+(1000*20);this.showCountDown()};this.clearDiv=function(){while(this.getWidget().firstChild){this.getWidget().removeChild(this.getWidget().firstChild)}};this.showCountDown=function(){var F=new Date();F=F.getTime();if(A-F<=0){clearTimeout(C);B=false;this.clearDiv();D.appendChild(document.createTextNode(this.timerFinishedText))}else{var I=new Date(A-F);var G=I.getMinutes();var H=I.getSeconds();var E=G;E+=((H<10)?":0":":")+H;this.clearDiv();D.appendChild(document.createTextNode(this.timerText.replace("[x]",E)));if(B){C=setTimeout(this.TimerFunction+".showCountDown();",1000)}}};this.getWidget=function(){return D}}function VehicleBlock(){this.supplierVehicle;this.rate;this.heading="Vehicle";var B=document.createElement("DIV");B.id="itinerary-vehicle";var A=document.createElement("DIV");A.id="heading";this.allowModify=true;this.build=function(){var C=document.createElement("BUTTON");C.id="modify-button";C.appendChild(document.createTextNode(BUTTON_TEXT.Modify));C.onclick=function(){window.location="#2"};var D=document.createElement("BUTTON");D.id="modify-button-image";D.onclick=function(){window.location="#2"};A.appendChild(document.createTextNode(this.heading));B.appendChild(A);B.appendChild(getRateDiv(this.rate,"quote"));if(this.allowModify){B.appendChild(C);B.appendChild(D)}};this.getWidget=function(){return B}}var step="step-one";function resetMainDiv(){while(getContentDiv().firstChild){getContentDiv().removeChild(getContentDiv().firstChild)}showContentDiv()}function getMainDiv(){return document.getElementById("accelerate-main")}function getBookingDiv(){return document.getElementById("accelerate-booking")}function showContentDiv(){document.getElementById("accelerate-content").style.visibility="visible"}function hideContentDiv(){document.getElementById("accelerate-content").style.visibility="hidden"}function getContentDiv(){return document.getElementById(step)}function setStep(B){var A=document.getElementById(step);A.id=B;step=B}function createContentDiv(){var C=document.createElement("DIV");C.id="accelerate-content";var B=document.createElement("DIV");B.id=step;C.appendChild(B);var A=getMainDiv();A.appendChild(progressWidget.getWidget());A.appendChild(stepInfoWidget.getWidget());A.appendChild(C)}function ConfirmationWidget(){var A=new Fieldset();A.id="confirmation-fieldset";A.title=FIELDSET_TITLE_TEXT.Confirmation;this.confirmation=null;this.build=function(){A.content.appendChild(getConfirmationDiv(this.confirmation))};this.getWidget=function(){return A.getFieldset()}}function ItineraryDisplayWidget(){var A=new Fieldset();A.id="itinerary-display-fieldset";A.title=FIELDSET_TITLE_TEXT.ItineraryDisplay;this.allowModify=true;this.pickupLocation=null;this.returnLocatoin=null;this.pickupSupplierLocation=null;this.returnSupplierLocation=null;this.pickupDate=null;this.returnDate=null;this.supplierVehicle=null;this.rate=null;this.LOCATION_DISPLAY=1;this.SUPPLIER_LOCATION_DISPLAY=2;this.SUPPLIER_LOCATION_AND_VEHICLE_DISPLAY=3;this.displayType=this.LOCATION_DISPLAY;this.build=function(){if(this.displayType==this.SUPPLIER_LOCATION_AND_VEHICLE_DISPLAY){var D=new VehicleBlock();D.heading=TITLE_TEXT.Vehicle;D.rate=this.rate;D.allowModify=this.allowModify;D.build();A.content.appendChild(D.getWidget())}if(this.displayType==this.LOCATION_DISPLAY){var B=new LocationBlock();B.heading=TITLE_TEXT.PickupLocation;B.id="pickup";B.locationObj=this.pickupLocation;B.dateTime=this.pickupDate;B.allowModify=this.allowModify;B.build();var C=new LocationBlock();C.heading=TITLE_TEXT.ReturnLocation;C.id="return";C.locationObj=this.returnLocation;C.dateTime=this.returnDate;C.allowModify=this.allowModify;C.build();A.content.appendChild(B.getWidget());A.content.appendChild(C.getWidget())}else{if(this.displayType==this.SUPPLIER_LOCATION_AND_VEHICLE_DISPLAY||this.displayType==this.SUPPLIER_LOCATION_DISPLAY){var B=new SupplierLocationBlock();B.heading=TITLE_TEXT.PickupLocation;B.id="pickup";B.supplierLocationObj=this.pickupSupplierLocation;B.dateTime=this.pickupDate;B.allowModify=this.allowModify;B.build();var C=new SupplierLocationBlock();C.heading=TITLE_TEXT.ReturnLocation;C.id="return";C.supplierLocationObj=this.returnSupplierLocation;C.dateTime=this.returnDate;C.allowModify=this.allowModify;C.build();A.content.appendChild(B.getWidget());A.content.appendChild(C.getWidget())}}};this.getWidget=function(){return A.getFieldset()}}Option.prototype.location=null;function ItineraryWidget(){var m=false;this.locations=[];this.locationLinks=[];this.render=function(){s.build();K.build()};this.resetDates=function(){var AD=new Date();AD.setDate(AD.getDate()+1);AD.setHours(12);AD.setMinutes(0);this.setPickupDate(AD);var AC=new Date();AC.setDate(AC.getDate()+2);AC.setHours(12);AC.setMinutes(0);this.setReturnDate(AC)};this.continueFunction=function(){};this.onClickFunction=function(){alert("No continue function set for Itinerary Widget");this.continueFunction()};this.setPickupDate=function(AC){s.setDate(AC)};this.setReturnDate=function(AC){K.setDate(AC)};this.getDiv=function(){return N.getFieldset()};var X=function(AC){for(i=0;i<q.options.length;i++){if(q.options[i].value==AC){q.options[i].selected=true;q.selectedIndex=i;break}}};var e=function(AE){var AC=null;for(i=0;i<q.options.length;i++){var AD=q.options[i].text.toUpperCase();if(AD.indexOf(",")){AD=AD.substring(0,AD.indexOf(",")).trim()}if(AD==AE.toUpperCase()){AC=q.options[i].value;break}}return AC};var I=function(AC){for(i=0;i<W.options.length;i++){if(W.options[i].value==AC){W.options[i].selected=true;W.selectedIndex=i;break}}};var f=function(AC){for(i=0;i<Q.options.length;i++){if(Q.options[i].value.toUpperCase()==AC.toUpperCase()){Q.options[i].selected=true;break}}};this.setRenterCountryCode=function(AC){for(i=0;i<p.options.length;i++){if(p.options[i].value==AC){p.options[i].selected=true;break}}};this.setRenterAge=function(AC){for(i=0;i<C.options.length;i++){if(C.options[i].value==AC){C.options[i].selected=true;break}}};var U=function(){var AC=new Option(GENERAL_MSG.LoadingPrompt);q.options[0]=AC;q.disabled=true};var o=function(){var AC=new Option(GENERAL_MSG.LoadingPrompt);W.options[0]=AC;W.disabled=true};var M=function(){var AC=new Option(GENERAL_MSG.LoadingPrompt);Q.options[0]=AC;Q.disabled=true};this.setPickupAndReturn=(function(AC){return function(AE,AD,AG){U();o();var AI=AD;var AF=AG;f(AE);var AH={sessionId:session.sessionId,countryCode:AE};Booking.getCountryLocationsFlattened(AH,function(AL){var AO=objectifyFlatCountryLocations(AL);j(AO.locations);AC.locations=AO.locations;AC.locationLinks=AO.locationLinks;AD=AD+"";if(isNaN(AD.charAt(0))){AI=e(AD);AF=AI}if(AI!=null){X(AI);var AK={sessionId:session.sessionId,pickupLocationId:AI};AC.locations=AO.locations;AC.locationLinks=AO.locationLinks;var AM=z(q.value,AC);var AN=l(AM,AC);var AJ=u(AN,AC);Y(AJ);I(AF)}})}})(this);this.populateCountries=function(AC){var AD=new Option("");AD.value="";Q.options[Q.options.length]=AD;for(x=0;x<AC.length;x++){var AE=new Option(AC[x].name);AE.value=AC[x].countryCode;Q.options[Q.options.length]=AE}if(AC.length==1){Q.disabled=true}};this.populateRenterCountries=function(AC){var AD=new Option("");AD.value="";for(x=0;x<AC.length;x++){var AE=new Option(AC[x].name);AE.value=AC[x].countryCode;p.options[p.options.length]=AE}};this.getPickupCountryCode=function(){return Q.options[Q.selectedIndex].value};this.getRenterCountryCode=function(){return p.options[p.selectedIndex].value};this.getRenterBirthDate=function(){var AC=new Date();AC.setYear(AC.getYear()-this.getRenterAge());AC.setDate(1);return AC};this.getPickupDate=function(){return s.getDate()};this.getReturnDate=function(){return K.getDate()};this.getPickupLocation=function(){return q.options[q.selectedIndex].location};this.getReturnLocation=function(){return W.options[W.selectedIndex].location};this.getPickupLocationId=function(){return q.options[q.selectedIndex].location.cityId};this.getPickupLocationText=function(){return q.options[q.selectedIndex].text};this.getReturnLocationId=function(){return W.options[W.selectedIndex].location.cityId};this.getReturnLocationText=function(){return W.options[W.selectedIndex].text};this.getRenterAge=function(){return C.options[C.selectedIndex].value};var L=function(AC){for(x=0;x<AC.length;x++){}};var B=function(AD){var AD=AD.sort(F);var AC=Array();var AF=Array();var AH=Array();AF[AF.length]=h("");AF[AF.length]=h("Popular Locations");AF[AF.length]=h("-----------------");var AE=AC.length;for(var AG in AD){if(AD[AG].isPriority){AC[AE]=AD[AG];AE=AE+1}}AC.sort(F);var AK=AF.concat(AC);AH[AH.length]=h("");AH[AH.length]=h("");AH[AH.length]=h("All Locations");AH[AH.length]=h("-------------");var AJ=AK.concat(AH);var AI=AJ.concat(AD);return AI};var h=function(AD){var AC=new Object();AC.isAirport=false;AC.isPriority=false;AC.locationId="-1";AC.name=AD;return AC};var F=function(AE,AD){if(AE.name==null||AD.name==null){alert(AE);alert(AD)}var AC=AE.name.toLowerCase();var AF=AD.name.toLowerCase();return((AC<AF)?-1:((AC>AF)?1:0))};var j=function(AC){k();b();AC=B(AC);for(x=0;x<AC.length;x++){var AD=new Option(AC[x].name);AD.value=AC[x].locationId;AD.location=AC[x];q.options[q.options.length]=AD}q.disabled=false};var Y=function(AD){b();AD=B(AD);for(x=0;x<AD.length;x++){if(AD[x]!=null){var AC=new Option(AD[x].name);AC.value=AD[x].locationId;AC.location=AD[x];W.options[W.options.length]=AC}}W.disabled=false};var k=function(){for(var AC=q.length-1;AC>=0;AC--){q.remove(AC)}var AD=new Option("select location");AD.value="";q.options[q.options.length]=AD;q.disabled=true};var b=function(){for(var AC=W.length-1;AC>=0;AC--){W.remove(AC)}var AD=new Option("select location");W.options[W.options.length]=AD;W.disabled=true};var n=function(){var AD=new Option("--");C.options[C.options.length]=AD;for(var AC=18;AC<=99;AC++){var AE=new Option(AC);AE.value=AC;C.options[C.options.length]=AE}};var AB=function(){};var s=new DateWidget("pickup-date");var K=new DateWidget("return-date");var C=document.createElement("SELECT");C.id="renter-age-select";n();var p=document.createElement("SELECT");p.id="renter-country-select";AB();var Q=document.createElement("SELECT");Q.id="pickup-country";Q.onchange=(function(AC){return function(){k();b();if(Q.value!=""){U();var AD={sessionId:session.sessionId,countryCode:Q.value};analytics.log("select.country."+Q.value);Booking.getCountryLocationsFlattened(AD,function(AE){var AF=objectifyFlatCountryLocations(AE);AC.locations=AF.locations;AC.locationLinks=AF.locationLinks;j(AF.locations)})}else{k();b()}}})(this);var q=document.createElement("SELECT");q.id="pickup-location-select";q.onchange=(function(AC){return function(){if(q.value!=""){o();var AE={sessionId:session.sessionId,pickupLocationId:q.value};var AF=z(q.value,AC);var AG=l(AF,AC);var AD=u(AG,AC);Y(AD);I(q.value)}else{b()}}})(this);var z=function(AG,AD){var AC=[];var AE=0;for(var AF=0;AF<AD.locationLinks.length;AF++){if(AD.locationLinks[AF].locationId==AG){AC[AE]=AD.locationLinks[AF].supplierId;AE++}}return AC};var l=function(AD,AF){var AJ=[];var AG=0;var AI=AF.locationLinks.length;var AE=AF.locationLinks;for(var AC=0;AC<AD.length;AC++){for(var AH=0;AH<AI;AH++){if(AE[AH].supplierId==AD[AC]){AJ[AG]=AE[AH].locationId;AG++}}}return AJ};var u=function(AJ,AE){var AH=new Array();var AC=[];var AG=0;var AF=new Array();for(var AD=0;AD<AE.locations.length;AD++){AF[AE.locations[AD].locationId]=AE.locations[AD]}for(var AK=0;AK<AJ.length;AK++){AC["LOC"+AJ[AK]]=AF[AJ[AK]]}var AG=0;for(var AI in AC){AH[AG]=AC[AI];AG++}return AH};var W=document.createElement("SELECT");W.id="return-location-select";k();b();var N=new Fieldset();N.id="itinerary-fieldset";N.title=FIELDSET_TITLE_TEXT.Itinerary;var G=document.createElement("DIV");G.id="location-section";var P=document.createElement("DIV");P.id="section-title";var AA=document.createElement("STRONG");AA.appendChild(document.createTextNode(TITLE_TEXT.LocationSectionTitle+":"));P.appendChild(AA);G.appendChild(P);var O=document.createElement("LABEL");var a=document.createElement("DIV");a.id="form-item";O.appendChild(document.createTextNode(TITLE_TEXT.PickupCountry+":"));a.appendChild(O);a.appendChild(Q);G.appendChild(a);var T=document.createElement("LABEL");var A=document.createElement("DIV");A.id="form-item";T.appendChild(document.createTextNode(TITLE_TEXT.PickupLocation+":"));A.appendChild(T);A.appendChild(q);G.appendChild(A);var Z=document.createElement("LABEL");var J=document.createElement("DIV");J.id="form-item";Z.appendChild(document.createTextNode(TITLE_TEXT.ReturnLocation+":"));J.appendChild(Z);J.appendChild(W);G.appendChild(J);N.content.appendChild(G);var S=document.createElement("DIV");S.id="date-section";var H=document.createElement("DIV");H.id="section-title";var D=document.createElement("STRONG");D.appendChild(document.createTextNode(TITLE_TEXT.DatesSectionTitle));H.appendChild(D);S.appendChild(H);s.setLabel(TITLE_TEXT.PickupDate+":");S.appendChild(s.getWidget());K.setLabel(TITLE_TEXT.ReturnDate+":");S.appendChild(K.getWidget());N.content.appendChild(S);var w=document.createElement("DIV");w.id="renter-section";var c=document.createElement("DIV");c.id="section-title";var E=document.createElement("STRONG");E.appendChild(document.createTextNode(TITLE_TEXT.RenterSectionTitle));c.appendChild(E);w.appendChild(c);var v=document.createElement("LABEL");var g=document.createElement("DIV");g.id="form-item";v.appendChild(document.createTextNode(TITLE_TEXT.RenterCountry+":"));g.appendChild(v);g.appendChild(p);w.appendChild(g);var V=document.createElement("LABEL");var R=document.createElement("DIV");R.id="form-item";V.appendChild(document.createTextNode(TITLE_TEXT.RenterAge+":"));R.appendChild(V);R.appendChild(C);w.appendChild(R);N.content.appendChild(w);this.continueButton=document.createElement("BUTTON");this.continueButton.id="search-button";this.continueButton.appendChild(document.createTextNode(BUTTON_TEXT.Search));N.content.appendChild(this.continueButton);this.continueButtonImage=document.createElement("BUTTON");this.continueButtonImage.id="search-button-image";N.content.appendChild(this.continueButtonImage)}function PricingWidget(B){var A=new Fieldset();A.id="pricing-fieldset";A.title=FIELDSET_TITLE_TEXT.Pricing;this.quote=B;A.content.appendChild(getQuoteDiv("quote",this.quote));this.getWidget=function(){return A.getFieldset()}}function QuoteWidget(B){var A=new Fieldset();A.id="quote-fieldset";A.title=FIELDSET_TITLE_TEXT.Quote;this.quote=B;A.content.appendChild(getQuoteDiv("quote",this.quote));this.getWidget=function(){return A.getFieldset()}}function RatesWidget(){var M=new Fieldset();M.id="rates-fieldset";M.title="Rates";var I=new NotesWidget();I.add(getNote("availability-note",TITLE_TEXT.AvailabilityNote,NOTE_TEXT.AvailabilityNote));M.content.appendChild(I.getWidget());var E=document.createElement("DIV");var J=document.createElement("DIV");J.id="tab-panel";var F;var H;var D;var K;var L;var B;var G;var A;var C;this.resetTabs=function(){if(typeof (F)!="undefined"){F.id="item"}if(typeof (H)!="undefined"){H.id="item"}if(typeof (D)!="undefined"){D.id="item"}if(typeof (K)!="undefined"){K.id="item"}if(typeof (L)!="undefined"){L.id="item"}if(typeof (B)!="undefined"){B.id="item"}if(typeof (G)!="undefined"){G.id="item"}if(typeof (A)!="undefined"){A.id="item"}if(typeof (C)!="undefined"){C.id="item"}};this.build=function(){if(accelerate.product.toLowerCase()=="passenger"||session.product.toLowerCase()=="passenger"){F=document.createElement("a");F.id="item-selected";var O=document.createElement("DIV");O.id="all";var N=document.createElement("DIV");N.id="title";O.appendChild(F);F.appendChild(N);N.appendChild(document.createTextNode("All"));J.appendChild(O);F.onclick=(function(g){return function(){analytics.log("tab.select.all");g.loadRates(g.rates);g.resetTabs();F.id="item-selected"}})(this);if(filterCompactEconomy(this.rates).length>0){H=document.createElement("a");H.id="item";var X=document.createElement("DIV");X.id="small";var T=document.createElement("DIV");T.id="title";X.appendChild(H);H.appendChild(T);T.appendChild(document.createTextNode("Small"));J.appendChild(X);H.onclick=(function(g){return function(){analytics.log("tab.select.small");g.loadRates(filterCompactEconomy(g.rates));g.resetTabs();H.id="item-selected"}})(this)}if(filterFullsizeIntermediate(this.rates).length>0){D=document.createElement("a");D.id="item";var V=document.createElement("DIV");V.id="standard";var R=document.createElement("DIV");R.id="title";V.appendChild(D);D.appendChild(R);R.appendChild(document.createTextNode("Standard"));J.appendChild(V);D.onclick=(function(g){return function(){analytics.log("tab.select.standard");g.loadRates(filterFullsizeIntermediate(g.rates));g.resetTabs();D.id="item-selected"}})(this)}if(filterPremiumLuxury(this.rates).length>0){K=document.createElement("a");K.id="item";var S=document.createElement("DIV");S.id="premium";var P=document.createElement("DIV");P.id="title";S.appendChild(K);K.appendChild(P);P.appendChild(document.createTextNode("Premium"));J.appendChild(S);K.onclick=(function(g){return function(){analytics.log("tab.select.premium");g.loadRates(filterPremiumLuxury(g.rates));g.resetTabs();K.id="item-selected"}})(this)}if(filter4wdSuv(this.rates).length>0){L=document.createElement("a");L.id="item";var U=document.createElement("DIV");U.id="suv";var Q=document.createElement("DIV");Q.id="title";U.appendChild(L);L.appendChild(Q);Q.appendChild(document.createTextNode("4WD/SUV"));J.appendChild(U);L.onclick=(function(g){return function(){analytics.log("tab.select.4wdsuv");g.loadRates(filter4wdSuv(g.rates));g.resetTabs();L.id="item-selected"}})(this)}if(filterSportConvertible(this.rates).length>0){B=document.createElement("a");B.id="item";var Z=document.createElement("DIV");Z.id="sports";var W=document.createElement("DIV");W.id="title";Z.appendChild(B);B.appendChild(W);W.appendChild(document.createTextNode("Special"));J.appendChild(Z);B.onclick=(function(g){return function(){analytics.log("tab.select.special");g.loadRates(filterSportConvertible(g.rates));g.resetTabs();B.id="item-selected"}})(this)}}else{if(accelerate.product.toLowerCase()=="commercial"||session.product.toLowerCase()=="commercial"){F=document.createElement("a");F.id="item-selected";var O=document.createElement("DIV");O.id="all";var N=document.createElement("DIV");N.id="title";O.appendChild(F);F.appendChild(N);N.appendChild(document.createTextNode("All"));J.appendChild(O);F.onclick=(function(g){return function(){analytics.log("tab.select.all");g.loadRates(filterAllCommercial(g.rates));g.resetTabs();F.id="item-selected"}})(this);if(filterMovingVan(this.rates).length>0){C=document.createElement("a");C.id="item";var c=document.createElement("DIV");c.id="sports";var a=document.createElement("DIV");a.id="title";c.appendChild(C);C.appendChild(a);a.appendChild(document.createTextNode("Moving Truck/Van"));J.appendChild(c);C.onclick=(function(g){return function(){analytics.log("tab.select.movingvan");g.loadRates(filterMovingVan(g.rates));g.resetTabs();C.id="item-selected"}})(this)}if(filterUtility(this.rates).length>0){A=document.createElement("a");A.id="item";var b=document.createElement("DIV");b.id="premium";var Y=document.createElement("DIV");Y.id="title";b.appendChild(A);A.appendChild(Y);Y.appendChild(document.createTextNode("Ute/Tray"));J.appendChild(b);A.onclick=(function(g){return function(){analytics.log("tab.select.utetray");g.loadRates(filterUtility(g.rates));g.resetTabs();A.id="item-selected"}})(this)}if(filterPassengerVan(this.rates).length>0){G=document.createElement("a");G.id="item";var f=document.createElement("DIV");f.id="standard";var e=document.createElement("DIV");e.id="title";f.appendChild(G);G.appendChild(e);e.appendChild(document.createTextNode("Passenger Van"));J.appendChild(f);G.onclick=(function(g){return function(){analytics.log("tab.select.passengervan");g.loadRates(filterPassengerVan(g.rates));g.resetTabs();G.id="item-selected"}})(this)}}}M.content.appendChild(J);M.content.appendChild(E)};this.rates;this.vehicleType;this.rts;this.setRate=function(N){this.rates=N;this.loadRates(N)};this.loadRates=function(N){N=sortByPriceCheapest(N);while(E.firstChild){E.removeChild(E.firstChild)}this.rts=N;for(y=0;y<this.rts.length;y++){if(this.rts[y].isConfirmed){rateWidget=new RateWidget(this.rts[y]);E.appendChild(rateWidget.getWidget())}}};this.getWidget=function(){return M.getFieldset()}}function RateWidget(A){this.rate=A;this.getWidget=function(){var F=document.createElement("A");F.id="rate-button";var C=document.createElement("DIV");C.id="rate-button-text";C.appendChild(document.createTextNode(BUTTON_TEXT.SelectRate));F.appendChild(C);var B=document.createElement("A");B.id="rate-button-image";var D=this.rate;F.onclick=(function(G){return function(){submitRate(G)}})(D);B.onclick=(function(G){return function(){submitRate(G)}})(D);var E=getRateDiv(A,"rates");E.appendChild(F);E.appendChild(B);return E}}function getSortDiv(){}function RenterDetailsWidget(P,O,F){var S=new Fieldset();S.id="renter-details-fieldset";S.title=FIELDSET_TITLE_TEXT.RenterDetails;this.continueButton=document.createElement("div");this.continueButtonImage=document.createElement("div");this.IsCreditCardRequired=false;var AA=document.createElement("DIV");AA.id="field";var e=document.createElement("SELECT");var K=document.createElement("DIV");K.id="label";K.appendChild(document.createTextNode("Title:"));var Y=new Option("MR");e.options[0]=Y;var Y=new Option("MRS");e.options[1]=Y;var Y=new Option("MS");e.options[2]=Y;var Y=new Option("MISS");e.options[3]=Y;var C=document.createElement("DIV");C.id="field";var l=document.createElement("INPUT");var Q=document.createElement("DIV");Q.id="label";Q.appendChild(document.createTextNode("First Name:"));var w=document.createElement("DIV");w.id="field";var N=document.createElement("INPUT");var v=document.createElement("DIV");v.id="label";v.appendChild(document.createTextNode("Last Name:"));var J=document.createElement("DIV");J.id="field";var U=document.createElement("INPUT");var z=document.createElement("DIV");z.id="label";z.appendChild(document.createTextNode("Phone:"));var T=document.createElement("DIV");T.id="field";var m=document.createElement("INPUT");var R=document.createElement("DIV");R.id="label";R.appendChild(document.createTextNode("Email Address:"));var G=document.createElement("DIV");G.id="field";var H=document.createElement("INPUT");var o=document.createElement("DIV");o.id="label";o.appendChild(document.createTextNode("Confirm Email:"));var u=document.createElement("DIV");u.id="newsletter-field";var D=document.createElement("INPUT");D.type="checkbox";var j=document.createElement("DIV");j.id="newsletter-title";j.appendChild(document.createTextNode("Subscribe to our newsletter:"));var W=document.createElement("DIV");W.id="field";var L=document.createElement("INPUT");L.id="flight-number";L.size=4;L.maxlength=3;var q=document.createElement("DIV");q.id="label";q.appendChild(document.createTextNode("Flight No/Airline:"));var g=document.createElement("SELECT");g.id="airline";var p=document.createElement("DIV");p.id="label";var s=false;if(O!=null){s=true;var Z=new Option("");Z.value="";g.options[g.options.length]=Z;Z=new Option("-- I don't know --");Z.value="-1";g.options[g.options.length]=Z;for(x=2;x<O.length;x++){Z=new Option(O[x].name);Z.value=O[x].code;g.options[g.options.length]=Z}}if(F!=null){this.IsCreditCardRequired=true;var V=document.createElement("DIV");V.id="field";var A=document.createElement("INPUT");var b=document.createElement("DIV");b.id="label";b.appendChild(document.createTextNode("Credit Card:"));var c=document.createElement("SELECT");var I=document.createElement("DIV");I.id="label";for(x=0;x<F.length;x++){var X=new Option(F[x].name);X.value=F[x].name;c.options[c.options.length]=X}var f=document.createElement("DIV");f.id="label";f.appendChild(document.createTextNode("Card Expiry:"));var k=document.createElement("DIV");var M=document.createElement("SELECT");for(x=1;x<13;x++){var n="";if(x<10){n="0"+x}else{n=x}var E=new Option(n);M.options[x-1]=E}var h=document.createElement("SELECT");for(x=0;x<10;x++){var B=new Date();var a=new Option(B.getFullYear()+x);h.options[x]=a}}this.getFirstName=function(){return l.value};this.getLastName=function(){return N.value};this.getTitle=function(){return e.options[e.selectedIndex].value};this.getPhoneNumber=function(){return U.value};this.getEmail=function(){return m.value};this.getEmailRepeat=function(){return H.value};this.getCreditCardNumber=function(){return A.value};this.getFlightNumber=function(){return L.value};this.getAirlineCode=function(){return g.options[g.selectedIndex].value};this.getCreditCardType=function(){return c.options[c.selectedIndex].value};this.getCreditCardExpiry=function(){return new Date()};this.IsPickupOnAirport=function(){return s};this.JoinMailingList=function(){return D.checked};this.getWidget=function(){AA.appendChild(K);AA.appendChild(e);S.content.appendChild(AA);C.appendChild(Q);C.appendChild(l);S.content.appendChild(C);w.appendChild(v);w.appendChild(N);S.content.appendChild(w);J.appendChild(z);J.appendChild(U);S.content.appendChild(J);T.appendChild(R);T.appendChild(m);S.content.appendChild(T);G.appendChild(o);G.appendChild(H);S.content.appendChild(G);if(s){W.appendChild(q);W.appendChild(L);W.appendChild(g);S.content.appendChild(W)}if(this.IsCreditCardRequired){V.appendChild(b);V.appendChild(A);V.appendChild(c);S.content.appendChild(V);k.appendChild(f);k.appendChild(M);k.appendChild(h);S.content.appendChild(k)}g.onchange=(function(AE){return function(){if(g.value=="-1"){L.disabled=true}else{L.disabled=false}}})(this);var AC=new NotesWidget();AC.add(getPaymentNote());AC.add(getSecurityNote());S.content.appendChild(AC.getWidget());var AD=document.createElement("DIV");AD.id="book-button-text";AD.appendChild(document.createTextNode(BUTTON_TEXT.Book));this.continueButton.id="book-button";this.continueButton.appendChild(AD);S.content.appendChild(this.continueButton);this.continueButtonImage.id="book-button-image";S.content.appendChild(this.continueButtonImage);u.appendChild(j);u.appendChild(D);S.content.appendChild(u);var AB=document.createElement("DIV");AB.id="ssl-seal";S.content.appendChild(AB);S.content.appendChild(getTermsDiv(P));return S.getFieldset()}}var hashListener={ie:/MSIE/.test(navigator.userAgent),ieSupportBack:true,hash:document.location.hash,check:function(){var A=document.location.hash;if(A!=this.hash){this.hash=A;this.onHashChanged()}},init:function(){if(this.ie&&this.ieSupportBack){var B=document.createElement("iframe");B.id="state-frame";B.style.display="none";B.src="javascript:void(0);";document.body.appendChild(B);this.writeFrame("")}var A=this;if("onpropertychange" in document&&"attachEvent" in document){document.attachEvent("onpropertychange",function(){if(event.propertyName=="location"){A.check()}})}window.setInterval("hashListener.check()",300)},setHash:function(A){if(this.ie&&this.ieSupportBack){this.writeFrame(A)}document.location.hash=A},setStep:function(A){this.setHash(A)},getHash:function(){return document.location.hash},writeFrame:function(A){var B=document.getElementById("state-frame");var C=B.contentDocument||B.contentWindow.document;C.open();C.write("<script>window._hash = '"+A+"'; window.onload = parent.hashListener.syncHash;<\/script>");C.close()},syncHash:function(){var A=this._hash;if(A!=document.location.hash){document.location.hash=A}},onHashChanged:function(){}};var session=new Session();var errorMessage=new ErrorMessage();var analytics=new GoogleAnalytics();var progressWidget=new ProgressWidget();var stepInfoWidget=new StepInfoWidget();progressWidget.setStage(1);var waitMessage=new WaitMessage();waitMessage.mainDivId="accelerate-main";waitMessage.bookingDivId="accelerate-booking";waitMessage.contentDivId="accelerate-content";function getQuoteDiv(E,A){var D=document.createElement("DIV");D.id=E;D.appendChild(getQuoteTitleDiv("Base Price"));D.appendChild(getQuoteItemDiv(A.totalTk));D.appendChild(getQuoteTitleDiv("Additional Charges"));for(y=0;y<A.priceItems.length;y++){D.appendChild(getQuoteItemDiv(A.priceItems[y]))}D.appendChild(getQuoteTotalDiv(A.total,A.currency));var C=document.createElement("DIV");C.id="price-info";C.appendChild(document.createTextNode("Book now to secure this rate, changes in availability may alter the price."));D.appendChild(C);var B=new NotesWidget();if(getDistanceRestrictionText(A.currency,A.distanceRestriction).length>0){B.add(getNote("distance-restriction",TITLE_TEXT.DistanceRestrictions,getDistanceRestrictionText(A.currency,A.distanceRestriction)));D.appendChild(B.getWidget())}return D}function getQuoteTitleDiv(A){var B=document.createElement("DIV");B.id="heading";B.appendChild(document.createTextNode(A));return B}function getQuoteTotalDiv(C,B){var E=document.createElement("DIV");E.id="total";var D=document.createElement("DIV");D.appendChild(document.createTextNode("Total"));D.id="title";var A=document.createElement("DIV");A.appendChild(document.createTextNode(B.currencyCode+B.symbol+C.value.toFixed(2)+""));A.id="value";E.appendChild(D);E.appendChild(A);return E}function getQuoteItemDiv(D){var C=document.createElement("DIV");C.id="item";var B=document.createElement("DIV");B.appendChild(document.createTextNode(CHARGE_TITLE[D.chargeType]));B.id="title";var A=document.createElement("DIV");A.appendChild(document.createTextNode(D.value.toFixed(2)));A.id="value";C.appendChild(B);C.appendChild(A);return C}function getRateDiv(E,D){var G=document.createElement("DIV");var F=document.createElement("DIV");var B=document.createElement("DIV");var C=document.createElement("DIV");var A=document.createElement("DIV");A.id="duration";A.appendChild(document.createTextNode(getDuration(E)));C.id="availability";G.id="rate-info";G.appendChild(getCategoryDiv(E.supplierVehicle.sippCode));B.id="text";if(E.isConfirmed){F.id="confirmed";B.appendChild(document.createTextNode("Available"))}else{F.id="on-request";B.appendChild(document.createTextNode("On Request"))}F.appendChild(B);C.appendChild(F);G.appendChild(C);G.appendChild(getMonetaryValueDiv("charge",E.rate,E.currency));G.appendChild(getSupplierVehicleDiv(E.supplierVehicle,D));G.appendChild(A);return G}function getCalDiv(){var B=document.createElement("DIV");var A=document.createElement("DIV");var C=document.createElement("DIV");B.id="cal";A.id="image";C.id="text";C.appendChild(document.createTextNode(TITLE_TEXT.Calendar));B.appendChild(C);return B}function getMonetaryValueDiv(D,B,A){var C=document.createElement("DIV");C.id=D;C.appendChild(getCurrencyDiv(A,B));return C}function getField(G,C,A){var F=document.createElement("DIV");var E=document.createElement("DIV");var D=document.createElement("DIV");var B=document.createElement("DIV");F.id=G;E.id="field";D.id="title";B.id="value";D.appendChild(document.createTextNode(C));if(!isNaN(A)){A=String(A)}if(A==null){A=""}if(typeof A=="string"){B.appendChild(document.createTextNode(A))}else{B.appendChild(A)}E.appendChild(D);E.appendChild(B);F.appendChild(E);return F}function getFieldWithUnits(C,G,H,I){var B=document.createElement("DIV");var D=document.createElement("DIV");var A=document.createElement("DIV");var E=document.createElement("DIV");var F=document.createElement("DIV");B.id=C;D.id="field";A.id="title";E.id="value";F.id="unit";A.appendChild(document.createTextNode(G));E.appendChild(document.createTextNode(H));F.appendChild(document.createTextNode(I));D.appendChild(A);D.appendChild(E);D.appendChild(F);B.appendChild(D);return B}function getNote(G,E,B){var F=document.createElement("DIV");var D=document.createElement("DIV");var C=document.createElement("DIV");var A=document.createElement("DIV");F.id=G;D.id="note";C.id="title";A.id="message";C.appendChild(document.createTextNode(E));A.appendChild(document.createTextNode(B));D.appendChild(C);D.appendChild(A);F.appendChild(D);return F}function getNoteWithDivMessage(G,E,A){var F=document.createElement("DIV");var D=document.createElement("DIV");var C=document.createElement("DIV");var B=document.createElement("DIV");F.id=G;D.id="note";C.id="title";B.id="message";C.appendChild(document.createTextNode(E));B.appendChild(A);D.appendChild(C);D.appendChild(B);F.appendChild(D);return F}function getConfirmationDiv(D){var A=document.createElement("DIV");var C=document.createElement("DIV");var B=new NotesWidget();B.add(getNote("confirmation-text",TITLE_TEXT.ConfirmationNote,getConfirmationNoteMessage(D)));A.id="confirmation";A.appendChild(getField("code",TITLE_TEXT.ConfirmationCode,D.supplierConfirmationCode));A.appendChild(B.getWidget());A.appendChild(getSupplierDiv(D.supplier));return A}function getCurrencyDiv(B,G){var F=document.createElement("DIV");var D=document.createElement("DIV");var E=document.createElement("DIV");var A=document.createElement("DIV");F.id="currency";D.id="code";E.id="name";A.id="symbol";D.appendChild(document.createTextNode(B.currencyCode));A.appendChild(document.createTextNode(B.symbol));E.appendChild(document.createTextNode(B.name));var C=document.createElement("DIV");C.id="value";C.appendChild(document.createTextNode(G.toFixed(2)));F.appendChild(A);F.appendChild(D);F.appendChild(E);F.appendChild(C);return F}function getVehicleDiv(O,I){var F=document.createElement("DIV");F.id="vehicle";var X=document.createElement("DIV");X.id="description";X.appendChild(document.createTextNode(getVehicleDescription(O)));F.appendChild(X);var R=document.createElement("DIV");R.id="transmission";var C=document.createElement("DIV");C.id=O.transmission;R.appendChild(C);var J=document.createElement("DIV");J.id="text";J.appendChild(document.createTextNode(O.transmission));R.appendChild(J);F.appendChild(R);if(O.aircon){var V=document.createElement("DIV");V.id="aircon";var E=document.createElement("DIV");E.id="text";E.appendChild(document.createTextNode("Aircon"));V.appendChild(E);F.appendChild(V)}var a=document.createElement("DIV");a.id="luggage";if(O.luggageLarge<0){O.luggage=0}var L=document.createElement("DIV");L.id=O.luggageLarge;a.appendChild(L);var D=document.createElement("DIV");D.id="text";D.appendChild(document.createTextNode("x"+O.luggageLarge));a.appendChild(D);F.appendChild(a);if(I=="rates"){var A=document.createElement("IMG");A.src=(("https:"==document.location.protocol)?"https://":"http://");A.src="https://dertno7jp9op3.cloudfront.net/image/vehicle/small/"+O.imageUrl;A.id="image-small";F.appendChild(A)}else{if(I=="quote"){var K=document.createElement("IMG");K.src=(("https:"==document.location.protocol)?"https://":"http://");K.src="https://dertno7jp9op3.cloudfront.net/image/vehicle/small/"+O.imageUrl;K.id="image-small";F.appendChild(K);var S=document.createElement("IMG");S.src=(("https:"==document.location.protocol)?"https://":"http://");S.src="https://dertno7jp9op3.cloudfront.net/image/vehicle/large/"+O.imageUrl;S.id="image-large";F.appendChild(S)}}var N=document.createElement("DIV");N.id="passengers";var B=document.createElement("DIV");B.id=O.passengers;N.appendChild(B);var G=document.createElement("DIV");G.id="text";G.appendChild(document.createTextNode("x"+O.passengers));N.appendChild(G);F.appendChild(N);var M=document.createElement("DIV");M.id="make-model";M.appendChild(document.createTextNode(O.make+" "+O.model));F.appendChild(M);var Y=document.createElement("DIV");Y.id="orsimilar";Y.appendChild(document.createTextNode(TITLE_TEXT.OrSimilar));F.appendChild(Y);var P=document.createElement("DIV");P.id="doors";var H=document.createElement("DIV");H.id="qty";P.appendChild(H);var Q=document.createElement("DIV");Q.id="title";P.appendChild(Q);H.appendChild(document.createTextNode(O.doors));Q.appendChild(document.createTextNode(TITLE_TEXT.VehicleDoors));F.appendChild(P);var T=document.createElement("DIV");T.id="engine-size";var W=document.createElement("DIV");W.id="title";W.appendChild(document.createTextNode(TITLE_TEXT.VehicleEngineSize));T.appendChild(W);var Z=document.createElement("DIV");Z.id="value";Z.appendChild(document.createTextNode(O.engineSize));T.appendChild(Z);var U=document.createElement("DIV");U.id="unit";U.appendChild(document.createTextNode(TITLE_TEXT.Litres));T.appendChild(U);F.appendChild(T);return F}function getSupplierVehicleDiv(D,A){var B=document.createElement("DIV");B.id="supplier-vehicle";var C=document.createElement("DIV");C.id="sipp";C.appendChild(document.createTextNode(D.sippCode));var E=document.createElement("DIV");E.id="description";E.appendChild(document.createTextNode(getSippDescription(D.sippCode)));B.appendChild(C);B.appendChild(E);B.appendChild(getSupplierDiv(D.supplier));B.appendChild(getVehicleDiv(D,A));return B}function getSippDescription(A){var B=SIPP_CATEGORY[A.charAt(0)]+" "+SIPP_TYPE[A.charAt(1)]+" "+SIPP_DRIVE[A.charAt(2)]+" "+SIPP_FUEL[A.charAt(3)];return B}function getDateDiv(B){var A=document.createElement("DIV");var F=document.createElement("DIV");F.id="title";var E=document.createElement("DIV");var D=document.createElement("DIV");var C=document.createElement("DIV");F.appendChild(document.createTextNode(TITLE_TEXT.Date+":"));A.appendChild(F);A.id="date";E.id="day-month-year";C.id="time";D.id="full";E.appendChild(document.createTextNode(getDateString(B)));C.appendChild(document.createTextNode(getTimeString(B)));D.appendChild(document.createTextNode(getDateString(B)+", "+getTimeString(B)));A.appendChild(E);A.appendChild(C);A.appendChild(D);return A}function getLocationDiv(H){var G=document.createElement("DIV");var E=document.createElement("DIV");E.id="title";var C=document.createElement("DIV");C.id="city";var B=document.createElement("DIV");B.id="region";var D=document.createElement("DIV");D.id="country";var I=document.createElement("DIV");I.id="city-state-country";var F=document.createElement("DIV");G.id="location";E.appendChild(document.createTextNode(TITLE_TEXT.Location+":"));G.appendChild(E);C.appendChild(document.createTextNode(H.city));B.appendChild(document.createTextNode(H.countryRegion.name));D.appendChild(document.createTextNode(H.countryRegion.country.name));var A="";if(H.isOnAirport){A=H.city+" Airport ("+H.iata+"), "}else{A=H.city+", "}if(H.countryRegion.code){A=A+H.countryRegion.code+", "}A=A+H.countryRegion.country.countryCode;I.appendChild(document.createTextNode(A));G.appendChild(C);G.appendChild(B);G.appendChild(D);G.appendChild(I);if(H.isOnAirport){C.id="airport";G.appendChild(C)}return G}function getSupplierLocationDiv(E){var D=document.createElement("DIV");D.id="supplier-location";var C=document.createElement("DIV");C.id="title";C.appendChild(document.createTextNode(TITLE_TEXT.Location+":"));D.appendChild(C);var A=document.createElement("DIV");A.id="depot";var B=document.createElement("DIV");B.id="address";A.appendChild(document.createTextNode(getDepot(E)));B.appendChild(document.createTextNode(E.address));D.appendChild(A);D.appendChild(B);D.appendChild(getLocationDiv(E.location));return D}function getSupplierDiv(C){var B=document.createElement("DIV");B.id="supplier";var D=document.createElement("DIV");var A=document.createElement("DIV");A.id="text";A.appendChild(document.createTextNode(C.title));D.id=C.htmlClass;D.appendChild(A);B.appendChild(D);return B}function Fieldset(){this.id="";this.content=document.createElement("DIV");this.content.id="form-content";this.title="Title";this.getFieldset=function(){var C=document.createElement("DIV");C.id=this.id;var A=document.createElement("DIV");A.id="fieldset";var B=document.createElement("DIV");B.id="legend";B.appendChild(document.createTextNode(this.title));A.appendChild(B);A.appendChild(this.content);C.appendChild(A);return C}}function NotesWidget(){this.id="";this.content=document.createElement("DIV");this.content.id="notes";this.notes=Array();this.add=function(A){this.notes[this.notes.length]=A};this.getWidget=function(){var A=document.createElement("DIV");A.id=this.id;for(y=0;y<this.notes.length;y++){this.content.appendChild(this.notes[y])}A.appendChild(this.content);return A}}function getCategoryDiv(F){var E="";var H="";var D="";switch(F.charAt(0)){case"M":E="small";break;case"N":E="small";break;case"E":E="small";break;case"H":E="small";break;case"C":E="small";break;case"D":E="small";break;case"I":E="standard";break;case"J":E="standard";break;case"S":E="standard";break;case"R":E="standard";break;case"F":E="standard";break;case"G":E="standard";break;case"P":E="premium";break;case"U":E="premium";break;case"L":E="premium";break;case"W":E="premium";break;case"O":E="premium";break;case"S":E="premium";break}switch(F.charAt(1)){case"S":E="sport";break;case"T":E="sport";break;case"E":E="sport";break;case"N":E="sport";break;case"F":E="suv";break;case"J":E="suv";break;case"R":E="suv";break;case"L":E="premium";break;case"X":E="premium";break;case"R":E="standard";break}var G=document.createElement("DIV");var C=document.createElement("DIV");var A=document.createElement("DIV");var B=document.createElement("DIV");G.appendChild(C);C.appendChild(A);C.appendChild(B);G.id="category";C.id=E;A.id="description";A.appendChild(document.createTextNode(getCategoryDescription(E)));B.id="type";B.appendChild(document.createTextNode(SIPP_TYPE[F.charAt(1)]));return G}function GoogleAnalytics(){this.log=function(A){if(typeof (_uacct)!="undefined"){urchinTracker("/_accelerate_/"+A)}else{if(typeof (pageTracker)!="undefined"){pageTracker._trackPageview("/_accelerate_/booking/"+A);pageTracker._trackEvent("Accelerate Booking",A)}else{}}};this.logRate=function(A){if(typeof (_uacct)!="undefined"){urchinTracker("/_accelerate_/rate/"+A)}else{if(typeof (pageTracker)!="undefined"){pageTracker._trackEvent("Accelerate Booking - Rates",A)}else{}}};this.logError=function(A){if(typeof (pageTracker)!="undefined"){pageTracker._trackEvent("Accelerate Booking - Error",A)}};this.load=function(){if(typeof (_uacct)!="undefined"){}};this.transact=function(C){if(typeof (_uacct)!="undefined"){var A=document.createElement("FORM");attr=document.createAttribute("style");attr.nodeValue="display:none";A.setAttributeNode(attr);A.name="utmform";var B=document.createElement("TEXTAREA");B.id="utmtrans";B.appendChild(document.createTextNode("UTM:T|"+C.reservationId+"|"+C.affiliateCode+"|"+C.total+"|"+C.tax+"|"+C.shipping+"|"+C.city+"|"+C.state+"|"+C.country+"  UTM:I|"+C.reservationId+"|"+C.sippCode+"|"+C.vehicleName+"|"+C.vehicleCategory+"|"+C.total+"|1"));A.appendChild(B);createContentDiv().appendChild(A);__utmSetTrans()}else{if(typeof (pageTracker)!="undefined"){pageTracker._addTrans(C.reservationId,C.affiliateCode,C.total,C.tax,C.shipping,C.city,C.state,C.country);pageTracker._addItem(C.reservationId,C.sippCode,C.vehicleName,C.vehicleCategory,C.total,"1");pageTracker._trackTrans()}}}}function ErrorMessage(){this.errorMessage=new DHTML_modalMessage();this.errorMessage.setShadowOffset(5);this.errorMessage.setSize(200,100);this.show=function(){this.errorMessage.display()};this.hide=function(){this.errorMessage.close()};this.close=function(){this.errorMessage.close()};this.setMessage=function(A){this.errorMessage.setHtmlContent(A+"<button onclick='errorMessage.close();return false'>close</button>")};this.setMessageByStatus=function(A){analytics.log("error.message."+A);this.errorMessage.setHtmlContent(ERROR_MSG[A]+"<button onclick='errorMessage.close();return false'>close</button>")}}function WaitMessage(){var A=document.createElement("DIV");A.id="wait";var B=document.createElement("DIV");B.id="message";var C=document.createElement("DIV");C.id="loader";A.appendChild(C);A.appendChild(B);this.mainDivId="";this.contentDivId="";this.Timer=new TimerWidget();this.setTimerText=function(E,D){this.Timer.setTimerText(E);this.Timer.setTimerFinishedText(D)};this.attachTimer=function(){A.appendChild(this.Timer.getWidget());this.Timer.startTimer()};this.show=function(){this.hideContentDiv();stepInfoWidget.clear();document.getElementById(this.mainDivId).appendChild(A)};this.hide=function(){if(document.getElementById("timer")){document.getElementById("wait").removeChild(document.getElementById("timer"))}if(document.getElementById("wait")){document.getElementById(this.mainDivId).removeChild(document.getElementById("wait"))}this.showContentDiv()};this.setMessage=function(D){scrollTo(0,0);this.clearMessage();B.appendChild(document.createTextNode(D));this.show()};this.hideContentDiv=function(){document.getElementById(this.contentDivId).style.display="none"};this.showContentDiv=function(){document.getElementById(this.contentDivId).style.display="inline"};this.clearContentDiv=function(){while(document.getElementById(this.contentDivId).firstChild){document.getElementById(this.contentDivId).removeChild(document.getElementById(this.contentDivId).firstChild)}};this.clearMessage=function(){while(B.firstChild){B.removeChild(B.firstChild)}this.Timer=new TimerWidget()}}function objectifyFlatCountryLocations(B){var C=B.split("<>");var A=new Object;A.locations=objectifyFlatLocations(C[0]);A.locationLinks=objectifyFlatLocationItems(C[1]);return A}function objectifyFlatCountries(B){var A=new Array();var C=B.split("|");for(x=0;x<C.length;x++){var D=C[x].split(":");A[x]=new Object;A[x].countryCode=D[0];A[x].name=D[1]}return A}function objectifyFlatLocations(C){var B=new Array();var E=C.split("|");for(x=0;x<E.length;x++){if(E[x].indexOf(":")>0){var D=E[x].split("%");B[x]=new Object;B[x].regionCode=D[0];var F=D[1].split(":");if(F[0].charAt(0)=="a"){F[0]=F[0].substring(1);B[x].isAirport=true}else{B[x].isAirport=false}if(F[0].charAt(0)=="p"){F[0]=F[0].substring(1);B[x].isPriority=true}else{B[x].isPriority=false}B[x].cityId=F[0];B[x].locationId=F[0];if(F[1].indexOf("#")>0){var A=F[1].split("#");F[1]=A[0];B[x].iata=A[1];B[x].locationId=F[0]+A[1]}if(B[x].regionCode!=null&&B[x].regionCode!=""){B[x].name=F[1]+", "+B[x].regionCode}else{B[x].name=F[1]}if(B[x].iata!=null){B[x].name=B[x].name+" ("+B[x].iata+")"}}}return B}function objectifyFlatLocationItems(C){var A=new Array();var D=C.split("|");for(x=0;x<D.length;x++){var B=D[x].split(":");A[x]=new Object;A[x].locationId=B[0];A[x].supplierId=B[1]}return A}function sortByPriceCheapest(A){return A.sort(sortByPriceCheapestCallBack)}function sortByPriceCheapestCallBack(B,A){return B.rate-A.rate}function sortByPriceDearest(A){}function filterCompactEconomy(A){var B=new Array();for(x=0;x<A.length;x++){rate=A[x];sippVal=rate.supplierVehicle.sippCode;if(sippVal.charAt(0)=="M"||sippVal.charAt(0)=="N"||sippVal.charAt(0)=="E"||sippVal.charAt(0)=="H"||sippVal.charAt(0)=="C"||sippVal.charAt(0)=="D"){B[B.length]=rate}}return B}function filterFullsizeIntermediate(A){var B=new Array();for(x=0;x<A.length;x++){rate=A[x];sippVal=rate.supplierVehicle.sippCode;if(sippVal.charAt(0)=="F"||sippVal.charAt(0)=="G"||sippVal.charAt(0)=="I"||sippVal.charAt(0)=="J"||sippVal.charAt(0)=="S"||sippVal.charAt(0)=="R"){B[B.length]=rate}}return B}function filterPremiumLuxury(A){var B=new Array();for(x=0;x<A.length;x++){rate=A[x];sippVal=rate.supplierVehicle.sippCode;if(sippVal.charAt(0)=="P"||sippVal.charAt(0)=="U"||sippVal.charAt(0)=="L"||sippVal.charAt(0)=="W"||sippVal.charAt(0)=="X"||sippVal.charAt(1)=="X"||sippVal.charAt(1)=="L"){B[B.length]=rate}}return B}function filter4wdSuv(A){var B=new Array();for(x=0;x<A.length;x++){rate=A[x];sippVal=rate.supplierVehicle.sippCode;if(sippVal.charAt(1)=="F"||sippVal.charAt(2)=="N"||sippVal.charAt(2)=="B"){B[B.length]=rate}}return B}function filterSportConvertible(A){var B=new Array();for(x=0;x<A.length;x++){rate=A[x];sippVal=rate.supplierVehicle.sippCode;if(sippVal.charAt(1)=="T"||sippVal.charAt(1)=="N"||sippVal.charAt(1)=="X"||sippVal.charAt(1)=="S"||sippVal.charAt(1)=="E"){B[B.length]=rate}}return B}function filterAllCommercial(A){var B=new Array();for(x=0;x<A.length;x++){rate=A[x];sippVal=rate.supplierVehicle.sippCode;if(sippVal.charAt(1)=="V"||sippVal.charAt(1)=="K"||sippVal.charAt(1)=="P"||sippVal.charAt(1)=="Q"){B[B.length]=rate}}return B}function filterAllPassenger(A){var B=new Array();for(x=0;x<A.length;x++){rate=A[x];sippVal=rate.supplierVehicle.sippCode;if(sippVal.charAt(1)!="K"){B[B.length]=rate}}return B}function filterMovingVan(A){var B=new Array();for(x=0;x<A.length;x++){rate=A[x];sippVal=rate.supplierVehicle.sippCode;if(sippVal.charAt(1)=="K"){B[B.length]=rate}}return B}function filterUtility(A){var B=new Array();for(x=0;x<A.length;x++){rate=A[x];sippVal=rate.supplierVehicle.sippCode;if(sippVal.charAt(1)=="P"||sippVal.charAt(1)=="Q"){B[B.length]=rate}}return B}function filterPassengerVan(A){var B=new Array();for(x=0;x<A.length;x++){rate=A[x];sippVal=rate.supplierVehicle.sippCode;if(sippVal.charAt(1)=="V"){B[B.length]=rate}}return B}function getCategoryDescription(A){switch(A){case"small":return"Small";break;case"standard":return"Standard";break;case"premium":return"Premium";break;case"sport":return"Sport/Special";break;case"suv":return"4WD/SUV";break}}function getDateString(A){return formatDate(A,"NNN d, y (EE)")}function getDuration(B){var A=B.duration.days+" Days";if(B.duration.hours>0){A=A+" "+B.duration.hours+" Hours"}return A}function getTimeString(A){return formatDate(A,"hh:mm a")}function getDepot(A){return A.name+" ("+A.code+")"}function getConfirmationNoteMessage(A){return replace(NOTE_TEXT.ConfirmationNote,"[supplier]",A.supplier.title)}function getPaymentNote(){return getNote("payment",TITLE_TEXT.PaymentNote,NOTE_TEXT.PaymentNote)}function getSecurityNote(){if("https:"==document.location.protocol){return getNote("security",TITLE_TEXT.SecurityNoteSSL,NOTE_TEXT.SecurityNoteSSL)}else{return getNote("security",TITLE_TEXT.SecurityNote,NOTE_TEXT.SecurityNote)}}function getSupplierVehicleDescription(A){var B=A.supplierTitle+" ("+String(A.doors)+" Door ";if(A.transmission=="automatic"){B+=" Automatic)"}else{B+=" Manual)"}return B}function getVehicleDescription(B){var A="";A+=B.make+" "+B.model+" "+String(B.engineSize)+" Litre (Or Similar)";return A}function getDamageLiabilityText(H,M){var L=document.createElement("DIV");H.code="";if(M.regularExcess!=null&&M.regularExcess>0){L.appendChild(document.createTextNode("Standard excess is "));var K=document.createElement("SPAN");K.appendChild(document.createTextNode(H.symbol+M.regularExcess));L.appendChild(K);if(M.specialityExcess!=null&&M.specialityExcess>0){L.appendChild(document.createTextNode(" or "));var I=document.createElement("SPAN");I.appendChild(document.createTextNode(H.symbol+M.specialityExcess));L.appendChild(I);L.appendChild(document.createTextNode(" for special vehicles"));var J=document.createElement("SUP");J.appendChild(document.createTextNode("\u2020"));L.appendChild(J)}L.appendChild(document.createTextNode(". "));var F=document.createElement("BR")}else{if(M.specialityExcess!=null&&M.specialityExcess>0){L.appendChild(document.createTextNode("Excess for special vehicles is "));var I=document.createElement("SPAN");I.appendChild(document.createTextNode(H.symbol+M.specialityExcess));L.appendChild(I);L.appendChild(document.createTextNode(". "));var F=document.createElement("BR")}}if(M.maximumDailyCharge>0&&M.minimumDailyCharge>0&&M.maximumDailyCharge!=M.minimumDailyCharge){L.appendChild(document.createTextNode("Excess reduction is available from "));var A=document.createElement("SPAN");A.appendChild(document.createTextNode(H.symbol+parseFloat(M.minimumDailyCharge).toFixed(2)));L.appendChild(A);L.appendChild(document.createTextNode(" to "));var C=document.createElement("SPAN");C.appendChild(document.createTextNode(H.symbol+parseFloat(M.maximumDailyCharge).toFixed(2)));L.appendChild(C);L.appendChild(document.createTextNode(" per day, and may vary depending on vehicle and level of coverage.  "));var E=document.createElement("BR");L.appendChild(E)}else{if(M.maximumDailyCharge==null||M.maximumDailyCharge==0||M.maximumDailyCharge==M.minimumDailyCharge){L.appendChild(document.createTextNode("Excess reduction is available from "));var A=document.createElement("SPAN");A.appendChild(document.createTextNode(H.symbol+parseFloat(M.minimumDailyCharge).toFixed(2)));L.appendChild(A);L.appendChild(document.createTextNode(" per day, and may vary depending on vehicle and level of coverage.  "));var D=document.createElement("BR");L.appendChild(D)}}L.appendChild(document.createTextNode("The best level of coverage reduces your liability to "));var G=document.createElement("SPAN");G.appendChild(document.createTextNode(H.symbol+M.minimumExcess));L.appendChild(G);L.appendChild(document.createTextNode(" and is only available for standard vehicles.  "));var B=document.createElement("BR");return L}function getDistanceRestrictionText(A,B){if(B.unlimited){return"This rental comes with unlimited "+B.unit.toLowerCase()+"s."}else{if(B==null){return""}else{if(B.distance==0&&(B.distanceCharge==0||B.distanceCharge==null)){return""}else{if(B.distance==-1){return"This rental comes with unlimited "+B.unit.toLowerCase()+"s."}else{var C="";C="This rental comes with "+B.distance+" "+B.unit.toLowerCase()+"s included.";if(B.distanceCharge>0){C=C+" Any extra "+B.unit.toLowerCase()+"s will be charged at "+A.currencyCode+A.symbol+B.distanceCharge.toFixed(2)+" per "+B.unit.toLowerCase()+"."}return C}}}}}function replace(C,B,A){i=C.indexOf(B);r="";if(i==-1){return C}r+=C.substring(0,i)+A;if(i+B.length<C.length){r+=replace(C.substring(i+B.length,C.length),B,A)}return r}function getTermsDiv(U){var L=document.createElement("DIV");L.id="terms";termsTitleDiv=document.createElement("DIV");termsTitleDiv.id="title";termsTitleDiv.appendChild(document.createTextNode("Terms And Conditions"));L.appendChild(termsTitleDiv);L.appendChild(document.createTextNode("This quote includes:"));var p=document.createElement("UL");var e=document.createElement("LI");e.appendChild(document.createTextNode("All registration and administration fees"));p.appendChild(e);var b=document.createElement("LI");b.appendChild(document.createTextNode("Local taxes (GST, VAT, etc..)"));p.appendChild(b);var a=document.createElement("LI");a.appendChild(document.createTextNode("Damage liability cover (subject to excess)"));p.appendChild(a);var Y=document.createElement("LI");Y.appendChild(document.createTextNode("All airport and premium location fees (if applicable)"));p.appendChild(Y);var X=document.createElement("LI");X.appendChild(document.createTextNode("One-way rental fees (if applicable)"));p.appendChild(X);var W=document.createElement("LI");W.appendChild(document.createTextNode("Unlimited kilometres/mileage, unless otherwise stated"));p.appendChild(W);L.appendChild(p);L.appendChild(document.createTextNode("The following are not included in the Total Estimate:"));var o=document.createElement("UL");var C=document.createElement("LI");C.appendChild(document.createTextNode("Credit Card Surcharges (ie; for Europcar rentals there is a 1.65% mandatory credit card surcharge)."));o.appendChild(C);var H=document.createElement("LI");H.appendChild(document.createTextNode("Age surcharge (except when indicated in the quote description)."));o.appendChild(H);var F=document.createElement("LI");F.appendChild(document.createTextNode("Damage Excess and reduction amounts"));o.appendChild(F);var D=document.createElement("LI");D.appendChild(document.createTextNode("Any additional kilometeres/mileage charges, where kilometeres/mileage is not unlimited"));o.appendChild(D);L.appendChild(o);L.appendChild(document.createTextNode("The following optional extras may be purchased when you collect your vehicle:"));var n=document.createElement("UL");var j=document.createElement("LI");j.appendChild(document.createTextNode("Additional authorised drivers"));n.appendChild(j);var h=document.createElement("LI");h.appendChild(document.createTextNode("Child seats, subject to availability"));n.appendChild(h);var f=document.createElement("LI");f.appendChild(document.createTextNode("GPS rental, subject to availability"));n.appendChild(f);var c=document.createElement("LI");c.appendChild(document.createTextNode("Damage Excess reduction"));n.appendChild(c);L.appendChild(n);U.currency.code="";if(U.damageLiability.regularExcess!=null&&U.damageLiability.regularExcess>0){L.appendChild(document.createTextNode("Standard excess is "));L.appendChild(document.createTextNode(U.currency.symbol+U.damageLiability.regularExcess))}if(U.damageLiability.specialityExcess!=null&&U.damageLiability.specialityExcess>0){L.appendChild(document.createTextNode(" or "));L.appendChild(document.createTextNode(U.currency.symbol+U.damageLiability.specialityExcess));L.appendChild(document.createTextNode(" for special vehicles"));L.appendChild(document.createTextNode(". "));var l=document.createElement("BR");L.appendChild(l)}else{if(U.damageLiability.specialityExcess!=null&&U.damageLiability.specialityExcess>0){L.appendChild(document.createTextNode("Excess for special vehicles is "));L.appendChild(document.createTextNode(U.currency.symbol+U.damageLiability.specialityExcess));L.appendChild(document.createTextNode(". "));var Z=document.createElement("BR");L.appendChild(Z)}}if(U.damageLiability.maximumDailyCharge>0&&U.damageLiability.minimumDailyCharge>0&&U.damageLiability.maximumDailyCharge!=U.damageLiability.minimumDailyCharge){L.appendChild(document.createTextNode("Excess reduction is available from "));L.appendChild(document.createTextNode(U.currency.symbol+parseFloat(U.damageLiability.minimumDailyCharge).toFixed(2)));L.appendChild(document.createTextNode(" to "));L.appendChild(document.createTextNode(U.currency.symbol+parseFloat(U.damageLiability.maximumDailyCharge).toFixed(2)));L.appendChild(document.createTextNode(" per day, and may vary depending on vehicle and level of coverage.  "));var S=document.createElement("BR");L.appendChild(S)}else{if(U.damageLiability.maximumDailyCharge==null||U.damageLiability.maximumDailyCharge==0||U.damageLiability.maximumDailyCharge==U.damageLiability.minimumDailyCharge){L.appendChild(document.createTextNode("Excess reduction is available from "));L.appendChild(document.createTextNode(U.currency.symbol+parseFloat(U.damageLiability.minimumDailyCharge).toFixed(2)));L.appendChild(document.createTextNode(" per day, and may vary depending on vehicle and level of coverage.  "));var R=document.createElement("BR");L.appendChild(R)}}L.appendChild(document.createTextNode("The best level of coverage reduces your liability to "));L.appendChild(document.createTextNode(U.currency.symbol+U.damageLiability.minimumExcess));L.appendChild(document.createTextNode(" and is only available for standard vehicles.  "));var Q=document.createElement("BR");L.appendChild(document.createTextNode("Special vehicles generally includes 4WD vehicles, large commercial vehicles and prestige/sports vehicles."));var O=document.createElement("BR");L.appendChild(O);var T=document.createElement("BR");L.appendChild(T);L.appendChild(document.createTextNode("All extras are subject to additional charges and taxes ."));var P=document.createElement("BR");L.appendChild(P);L.appendChild(document.createTextNode("Vehicle descriptions and images are indicative only and may not always be the exact vehicle you are given on pick-up."));var N=document.createElement("BR");L.appendChild(N);var M=document.createElement("BR");L.appendChild(M);L.appendChild(document.createTextNode("For complete terms and conditions of the rental, please use the following links below to view the car rental companys terms."));var m=document.createElement("UL");var K=document.createElement("LI");var V=document.createElement("A");V.setAttribute("href","http://www.europcar.com.au/renter-guide/terms-and-conditions.aspx");V.appendChild(document.createTextNode("Europcar terms and conditions"));V.setAttribute("target","_blank");K.appendChild(V);m.appendChild(K);var J=document.createElement("LI");var A=document.createElement("A");A.setAttribute("href","https://www.hertz.com/rentacar/byr/index.jsp?targetPage=locationTab.jsp&leftNavUserSelection=globNav_3_4&defaultTab=3");A.appendChild(document.createTextNode("Hertz terms and conditions"));A.setAttribute("target","_blank");J.appendChild(A);m.appendChild(J);var I=document.createElement("LI");var g=document.createElement("A");g.setAttribute("href","http://www.avis.com/car-rental/content/faq.ac?navId=T5M15S00");g.appendChild(document.createTextNode("Avis terms and conditions"));g.setAttribute("target","_blank");I.appendChild(g);m.appendChild(I);var G=document.createElement("LI");var k=document.createElement("A");k.setAttribute("href","http://www.budget.com.au/reservations/rental_terms__conditions/default.aspx");k.appendChild(document.createTextNode("Budget terms and conditions"));k.setAttribute("target","_blank");G.appendChild(k);m.appendChild(G);var E=document.createElement("LI");var B=document.createElement("A");B.setAttribute("href","http://www.thrifty.com.au/terms-and-conditions.php.htm");B.appendChild(document.createTextNode("Thrifty terms and conditions"));B.setAttribute("target","_blank");E.appendChild(B);m.appendChild(E);L.appendChild(m);return L}var CHARGE_TITLE={airportSurcharge:"Airport Surcharge",premiumLocatonSurcharge:"Premium Location Fee",relocationFee:"Relocation Fee",registrationRecoveryFee:"Registration Recovery",localTaxes:"Local Tax",otherCharges:"Other Charges",coverages:"Coverages",options:"Optional Extras",totalTk:"Base Price",total:"Total",adminFee:"Admin Fees",vehicleLicenceFee:"Vehicle Licence Fees"};var ERROR_MSG={UnknownError:"An unknown error has occured.",SessionExpired:"Your Session has expired.",SystemError:"A system error has occured.",BirthDateNotSet:"The renter birth date is not set, please make sure you select a birth date before continuing.",RenterAgeNotSet:"The renter age is not set, please make sure you select the age of the renter before continuing.",PickupAndReturnDatesOverlap:"The return date you have entered is before the pickup date.",PickupDateNotSet:"Please make sure you have entered a pickup date.",ReturnDateNotSet:"Please make sure you have entered a return date.",PickupLocationNotSet:"Please make sure you have selected a pickup location.",ReturnLocationNotSet:"Please make sure you have selected a return location.",NoRatesFound:"No available vehicles were found. This may be because all vehicles are booked. Maybe try entering different dates or a different location.",RequiredFieldsNotSet:"Please make sure you have entered a value for all required fields.",PickupDateHasPassed:"The pickup date you entered has passed.",FirstNameNotSet:"Please make sure you have entered a first name before continuing.",LastNameNotSet:"Please make sure you have entered a last name before continuing.",FlightDetailsNotSet:"Please make sure you have entered your flight details. If you do not know your flight details or do not have any, please select 'I don't know'.",CreditCardDetailsNotSet:"Please make sure you have entered your credit card details.",CreditCardExpiryDatePassed:"The credit card expiry date you have entered is expired or will expire before the end of the rental.",EmailAddressNotSet:"Please make sure you have entered an email address.",EmailAddressNotMatch:"Your email address doesn't match the email address in the retype email field.",EmailAddressInvalid:"The email address you have entered is invalid, please check it and try again.",ContactPhoneNumberNotSet:"Please make sure you have entered a contact phone number.",ReservationNotCreated:"The reservation could not be created.",FlightNumberInvalid:"The flight number you entered is invalid, if you do not know your flight details or do not have any, please select 'I don't know'.",EmailAddressInvalid:"The email address you have entered is invalid."};var GENERAL_MSG={Continue:"Continue",LoadingPrompt:"Please wait"};var NOTE_TEXT={ConfirmationNote:"Thank you for booking a vehicle with [supplier]. Your reservation has been successful. Please quote the Confirmation code when you pick up the vehicle. Payment will be received at the time of picking up your vehicle.",PaymentNote:"Payment for this rental is made when you pick up your vehicle. No booking fees will apply and you can cancel anytime at no cost.",SecurityNote:"We do not use your personal details for anything other than this reservation. All your information is secure, and we do not ask for any Credit Card details.",SecurityNoteSSL:"Your privacy is ensured by Secure Socket Layer Encryption. None of your personal details can be seen by any third party, and we do not distribute your details to anyone other than the car rental company you book your vehicle with.",AvailabilityNote:'Please note that availability is shown with "Available" indicating that the availability is confirmed or "On-Request" which indicates that your vehicle will need to be confirmed once booked. For an "On-Request" booking you will be notified within 48 hours whether or not your requested vehicle is Available. '};var TITLE_TEXT={Calendar:"cal",ConfirmationCode:"Confirmation Code",Country:"Country",City:"City",Region:"Region",SupplierLocationAddress:"Address",SupplierLocationName:"Depot",SupplierLocationCode:"Location Code",VehicleMake:"Make",VehicleModel:"Model",VehicleDoors:"Doors",Litres:"Litres",VehicleEngineSize:"Engine Size",DamageLiability:"Damage Cover",DistanceRestrictions:"Included Mileage",PickupLocation:"Pickup",ReturnLocation:"Return",Vehicle:"Vehicle",ConfirmationNote:"Booking Confirmed",PaymentNote:"No Immediate Payment Required",SecurityNote:"Safe and Secure",SecurityNoteSSL:"SSL Encryption is Enabled",AvailabilityNote:"Availability",PickupDate:"Pickup",ReturnDate:"Return",RenterAge:"Driver Age",RenterCountry:"I Live in",PickupCountry:"Country",Location:"Location",LocationSectionTitle:"Locations",DatesSectionTitle:"Dates",RenterSectionTitle:"Renter Details",OrSimilar:"or similar",Date:"Date"};var FIELDSET_TITLE_TEXT={Confirmation:"Booking Confirmation",Itinerary:"Pickup & Return Details",ItineraryDisplay:"Booking Details",Quote:"Total Price",Pricing:"Pricing Information",Rates:"Rates & Availability",RenterDetails:"Renter Details"};var WAIT_TEXT={Loading:"Please wait",Searching:"Searching for Rates, please wait...",Quote:"Generating Quote, please wait...",Booking:"Submitting your Booking, please wait..."};var BUTTON_TEXT={Modify:"Modify",Search:"Search",SelectRate:"SELECT",Book:"BOOK NOW"};var STAGE_TEXT={StageOne:"Search",StageTwo:"Choose",StageThree:"Book",StageFour:"Confirmed"};var SIPP_CATEGORY={M:"Mini",N:"Mini Elite",E:"Economy",H:"Economy Elite",C:"Compact",D:"Compact Elite",I:"Intermediate",J:"Intermediate Elite",S:"Standard",R:"Standard Elite",F:"Fullsize",G:"Fullsize Elite",P:"Premium",U:"Premium Elite",L:"Luxury",W:"Luxury Elite",O:"Oversize",X:"Special"};var SIPP_TYPE={B:"2/3 Door",C:"2/4 Door",D:"4/5 Door",W:"Wagon/Estate",V:"Passenger Van",L:"Limousine",S:"Sport",T:"Convertible",F:"SUV",J:"All Terrain",X:"Special",P:"Pickup/Ute",Q:"Pickup/Ute Large Cab",Z:"Special Offer",E:"Coupe",M:"Monospace",R:"Recreational Vehicle",H:"Motor Home",Y:"2 Wheel Vehicle",N:"Roadster",G:"Crossover",K:"Commercial Van/Truck"};var SIPP_TRANSMISSION={M:"Manual",N:"Manual",C:"Manual",A:"Automatic",B:"Automatic",D:"Automatic"};var SIPP_DRIVE={M:"",N:"4WD",C:"AWD",A:"",B:"4WD",D:"AWD"};var SIPP_FUEL={R:"",N:"",D:"Diesel",Q:"Diesel",H:"Hybrid",I:"Hybrid",E:"Electric",C:"Electric",L:"LPG",S:"LPG",A:"Hydrogen",B:"Hydrogen",M:"Multi Fuel",F:"Multi Fuel",V:"Petrol",Z:"Petrol",U:"Ethanol",X:"Ethanol"};var SIPP_AIRCON={R:"Aircon",N:"",D:"Aircon",Q:"",H:"Aircon",I:"",E:"Aircon",C:"",L:"Aircon",S:"",A:"Aircon",B:"",M:"Aircon",F:"",V:"Aircon",Z:"",U:"Aircon",X:""};function loadItinerary(A,B,E,C,H,I,D){rates=null;quote=null;airlines=null;analytics.log("display.intinerary");analytics.log("display.intinerary."+accelerate.product.toLowerCase());var G;progressWidget.setStage(1);stepInfoWidget.setStage(1);setStep("step-one");if(getBookingDiv()){G=getBookingDiv()}else{G=getContentDiv();resetMainDiv()}itineraryWidget=new ItineraryWidget();itineraryWidget.continueButton.onclick=function(){submitItinerary()};itineraryWidget.continueButtonImage.onclick=function(){submitItinerary()};itineraryWidget.populateRenterCountries(D);var F={sessionId:session.sessionId};itineraryWidget.resetDates();Booking.getCountries(F,function(L){itineraryWidget.populateCountries(L.countries);itineraryWidget.render();G.appendChild(itineraryWidget.getDiv());if(E!=null){itineraryWidget.setPickupDate(E)}if(C!=null){itineraryWidget.setReturnDate(C)}if(H!=null){itineraryWidget.setRenterAge(H)}else{itineraryWidget.setRenterAge("25")}if(I!=null){itineraryWidget.setRenterCountryCode(I)}else{if(accelerate.renterCountryCode!=null){itineraryWidget.setRenterCountryCode(accelerate.renterCountryCode)}}if(A!=null){if(B!=null){var J=A.locationId;var K=B.locationId;if(A.iata!=null){J=J+A.iata}if(B.iata!=null){K=K+B.iata}itineraryWidget.setPickupAndReturn(A.countryRegion.country.countryCode,J,K)}}else{if(session.pickupLocationId!=null&&session.returnLocationId!=null&session.pickupCountryCode!=null){itineraryWidget.setPickupAndReturn(session.pickupCountryCode,session.pickupLocationId,session.returnLocationId)}else{if(accelerate.pickupLocationName!=null&&accelerate.pickupCountryCode!=null){itineraryWidget.setPickupAndReturn(accelerate.pickupCountryCode,accelerate.pickupLocationName,accelerate.pickupLocationName)}}}});session.step="1";hashListener.setStep("1")}function loadRates(C,F,E,D,B){analytics.log("display.rates");analytics.log("display.rates."+accelerate.product.toLowerCase());resetMainDiv();progressWidget.setStage(2);stepInfoWidget.setStage(2);setStep("step-two");itineraryDisplayWidget=new ItineraryDisplayWidget();itineraryDisplayWidget.pickupLocation=F;itineraryDisplayWidget.returnLocation=E;itineraryDisplayWidget.pickupDate=D;itineraryDisplayWidget.returnDate=B;itineraryDisplayWidget.displayType=itineraryDisplayWidget.LOCATION_DISPLAY;itineraryDisplayWidget.build();var A=new RatesWidget();getContentDiv().appendChild(itineraryDisplayWidget.getWidget());A.setRate(C);A.build();getContentDiv().appendChild(A.getWidget());waitMessage.hide();session.step="2";hashListener.setStep("2");scrollTo(0,0)}function loadQuote(B,C,H,F,E,A,D,G){analytics.log("display.quote");resetMainDiv();progressWidget.setStage(3);stepInfoWidget.setStage(3);setStep("step-three");itineraryDisplayWidget=new ItineraryDisplayWidget();itineraryDisplayWidget.pickupSupplierLocation=H;itineraryDisplayWidget.returnSupplierLocation=F;itineraryDisplayWidget.pickupDate=E;itineraryDisplayWidget.returnDate=A;itineraryDisplayWidget.supplierVehicle=C.supplierVehicle;itineraryDisplayWidget.rate=C;itineraryDisplayWidget.displayType=itineraryDisplayWidget.SUPPLIER_LOCATION_AND_VEHICLE_DISPLAY;itineraryDisplayWidget.build();quoteWidget=new QuoteWidget(B);renterDetailsWidget=new RenterDetailsWidget(B,D,G);renterDetailsWidget.continueButton.onclick=function(){submitRenterDetails()};renterDetailsWidget.continueButtonImage.onclick=function(){submitRenterDetails()};getContentDiv().appendChild(itineraryDisplayWidget.getWidget());getContentDiv().appendChild(quoteWidget.getWidget());getContentDiv().appendChild(renterDetailsWidget.getWidget());scrollTo(0,0);waitMessage.hide();session.step="3";hashListener.setStep("3")}function loadConfirmation(F,B,D,H,G,E,A){analytics.log("display.confirmation");resetMainDiv();progressWidget.setStage(4);stepInfoWidget.setStage(4);setStep("step-four");var C=new ConfirmationWidget();C.confirmation=F;C.build();itineraryDisplayWidget=new ItineraryDisplayWidget();itineraryDisplayWidget.pickupSupplierLocation=H;itineraryDisplayWidget.returnSupplierLocation=G;itineraryDisplayWidget.pickupDate=E;itineraryDisplayWidget.returnDate=A;itineraryDisplayWidget.rate=D;itineraryDisplayWidget.displayType=itineraryDisplayWidget.SUPPLIER_LOCATION_AND_VEHICLE_DISPLAY;itineraryDisplayWidget.allowModify=false;itineraryDisplayWidget.build();pricingWidget=new PricingWidget(B);getContentDiv().appendChild(C.getWidget());getContentDiv().appendChild(itineraryDisplayWidget.getWidget());scrollTo(0,0);waitMessage.hide();Booking.processConfirmations(function(I){analytics.log("process.confirmations")});session.step="4";hashListener.setStep("4");scrollTo(0,0)}function modifyItinerary(){session.loadItinerary();if(session.renterCountries===null){var A={sessionId:session.sessionId};Booking.getRenterCountries(A,function(B){session.renterCountries=B.countries;loadItinerary(session.pickupLocation,session.returnLocation,session.pickupDate,session.returnDate,session.renterAge,session.renterCountryCode,session.renterCountries)})}else{loadItinerary(session.pickupLocation,session.returnLocation,session.pickupDate,session.returnDate,session.renterAge,session.renterCountryCode,session.renterCountries)}scrollTo(0,0)}function modifyRate(){session.loadRates();loadRates(session.rates,session.pickupLocation,session.returnLocation,session.pickupDate,session.returnDate);scrollTo(0,0)}function Session(){this.ACTION_RATES="#rates";this.ACTION_QUOTE="#quote";this.ACTION_ITINERARY="#itinerary";this.ACTION_CONFIRMATION="#confirmation";this.step=null;this.vehicleType=null;this.rates=null;this.quote=null;this.cardTypes=null;this.airlines=null;this.sessionId=null;this.pickupLocation=null;this.returnLocation=null;this.pickupCountryCode=null;this.supplierPickupLocation=null;this.supplierReturnLocation=null;this.vehicle=null;this.pickupDate=null;this.returnDate=null;this.renterBdate=null;this.pickupLocationId=null;this.returnLocationId=null;this.rate=null;this.renterCountries=null;this.renterAge=null;this.renterFirst=null;this.renterLast=null;this.rateId=null;this.renterCountryCode=null;this.pickupIata=null;this.returnIata=null;this.pickupOnAirport=false;this.returnOnAirport=false;this.loadItinerary=function(){this.rates=null;this.quote=null;this.cardTypes=null;this.airlines=null;this.vehicle=null;this.loadRates()};this.loadRates=function(){this.rate=null};this.hasItineraryVars=function(){if(session.pickupLocationId==null||session.returnLocationId==null||session.pickupDate==null||session.returnDate==null||(session.renterAge==null&&session.renterBdate==null)||session.renterCountryCode==null){return false}else{return true}}}function submitRate(A){waitMessage.setMessage(WAIT_TEXT.Quote);session.rate=A;var B={sessionId:session.sessionId,sessionRateId:A.sessionRateId};Booking.submitRateGetQuote(B,function(C){session.airlines=C.airlines;session.cardTypes=C.cardTypes;session.quote=C.quote;session.supplierPickupLocation=C.supplierPickupLocation;session.supplierReturnLocation=C.supplierReturnLocation;if(!C.creditCardIsRequired){C.cardTypes=null}loadQuote(C.quote,session.rate,C.supplierPickupLocation,C.supplierReturnLocation,session.pickupDate,session.returnDate,C.airlines,C.cardTypes)})}function submitItinerary(){if(validateAndSaveItinerary()){if(accelerate.redirectUrl==null&&accelerate.forceHttps&&document.location.protocol!="https"){accelerate.redirectUrl="https://"+document.location.host+document.location.pathname}if(accelerate.redirectUrl!=null){if(accelerate.forceHttps){forceRedirectHttps()}var A="";A=A+"?plocid="+session.pickupLocationId;A=A+"&rlocid="+session.returnLocationId;if(session.pickupIata!=null){A=A+"&piata="+session.pickupIata}if(session.returnIata!=null){A=A+"&riata="+session.returnIata}A=A+"&pdate="+formatDate(session.pickupDate,"MMddyyyyhhmmssa");A=A+"&rdate="+formatDate(session.returnDate,"MMddyyyyhhmmssa");A=A+"&rntcountry="+session.renterCountryCode;A=A+"&pcountry="+session.pickupCountryCode;A=A+"&rntbdate="+formatDate(session.renterBdate,"MMddyyyyhhmmssa");A=A+"&product="+accelerate.product;A=A+"&redirect=true";window.document.location.href=accelerate.redirectUrl+A}else{processGetRatesRequest()}}}function forceRedirectHttps(){if(!accelerate.redirectUrl.startsWith("https")){accelerate.redirectUrl=accelerate.redirectUrl.replace("http","https")}}function validateAndSaveItinerary(){var A=true;if(isNaN(itineraryWidget.getPickupLocationId())){errorMessage.setMessageByStatus("PickupLocationNotSet");errorMessage.show();waitMessage.hide();A=false}else{if(isNaN(itineraryWidget.getReturnLocationId())){errorMessage.setMessageByStatus("ReturnLocationNotSet");errorMessage.show();waitMessage.hide();A=false}else{if(isNaN(itineraryWidget.getRenterBirthDate())){errorMessage.setMessageByStatus("RenterAgeNotSet");errorMessage.show();waitMessage.hide();A=false}else{analytics.log("pickup.return."+itineraryWidget.getPickupLocationText()+"->"+itineraryWidget.getReturnLocationText());session.renterAge=itineraryWidget.getRenterAge();session.renterBdate=itineraryWidget.getRenterBirthDate();session.pickupDate=itineraryWidget.getPickupDate();session.pickupLocationId=Number(itineraryWidget.getPickupLocationId());session.pickupOnAirport=itineraryWidget.getPickupLocation().isAirport;session.pickupIata=itineraryWidget.getPickupLocation().iata;session.returnDate=itineraryWidget.getReturnDate();session.returnLocationId=Number(itineraryWidget.getReturnLocationId());session.returnOnAirport=itineraryWidget.getReturnLocation().isAirport;session.returnIata=itineraryWidget.getReturnLocation().iata;session.renterCountryCode=itineraryWidget.getRenterCountryCode();session.pickupCountryCode=itineraryWidget.getPickupCountryCode()}}}return A}function processGetRatesRequest(){analytics.log("submit.itinerary");analytics.log("submit.itinerary."+accelerate.product.toLowerCase());waitMessage.setMessage(WAIT_TEXT.Searching);waitMessage.setTimerText("Maximum wait time is less than [x] seconds.","Search Complete");waitMessage.Timer.TimerFunction="waitMessage.Timer";waitMessage.attachTimer();var A={sessionId:session.sessionId,birthDate:JSONdate(session.renterBdate),pickupDate:JSONdate(session.pickupDate),pickupLocationId:session.pickupLocationId,pickupOnAirport:session.pickupOnAirport,pickupIata:session.pickupIata,returnDate:JSONdate(session.returnDate),returnLocationId:session.returnLocationId,returnOnAirport:session.returnOnAirport,returnIata:session.returnIata,customerCountryCode:session.renterCountryCode};Booking.submitItineraryGetRates(A,function(B){processGetRatesResponse(B)})}function processGetRatesResponse(B){if(B.status=="Ok"){analytics.log("retrieve.rates");if(B.rates.length>0){var A=true;if(accelerate.product.toLowerCase()=="commercial"){if(filterAllCommercial(B.rates).length>0){B.rates=filterAllCommercial(B.rates)}else{A=false;errorMessage.setMessageByStatus("NoRatesFound");errorMessage.show();waitMessage.hide();modifyItinerary()}}else{if(accelerate.product.toLowerCase()=="passenger"){if(filterAllPassenger(B.rates).length>0){B.rates=filterAllPassenger(B.rates)}else{A=false;errorMessage.setMessageByStatus("NoRatesFound");errorMessage.show();waitMessage.hide();modifyItinerary()}}}if(A){session.rates=B.rates;session.pickupLocation=B.pickupLocation;session.returnLocation=B.returnLocation;loadRates(B.rates,session.pickupLocation,session.returnLocation,session.pickupDate,session.returnDate)}}else{if(accelerate.product.toLowerCase()=="commercial"){}errorMessage.setMessageByStatus("NoRatesFound");errorMessage.show();waitMessage.hide();modifyItinerary()}}else{if(accelerate.product.toLowerCase()=="commercial"){}errorMessage.setMessageByStatus(B.status);errorMessage.show();waitMessage.hide();modifyItinerary()}}function submitRenterDetails(){waitMessage.setMessage(WAIT_TEXT.Booking);var C=false;if(renterDetailsWidget.getFirstName()==""){errorMessage.setMessageByStatus("FirstNameNotSet");C=true}if(renterDetailsWidget.getLastName()==""){errorMessage.setMessageByStatus("LastNameNotSet");C=true}if(renterDetailsWidget.getEmail()==""){errorMessage.setMessageByStatus("EmailAddressNotSet");C=true}else{if(renterDetailsWidget.getEmail()!=renterDetailsWidget.getEmailRepeat()){errorMessage.setMessageByStatus("EmailAddressNotMatch");C=true}else{if(!checkemail(renterDetailsWidget.getEmail())){errorMessage.setMessageByStatus("EmailAddressInvalid");C=true}}}if(renterDetailsWidget.getPhoneNumber()==""){errorMessage.setMessageByStatus("ContactPhoneNumberNotSet");C=true}if(renterDetailsWidget.IsCreditCardRequired){if(renterDetailsWidget.getCreditCardType()==""){errorMessage.setMessageByStatus("CreditCardDetailsNotSet");C=true}if(renterDetailsWidget.getCreditCardExpiry()==""){errorMessage.setMessageByStatus("CreditCardDetailsNotSet");C=true}}if(renterDetailsWidget.IsPickupOnAirport()){if(renterDetailsWidget.getAirlineCode()!="-1"){if(renterDetailsWidget.getAirlineCode()==""){errorMessage.setMessageByStatus("FlightDetailsNotSet");C=true}if(renterDetailsWidget.getFlightNumber()==""){errorMessage.setMessageByStatus("FlightDetailsNotSet");C=true}}}if(C){waitMessage.hide();errorMessage.show()}else{var G=cleanFlightNumber(renterDetailsWidget.getFlightNumber());if(renterDetailsWidget.IsPickupOnAirport()){if(renterDetailsWidget.getAirlineCode()!="-1"){var F={code:renterDetailsWidget.getAirlineCode(),name:G};var A={airline:F,flightNumber:G}}else{var F={code:"DJ",name:"DJ"};var A={airline:F,flightNumber:"000"}}}if(renterDetailsWidget.IsCreditCardRequired){var D={name:renterDetailsWidget.getCreditCardType()};var E={cardNumber:renterDetailsWidget.getCreditCardNumber(),cardType:D,expiryDate:renterDetailsWidget.getCreditCardExpiry()}}var B={sessionId:session.sessionId,firstName:renterDetailsWidget.getFirstName(),lastName:renterDetailsWidget.getLastName(),email:renterDetailsWidget.getEmail(),phone:renterDetailsWidget.getPhoneNumber(),flightDetails:A,creditCardDetails:E,joinMailingList:renterDetailsWidget.JoinMailingList()};analytics.log("create.reservation");analytics.log("create.reservation."+accelerate.product.toLowerCase());Booking.submitRenterDetailsCreateReservation(B,function(H){if(H.status=="Ok"){analytics.log("create.reservation.success."+accelerate.product.toLowerCase());analytics.log("create.reservation.success");loadConfirmation(H.confirmation,session.quote,session.rate,session.supplierPickupLocation,session.supplierReturnLocation,session.pickupDate,session.returnDate);analytics.transact(H.transaction)}else{analytics.log("create.reservation.failed."+H.status);errorMessage.setMessageByStatus(H.status);errorMessage.show();waitMessage.hide()}})}}function JSONdate(B){var A={year:formatDate(B,"yyyy"),month:formatDate(B,"MM"),day:formatDate(B,"dd"),hour:formatDate(B,"HH"),minute:formatDate(B,"mm")};return A}function cleanFlightNumber(B){var A=B.replace(/^\D*/,"");if(A.length>4){A=A.substring(0,4)}return pad(A,4)}function pad(B,A){var C=""+B;while(C.length<A){C="0"+C}return C}function checkemail(A){return(A.indexOf(".")>2)&&(A.indexOf("@")>0)}function findUrlVars(){var F=String(document.location).toLowerCase().split("?");var C="";if(F[1]){var H=F[1].replace(document.location.hash,"");var B=H.split("&");for(var E=0;E<=(B.length);E++){if(B[E]){var A=B[E].split("=");var D=A[0];var G=A[1];switch(D){case"piata":session.pickupIata=G.toUpperCase();session.pickupOnAirport=true;break;case"riata":session.returnIata=G.toUpperCase();session.returnOnAirport=true;break;case"plocid":session.pickupLocation=null;session.supplierPickupLocation=null;session.pickupLocationId=G;break;case"rlocid":session.returnLocation=null;session.supplierReturnLocation=null;session.returnLocationId=G;break;case"pdate":session.pickupDate=new Date(getDateFromFormat(G,"MMddyyyyhhmmssa"));break;case"rdate":session.returnDate=new Date(getDateFromFormat(G,"MMddyyyyhhmmssa"));break;case"rntcountry":session.renterCountryCode=G;break;case"pcountry":session.pickupCountryCode=G;break;case"rntage":session.renterAge=G;session.renterBdate=new Date(getDateFromFormat(new Date(),"MMddyyyyhhmmssa"));break;case"rntbdate":session.renterBdate=G;session.renterBdate=new Date(getDateFromFormat(new Date(),"MMddyyyyhhmmssa"));break;case"rntfirst":session.renterFirst=G;break;case"rntlast":session.renterFirst=G;break;case"rateid":session.rateId=G;break;case"airline":session.airlineCode=G;break;case"flight":session.flightNumber=G;break;case"product":session.product=G;accelerate.product=G;break;case"sessid":session.sessionId=G;break}}}}}function setSessionFromHash(){switch(document.location.hash){case"#1":if((session.step==2)||(session.step==3)){modifyItinerary()}break;case"#2":if((session.step==3)){modifyRate()}break;case"#3":break;case"#4":break}}function urlIsRedirect(){if(window.location.search.indexOf("redirect=true")!=-1){return true}else{return false}}var accelerate=new accelerateObject();dwr.engine.setErrorHandler(function(B,A){analytics.log("/_accelerate_/error/handlerError");analytics.logError(B);errorMessage.setMessage(ERROR_MSG.UnknownError);errorMessage.show();waitMessage.hide()});dwr.engine.setWarningHandler(function(B,A){errorMessage.setMessage(ERROR_MSG.UnknownError);scrollTo(0,0);errorMessage.show();waitMessage.hide()});function accelerateObject(){this.VEHICLE_TYPE_PASSENGER="passenger";this.VEHICLE_TYPE_COMMERCIAL="commercial";this.affCode="TEST1";this.useLocalURL=true;this.googleAnalyticsCode="";this.googleTransactionCurrency="AUD";this.redirectUrl=null;this.bookingUrl=(("https:"==document.location.protocol)?"https://cr-gateway.accelerate-services.com/AjaxClient/dwr":"http://cr-gateway.accelerate-services.com/AjaxClient/dwr");this.renterCountryCode=null;this.pickupLocationName=null;this.pickupCountryCode=null;this.forceHttps=true;this.product=this.VEHICLE_TYPE_PASSENGER}lb=function(){return document.createElement("BR")};String.prototype.startsWith=function(A){return(this.match("^"+A)==A)};
