var EzRez={revision:"$Revision: 49344 $",REQUIRED_PROTOTYPE:"1.6.0",REQUIRED_SCRIPTACULOUS:"1.8.1",load:function(){function B(D){var E=D.split(".");return parseInt(E[0],10)*100000+parseInt(E[1],10)*1000+parseInt(E[2],10);}if(Prototype===undefined){throw ("ezrez.js requires the Prototype JavaScript framework >= "+EzRez.REQUIRED_PROTOTYPE);}if(B(Prototype.Version)<B(EzRez.REQUIRED_PROTOTYPE)){throw ("ezrez.js requires the Prototype JavaScript framework >= "+EzRez.REQUIRED_PROTOTYPE);}if(Scriptaculous===undefined){throw ("ezrez.js requires the Prototype JavaScript framework >= "+EzRez.REQUIRED_SCRIPTACULOUS);}if(B(Scriptaculous.Version)<B(EzRez.REQUIRED_SCRIPTACULOUS)){throw ("ezrez.js requires the Prototype JavaScript framework >= "+EzRez.REQUIRED_SCRIPTACULOUS);}var A=$A(document.getElementsByTagName("script")).find(function(D){return D.src&&(D.src.include("/js/packages/js/ezrez-")||D.src.include("/js/ezrez/js/ezrez.js"));});this.path=(A)?A.src.replace(/\/js\/packages\/js\/ezrez-[^\/]*\.js$/,"/js").replace("/js/ezrez/js/ezrez.js","/js"):"";var C="$Revision: 49344 $".match(/^\$Revision: (\d+) \$$/);this.revision=C[1];}};EzRez.load();Array.prototype.intersect2=function(C){var B=this,A=[];C.each(function(D){if(B.indexOf(D)!==-1&&A.indexOf(D)==-1){A.push(D);}});return A;};Object.extend(Event,{KEY_SHIFT:16,KEY_CTRL:17,KEY_ALT:18,KEY_F1:112,KEY_F2:113,KEY_F3:114,KEY_F4:115,KEY_F5:116,KEY_F6:117,KEY_F7:118,KEY_F8:119,KEY_F9:120,KEY_F10:121,KEY_F11:122,KEY_F12:123});Date.parseGMT=function(B){if(!B){return new Date();}var A=B.match(/(^\d{4})[-\/](\d{1,2})[-\/](\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2}) GMT$/);if(!A){return null;}if(!Object.isArray(A)&&A.length<8){return null;}A.shift();A=A.collect(function(C){return parseInt(C,10);});return Date.UTC(A[0],A[1]-1,A[2]-1,A[3],A[4],A[5]);};Date.parseJSON=function(B){if(!B){return new Date();}var A=B.match(/(^\d{4})[-\/](\d{1,2})[-\/](\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2}) GMT$/);if(!A){return null;}if(!Object.isArray(A)&&A.length<8){return null;}A.shift();A=A.collect(function(C){return parseInt(C,10);});return new Date(A[0],A[1]-1,A[2],A[3],A[4],A[5]).getTime();};Date.convertToOffset=function(B,A){var C=B.getTime()+(B.getTimezoneOffset()*60000);return new Date(C+A);};Date.prototype.diffInDays=function(A){var B=(A.getTime()-this.getTime())/(1000*60*60*24);return Math.ceil(B);};Date.prototype.isBefore=function(A){return this.getTime()<A.getTime();};Date.prototype.isAfter=function(A){return this.getTime()>A.getTime();};Date.prototype.format=function(B,D){var C=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,E=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,G=/[^-+\dA-Z]/g,F=function(I,H){I=String(I);H=H||2;while(I.length<H){I="0"+I;}return I;};var A=function(O,Y,U){var K=A;if(arguments.length==1&&(typeof O=="string"||O instanceof String)&&!/\d/.test(O)){Y=O;O=undefined;}O=O?new Date(O):new Date();if(isNaN(O)){throw new SyntaxError("invalid date");}Y=String(K.masks[Y]||Y||K.masks["default"]);if(Y.slice(0,4)=="UTC:"){Y=Y.slice(4);U=true;}var W=U?"getUTC":"get",R=O[W+"Date"](),I=O[W+"Day"](),P=O[W+"Month"](),T=O[W+"FullYear"](),V=O[W+"Hours"](),Q=O[W+"Minutes"](),X=O[W+"Seconds"](),S=O[W+"Milliseconds"](),J=U?0:O.getTimezoneOffset(),N={d:R,dd:F(R),ddd:K.i18n.dayNames[I],dddd:K.i18n.dayNames[I+7],m:P+1,mm:F(P+1),mmm:K.i18n.monthNames[P],mmmm:K.i18n.monthNames[P+12],yy:String(T).slice(2),yyyy:T,h:V%12||12,hh:F(V%12||12),H:V,HH:F(V),M:Q,MM:F(Q),s:X,ss:F(X),l:F(S,3),L:F(S>99?Math.round(S/10):S),t:V<12?"a":"p",tt:V<12?"am":"pm",T:V<12?"A":"P",TT:V<12?"AM":"PM",Z:U?"UTC":(String(O).match(E)||[""]).pop().replace(G,""),o:(J>0?"-":"+")+F(Math.floor(Math.abs(J)/60)*100+Math.abs(J)%60,4),S:["th","st","nd","rd"][R%10>3?0:(R%100-R%10!=10)*R%10]};return Y.replace(C,function(H){return H in N?N[H]:H.slice(1,H.length-1);});};A.masks={"default":"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"};A.i18n={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"]};return A(this,B,D);};Math.roundToDecimal=function(B,A){if(!Object.isNumber(B)||!Object.isNumber(A)||A<1){return B;}A=Math.round(A);return Math.round(B*Math.pow(10,A))/Math.pow(10,A);};try{document.execCommand("BackgroundImageCache",false,true);}catch(err){}if(EzRez===undefined){throw ("ezrez-util.js requires ezrez.js");}EzRez.Util={};EzRez.Util.MockFBConsole=function(){this.debug=function(){};this.log=function(){};this.info=function(){};this.warn=function(){};this.error=function(){};this.assert=function(){};this.dir=function(){};this.dirxml=function(){};this.group=function(){};this.groupEnd=function(){};this.time=function(){};this.timeEnd=function(){};this.count=function(){};this.trace=function(){};this.profile=function(){};this.profileEnd=function(){};};var _mockConsole=new EzRez.Util.MockFBConsole();if(window.console===undefined){window.console=_mockConsole;}else{for(var func in _mockConsole){if(window.console[func]===undefined){window.console[func]=_mockConsole[func];}}}EzRez.Util.Debug=new function(){var B=[];var A=log4javascript.getLogger();var C=new log4javascript.PopUpAppender();C.setFocusPopUp(false);C.setComplainAboutPopUpBlocking(false);C.setUseOldPopUp(true);C.setReopenWhenClosed(false);A.addAppender(C);log4javascript.setEnabled(false);var D=function(G,F,E){if(log4javascript.isEnabled()){return ;}B.push({lvl:G,msg:F,ex:E});};this.trace=function(F,E){D("trace",F,E);A.trace(F,E);};this.debug=function(F,E){D("trace",F,E);A.debug(F,E);};this.info=function(F,E){D("info",F,E);A.info(F,E);};this.warn=function(F,E){D("warn",F,E);A.warn(F,E);};this.error=function(F,E){D("error",F,E);A.error(F,E);};this.fatal=function(F,E){D("fatal",F,E);A.fatal(F,E);};this.setEnabled=function(E){log4javascript.setEnabled(E);if(E&&B.length>0){B.each(function(F){this[F.lvl](F.msg,F.ex);},this);B=[];}};this.openPopup=function(){C.setReopenWhenClosed(true);A.debug("Debugging enabled.");C.setReopenWhenClosed(false);};this.closePopup=function(){C.close();};};EzRez.Util.URL=function(B){var A=/(https|http|ftp|ftps):\/\/([^\/]+)\/?([^\?]*)\??(.*)/;if(!A.test(B)){this.protocol=null;this.domain=null;this.file=null;this.query=null;this.toString=function(){return null;};return ;}var C=B.match(A);this.protocol=C[1];this.domain=C[2];this.file=C[3];this.query=C[4];this.toString=function(){return B;};};EzRez.Util.Env=new function(){var E="";var G=[{string:navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:navigator.vendor,subString:"Apple",identity:"Safari"},{prop:window.opera,identity:"Opera"},{string:navigator.vendor,subString:"iCab",identity:"iCab"},{string:navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.vendor,subString:"Camino",identity:"Camino"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}];var D=[{string:navigator.platform,subString:"Win",identity:"Windows"},{string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.platform,subString:"Linux",identity:"Linux"}];var F=function(L){var J=false;var K=false;for(var I=0;I<L.length;I++){J=L[I].string;K=L[I].prop;E=L[I].versionSearch||L[I].identity;if(J){if(J.indexOf(L[I].subString)!=-1){return L[I].identity;}}else{if(K){return L[I].identity;}}}};var B=function(J){var I=J.indexOf(E);if(I==-1){return ;}return parseFloat(J.substring(I+E.length+1));};var A=F(G)||"An unknown browser";var H=B(navigator.userAgent)||B(navigator.appVersion)||"an unknown version";var C=F(D)||"an unknown OS";this.toString=function(){return A+" "+H+" "+C;};this.getBrowser=function(){return A;};this.getVersion=function(){return H;};this.getOS=function(){return C;};this.isIE6=function(){var I=A+H;return I.include("Explorer6");};};EzRez.Util.RemoteLog=function(J,E){var A=$H({type:"information",file:"clientapp_javascript",complete:function(){}}).merge(E).toObject();var C="/js_logger.cfm";var D=A.type;var K=A.file;var B=A.complete;var H=false;var G;var F=new Template("<log><message>#{msg}</message><environment>#{env}</environment><location>#{loc}</location></log>");var I=function(M){var L={msg:M,env:navigator.userAgent,loc:location.href};G={log_content:F.evaluate(L),log_type:D,log_file:K};};this.getPost=function(){return G;};this.getStatus=function(){return H;};this.post=function(L){I(L);var M=new Ajax.Request(C,{method:"post",parameters:G,onSuccess:function(N){H=(N.responseText.strip()=="1");B(H);},onException:function(O,N){H=false;B(H);throw N;},onFailure:function(){H=false;B(H);}});};this.post(J);};EzRez.Util.Exception=function(A,E){var C=Object.extend({name:"EzrezException",message:"",remotelog:false},A);var F=C.name+': "'+C.message+'"';var D=C.remotelog;var B;this.name=C.name;this.message=C.message;this.toString=function(){var G=E?E.message:"";return C.name+': "'+C.message+'" '+G;};EzRez.Util.Debug.error(F,E);if(D){B=new EzRez.Util.RemoteLog(F,{type:"error"});}if(EzRez.Application.WebContext.isDebugMode){if(E!==undefined&&E!==null){throw E;}else{throw C.message;}}};EzRez.Util.Profiler=new function(){var G=new Date();var E=G.getTime();var K="profiler_report";var I=$H();var J=function(){var N="<ul>";var M=new Template('<li class="profiler_span"><div class="span_details">(#{index}) #{name}: #{start}, #{end}, #{dur}</div><div class="span_bar" style="left:#{left}px; width: #{width}px;"> </div></li>');I.each(function(O){O.value.left=O.value.start/50;O.value.width=O.value.dur/50;N+=M.evaluate(O.value);});N+="</ul>";return N;};var B=function(){var N="<profile_report>";var M=new Template("<span><index>#{index}</index><name>#{name}</name><start>#{start}</start><end>#{end}</end><duration>#{dur}</duration></span>");I.each(function(O){N+=M.evaluate(O.value);});N+="</profile_report>";return N;};var C=function(){return I.toJSON();};var L=function(){var M=new Date();return M.getTime()-E;};var F=function(){var N=C();var M=new EzRez.Util.RemoteLog(N,{file:"js_profile"});};var D=function(){if($(K)){return ;}J();var M="<h3>Profiler Report</h3>"+J();M+="<a class='log' href='#'>(Log)</a>";var N=new Element("div",{id:K,style:"display: none;"}).update(M);document.body.appendChild(N);};var A=function(M){if(M.keyCode!=Event.KEY_F2){return ;}D(K);$$("#"+K+" a.log")[0].observe("click",function(N){F();Event.stop(N);return false;});$(K).toggle();};var H=function(M){var N=I.get(M);if(!N){N={index:I.size()+1,name:M,start:0};}N.stop=function(){};N.end=L();N.dur=N.end-N.start;I.set(M,N);EzRez.Util.Debug.info("#{index}) #{name}: #{start}, #{end}, #{dur}".interpolate(N));return N;};this.getStartTime=function(){return E;};this.start=function(M){var N={index:I.size()+1,name:M,start:L(),end:null,dur:null};N.stop=function(){H(M);};I.set(M,N);return N;};this.stop=function(M){return H(M);};this.report=function(){D();};this.logReport=function(){F();};this.clearAll=function(){I=$H();};this.getSpan=function(M){return I.get(M);};this.getSpans=function(){return I;};this.toHTML=function(){return J();};this.toXML=function(){return B();};this.toJSON=function(){return C();};document.observe("keydown",A);};EzRez.Util.Cookie=new function(){var A="";this.create=function(E,F,C){var B="";var G=encodeURIComponent(F);var D=new Date();if(C){D.setTime(D.getTime()+(C*60*60*1000));B="; expires="+D.toGMTString();}A=E+"="+G+B+"; path=/";document.cookie=A;};this.read=function(C){var E=C+"=";var B=document.cookie.split(";");var F;for(var D=0;D<B.length;D++){F=B[D];while(F.charAt(0)==" "){F=F.substring(1,F.length);}if(F.indexOf(E)==0){return decodeURIComponent(F.substring(E.length,F.length));}}return null;};this.erase=function(B){this.create(B,"",-1);};this.eraseAll=function(){var B=document.cookie.split(";");B.each(function(D){var C=D.strip().split("=")[0];this.erase(C);}.bind(this));};this.getCookieText=function(){return A;};};EzRez.Util.Indexer=function(C){var A=$H({index_data:null,id_property:"",property_list:"all"}).merge(C).toObject();var G=$H();var D=A.index_data;var H=A.id_property;var F=A.property_list;A.index_data=null;var J=function(){var L;if(F==="all"){L=D.first();var K;for(K in L){if(L[K]&&K!==H){G.set(K,$H());}}return ;}F.each(function(M){G.set(M,$H());});};var I=function(K,M,N){if(Object.isArray(M)){M.each(function(O){I(K,O,N);});return ;}var L=K.get(M);if(!L){K.set(M,[N]);}else{L.push(N);}};var B=function(){D.each(function(L,K){L.master_index=K;G.each(function(M){if(L[M.key]){I(M.value,L[M.key],L);}});});};var E=function(){G=null;D=null;};this.filter=function(N,M){var L=G.get(N);if(!L){return[];}var K=L.get(M);if(!K){return[];}return K.pluck(H);};this.filterUnion=function(O,N){var L=G.get(O);var M=[];var K;if(!L){return M;}N.each(function(P){K=L.get(P);if(K){M=M.concat(K);}});M=M.sortBy(function(P){return P.master_index;});return M.pluck(H);};this.filterIntersect=function(O,N){var L=G.get(O);var M=null;var K=null;if(!L){return M;}N.each(function(P){K=L.get(P);if(!K){return ;}if(!M){M=K;return ;}if([M.length,K.length].include(0)){M=[];throw $break;}M=M.intersect2(K);});if(!M){return[];}return M.pluck(H);};this.getIndex=function(K){return G.get(K);};this.getIndexes=function(){return G;};this.deleteIndexes=function(){G=$H();};this.deleteIndex=function(K){G.unset(K);};this.unload=function(){E();};Event.observe(window,"unload",E);J();B();};EzRez.Util.Omniture=new function(){this.transmit=function(){try{if(!s){return ;}var A=s.t();if(A){document.write(A);}}catch(B){}};};EzRez.Util.Locales=new function(){var A=$H();this.setDateLocale=function(B,C){A.set(B,C);};this.get=function(B){return A.get(B);};};EzRez.Util.WebAnalytics={};(function(){var A=$H();EzRez.Util.WebAnalytics.createWebBeacon=function(C,B){if(!A.get(C)){A.set(C,new EzRez.Util.WebAnalytics.WebBeacon(C,B));}return A.get(C);};EzRez.Util.WebAnalytics.getWebBeacon=function(B){return A.get(B);};EzRez.Util.WebAnalytics.transmitWebBeacons=function(){A.each(function(B){B.value.transmit();});};})();EzRez.Util.WebAnalytics.WebBeacon=function(C,B){var D=$H();var E=B;var A=C;this.getName=function(){return A;};this.setField=function(F,G){D.set(F,G);};this.getField=function(F){return D.get(F);};this.getFields=function(){return D;};this.getAdapter=function(){return E;};this.transmit=function(){console.info(A+"WebAnalytics Fields:");console.dir(D.toObject());if(!E){return ;}E(D);};};EzRez.Util.WebAnalytics.Adapters={};EzRez.Util.WebAnalytics.Adapters.Omniture=function(B){try{if(typeof s==="undefined"||!s){return ;}B.each(function(D){s[D.key]=D.value;});var A=s.t();if(A){document.write(A);}}catch(C){throw new EzRez.Util.Exception({name:"EzRez.Util.WebAnalytics.Adapters.Omniture",message:"Omniture s code has not been loaded."},C);}};EzRez.Util.WebAnalytics.GA=new function(){var A=$H();var C="";var B=function(){try{return(_gat!==null&&_gat!==undefined);}catch(E){return false;}};var D=function(I){var F=_gat._getTracker(I);var G={addTrans:F._addTrans,addItem:F._addItem,trackPageview:F._trackPageview,trackTrans:F._trackTrans};var H=[];var E=[];F._addTrans=function(J,O,K,M,L,N){E.push(arguments);};F._addItem=function(J,M,N,L,K,Q,O,P){H.push(arguments);};F.pageviewUrl=undefined;F.disableTrackPageview=false;F.disableTrackTrans=false;F._trackPageview=function(){if(F.disableTrackPageview){return ;}G.trackPageview.call(F,F.pageviewUrl);};F._trackTrans=function(){if(F.disableTrackTrans){return ;}E.each(function(J){G.addTrans.apply(F,J);});H.each(function(J){G.addItem.apply(F,J);});G.trackTrans.call(F);};return F;};this.createTracker=function(F,E){if(!B()){return ;}if(!A.get(F)){A.set(F,D(F));}if(arguments.length>1&&arguments[1]===true){C=F;}return A.get(F);};this.getDefaultTracker=function(){return A.get(C);};this.getTracker=function(E){return A.get(E);};this.trackPageview=function(){if(!B()){return ;}A.each(function(E){E.value._trackPageview();});};this.trackTrans=function(){if(!B()){return ;}A.each(function(E){E.value._trackTrans();});};};if(EzRez===undefined){throw ("ezrez-ui.js requires ezrez.js");}if(EzRez.Util===undefined){throw ("ezrez-ui.js requires ezrez-util.js");}EzRez.UI={};EzRez.UI.Spinner=function(G,B){var D=$H({hide_id:null,hide_sibling:true}).merge(B).toObject();var E=D.hide_id;var C=D.hide_sibling;var A=null;var F=function(){A=$(G);if(!A){throw ({name:"ElementDoesNotExistError",message:"The specified DOM element does not exist, but is required for this control to operate."});}return true;};this.show=function(){if(!F()){return ;}A.show();if(C){var H=A.next();if(H!=undefined){A.next().hide();}}if($(E)){$(E).hide();}};this.hide=function(){if(!F()){return ;}A.hide();if(C){var H=A.next();if(H!=undefined){A.next().show();}}if($(E)){$(E).show();}};this.setMessage=function(H){if(!F()){return ;}A.down("p.message").update(H);};this.getMessage=function(){if(A===null){return"";}return A.down("p.message").innerHTML;};this.getElement=function(){return A;};};EzRez.UI.TabLinks=function(H){var J=Math.floor(new Date().getTime()+1000*Math.random());var D=$H({name:"TabLinks_"+J,default_tab:null,use_cookies:true,link_active_css:null,no_hide_classname:null,onshow:function(N,O){}}).merge(H).toObject();var L=D.name;var B=D.default_tab;var C=D.use_cookies;var K=D.onshow;var E=D.link_active_css;var M=D.no_hide_classname;var G=new Array();var A=new Array();var I=function(){if(E===null){return ;}A.each(function(N){N.anchor.removeClassName(E);});};var F=function(N){if(E===null){return ;}if(typeof (N)=="string"){N=$(N);}N.addClassName(E);};this.showTab=function(O,N){if(typeof (O)=="string"){O=$(O);}this.hideTabs();if(!O){return ;}O.show();I();var P=A.findAll(function(Q){return(Q.tab==O);});P.each(function(Q){F(Q.anchor);if(C){EzRez.Util.Cookie.create(L,Q.tab.identify());}}.bind(this));K(N,O);};this.showLastViewedTab=function(){var N=EzRez.Util.Cookie.read(L);if(N){this.showTab(N);}else{if(B!=null){this.showTab(B);}}};this.hideTabs=function(){G.each(function(O){var N=$(O);if(!N){return ;}if(N.hasClassName(M)){return ;}N.hide();});};this.clearCookies=function(){EzRez.Util.Cookie.erase(L);};this.createTabLink=function(O,N){if(typeof (N)=="string"){N=$(N);}if(typeof (O)=="string"){O=$(O);}N.observe("click",function(P){this.showTab(O,P);Event.stop(P);return false;}.bindAsEventListener(this));G.push(O);A.push({anchor:N,tab:O});};this.addLinks=function(N){N.each(function(P){var Q=P.href.split("#")[1];var O=$(Q);if(O===null){return ;}this.createTabLink(O,P);}.bind(this));};this.getLinks=function(){return A;};this.getTabs=function(){return G;};};EzRez.UI.PhotoSwitcher=function(A,B){B.childElements().each(function(D){var C=D.select("img.thumb")[0];C.observe("click",function(E){var G=Event.element(E);var F=G.parentNode.select("img.medium")[0];A.src=F.src;});});};EzRez.UI.Pagination=function(I){var V=$H({per_page:10,elements:[],active_element_classname:"",container_css:null,show_start:function(){},show_complete:function(){},listener_timeout:100}).merge(I).toObject();var Z=Object.isString(V.per_page)?parseInt(V.per_page):V.per_page;var F=V.elements;var C=[];var W=1;var R=false;var E=V.container_css;var N="previous";var M="next";var Q="page";var Y="inactive";var G=V.active_element_classname;var H=false;var a=V.show_start;var D=V.show_complete;var U=V.listener_timeout;var K=1;var P=function(){if(!E){return false;}if($$(E+" a").size()===0){return false;}return true;};var O=function(c){if(C.length===0){return[];}if(!C[c-1]){R=true;return C[0].compact();}return C[c-1].compact();};var b=function(){if(!H){return ;}var e=W;var f=W;var g=new Element("a").addClassName;var c=new Element("a").addClassName;$$(E+" a."+Q).invoke("removeClassName",Y);$$(E+" a."+Q+'[rel="'+W+'"]').invoke("addClassName",Y);if(W>1){e=W-1;g=new Element("a").removeClassName;}if(W<C.size()){f=W+1;c=new Element("a").removeClassName;}$$(E+" a."+N).each(function(h){h.writeAttribute("rel",e);g.apply(h,[Y]);});$$(E+" a."+M).each(function(h){h.writeAttribute("rel",f);c.apply(h,[Y]);});};var J=function(c){if(!c){c=O(W);}c.each(function(e){if(!Object.isElement(e)){e=$(e);}if(!e){return ;}e.removeClassName(G);e.hide();});};var X=function(e,c){a();J(c);e=(isNaN(e))?W:e;e=(R)?W:e;W=e;var f=O(W);f.each(function(g){if(!Object.isElement(g)){g=$(g);}if(!g){return ;}g.addClassName(G);g.show();});b();D(f);};var B=function(e,c){var f=new EzRez.UI.Sorter({elements:F});F=f.sortBy(e,c);};var T=function(e){var f=$H({data:null,sortby:null,ascending:true}).merge(e).toObject();if(f.data){F=f.data;}if(f.sortby){B(f.sortby,f.ascending);}var c=O(W);C=F.eachSlice(Z);var g=C.size();if(H){$$(E).each(function(h){var j=h.select("a."+Q);j.slice(0,g-1).invoke("show");j.slice(g,j.length).invoke("hide");});}X(1,c);};var S=function(){if(!H){return ;}$$(E+" a").invoke("stopObserving","click",L);};var A=function(){C=null;F=null;S();};var L=function(c){EzRez.Util.Profiler.start("Pagination Click "+K);var f=c.target;var e=parseInt(f.readAttribute("rel"));a();var g=function(){J();e=(isNaN(e))?W:e;e=(R)?W:e;W=e;var l=O(W);var k=EzRez.Util.Profiler.start("_showPage Show Elements");l.each(function(m){if(!Object.isElement(m)){m=$(m);}if(!m){return ;}m.addClassName(G);m.show();});k.stop();var j=EzRez.Util.Profiler.start("_showPage Adjust Pagination");b();j.stop();var h=EzRez.Util.Profiler.start("_showPage Show Complete");D(l);h.stop();EzRez.Util.Profiler.stop("Pagination Click "+K);};if(U>0){setTimeout(g,U);}else{g();}K++;Event.stop(c);return false;};this.makePages=function(c){T(c);};this.showPage=function(c){X(c);};this.hidePage=function(){J();};this.showPageByIndex=function(c){var e=Math.ceil((c+1)/Z);this.showPage(e);};this.sortBy=function(e,c){B(e,c);T();};this.getPage=function(c){return O(c);};this.getPages=function(){return C;};this.getElements=function(){return F;};this.getPageNumber=function(){return W;};this.getCurrentPage=function(){return O(W);};this.unload=function(){A();};this.applyListeners=function(){if(!H){return ;}$$(E+" a").invoke("observe","click",L);Event.observe(window,"unload",A);};this.removeListeners=function(){S();};H=P();this.makePages();this.applyListeners();};EzRez.UI.LightView=function(G){var B=$H({class_name:null,rel:null,options:{topclose:false,width:400,height:400},"lightview:opened":null,"lightview:hidden":null}).merge(G).toObject();var I=B.class_name;var A=B.rel;var J=B.options;var D=B["lightview:opened"];var E=B["lightview:hidden"];var H={};var F=function(W,O){if(!Lightview){throw new EzRez.Util.Exception({message:"EzRez.UI.LightView requires lightview.js."});}if(!$("lightview")){throw new EzRez.Util.Exception({message:"Lightview element is missing."});}if(!$(W)){throw new EzRez.Util.Exception({message:"Missing anchor element for EzRez.UI.LightView."});}var M=$("lightview");var Q=$(W);var T=Q.readAttribute("title")||"::";T=T.split("::");if(!Lightview.started){Lightview.start();}if(I){var U;var P;if(!$("lightview_style")){U=new Element("div",{id:"lightview_style",style:"display:none;"});M.insert(U,{position:"after"});}else{U=$("lightview_style");}if(U.select(I).size()==0){P=new Element("div",{"class":I});U.insert(P);}else{P=U.select(I)[0];}var R=P.getStyle("height");var S=P.getStyle("width");if(R!==undefined){var N=parseInt(R.replace("px",""));if(!isNaN(N)){J.height=N;}}if(S!==undefined){var V=parseInt(S.replace("px",""));if(!isNaN(V)){J.width=V;}}}var K=function(X){if(D!==null){D(X,O);}};var L=function(X){if(E!==null){E(X,O);document.stopObserving("lightview:hidden",L);}if(D!==null){document.stopObserving("lightview:opened",K);}};if(D!==null){document.observe("lightview:opened",K);}if(D!==null||E!=null){document.observe("lightview:hidden",L);}H={href:Q.href,rel:A,title:T[0],caption:T[1],options:J};Lightview.show(H);};var C=function(){Lightview.hide();};this.getShowOptions=function(){return H;};this.setEventsListeners=function(L){var K=$H({"lightview:opened":null,"lightview:hidden":null}).merge(L).toObject();D=K["lightview:opened"];E=K["lightview:hidden"];};this.show=function(K){F(K);};this.hide=function(){C();};this.domAction=function(L,K){F(L.target,K);Event.stop(L);return false;};};EzRez.UI.DualSliderFilter=function(F){var J=$H({id:null,ticks:null,update:function(){}}).merge(F).toObject();if(!(J.ticks||J.id)){throw ("Missing parameters for EzRez.UI.DualSliderFilter.");}var D=null;var C=this;var N=new EzRez.UI.DOMCache({rootNode:"#"+J.id,nodes:{slider:function(O){return O.down("div.filterSlider");},highlight:function(O){return O.down("span.highlight");},minValue:function(O){return O.down("div.filterValues span.min");},maxValue:function(O){return O.down("div.filterValues span.max");},minThumb:function(O){return O.down("div.thumbMin");},maxThumb:function(O){return O.down("div.thumbMax");},inputMinValue:function(O){return O.down("input.min");},inputMaxValue:function(O){return O.down("input.max");}}});if(!N.cache()){throw ("Invalid DOM nodes ("+N.getInvalidNodes().join(",")+") for "+J.id+" EzRez.UI.DualSliderFilter.");}var I=N.slider.getWidth()-N.minThumb.getWidth();var E=I/J.ticks.length;try{D=YAHOO.widget.Slider.getHorizDualSlider(N.slider,N.minThumb,N.maxThumb,I);D.animate=false;}catch(H){throw ("EzRez.UI.DualSliderFilter requires YAHOO.widget.Slider.");}D.animate=false;var M=function(P,O){if(!N.rootNode){return ;}N.rootNode.fire("DualSliderFilter:update",{min:P,max:O,instance:C});};var A=function(){var P=D.minVal;var O=Math.floor(P/E-1);if(O<0){return 0;}return O;};var K=function(){var P=D.maxVal;var O=Math.ceil(P/E-1);if(O>J.ticks.length-1){return J.ticks.length-1;}return O;};var G=function(){var R=D.minVal;var P=D.maxVal;if(R>=0&&R<=I){N.highlight.setStyle({left:(R+4)+"px"});}if(P>=0&&P<=I){N.highlight.setStyle({width:(P-R)+"px"});}var Q=A();var O=K();if(J.ticks[Q]!==undefined){N.minValue.innerHTML=J.ticks[Q]._label;N.inputMinValue.value=J.ticks[Q]._value;}if(J.ticks[O]!==undefined){N.maxValue.innerHTML=J.ticks[O]._label;N.inputMaxValue.value=J.ticks[O]._value;}};var L=function(){var P=A();var O=K();var Q=J.ticks[0];var R=J.ticks[J.ticks.length-1];if(J.ticks[P]){Q=J.ticks[P];}if(J.ticks[O]){R=J.ticks[O];}return{min:{label:Q._label,value:Q._value},max:{label:R._label,value:R._value}};};var B=function(){var O=L();J.update(O.min,O.max);M(O.min,O.max);};this.getSliderValues=function(){return L();};this.update=function(){B();};this.reset=function(){D.setValues(0,I,true,true,false);};this.applyListeners=function(){D.subscribe("change",G);D.subscribe("ready",G);D.subscribe("slideEnd",B,this,true);};this.removeListeners=function(){D.unsubscribe("change",G);D.unsubscribe("ready",G);D.unsubscribe("slideEnd",B);};this.getDualSlider=function(){return D;};};EzRez.UI.CheckboxFilter=function(I){var F=$H({update:null,form_id:null,checkbox_name:null,checked_by_default:true,show_all_id:null}).merge(I).toObject();var N=F.update;var K=F.form_id;var C=F.checkbox_name;var B=F.checked_by_default;var M=F.show_all_id;var J=0;var A=false;var E=function(){if(!$(K)){throw new EzRez.Util.Exception({message:"Missing "+K+" form element for EzRez.UI.CheckboxFilter."});}if($(K).getInputs("checkbox",C).size()===0){throw new EzRez.Util.Exception({message:"Missing "+C+" checkbox elements for EzRez.UI.CheckboxFilter."});}return true;};var H=function(){var O=$$("#"+K+' input[name="'+C+'"]:checked');return O.pluck("value");};var L=function(){if(N===null){return ;}N(H(),C);J++;};var G=function(){if($(M)){$(M).checked=false;}L();};var D=function(){$(K).getInputs("checkbox",C).each(function(O){O.checked=B;});L();};this.update=function(){L();};this.getCheckboxName=function(){return C;};this.getCheckedValues=function(){return H();};this.reset=function(){$(K).getInputs("checkbox",C).each(function(O){O.checked=B;});if($(M)){$(M).checked=!B;}};this.applyListeners=function(){if(!A){return ;}$(K).getInputs("checkbox",C).each(function(O){O.observe("click",G);});if($(M)){$(M).observe("click",D);}};this.removeListeners=function(){if(!A){return ;}$(K).getInputs("checkbox",C).each(function(O){O.stopObserving("click",G);});if($(M)){$(M).stopObserving("click",D);}};A=E();};EzRez.UI.IconFilter=function(K){var G=$H({update:null,form_id:null,active_classname:"active",hover_classname:"hover",checkbox_name:null,checked_by_default:true,show_all_id:null}).merge(K).toObject();var O=G.update;var L=G.form_id;var E=G.checkbox_name;var D=G.checked_by_default;var N=G.show_all_id;var C=G.active_classname;var A=G.hover_classname;if($(L)===null){throw ("Missing "+L+" form element for EzRez.UI.IconFilter.");}if($(L).getInputs("checkbox",E).size()===0){throw ("Missing "+E+" checkbox elements for EzRez.UI.IconFilter.");}if($(L).select("li").size()===0){throw ("Missing li elements for EzRez.UI.IconFilter.");}var J=function(){var P=$$("#"+L+' input[name="'+E+'"]:checked');return P.pluck("value");};var M=function(){if(O===null){return ;}O(J(),E);};var I=function(P){var Q=P.target;var R=Q.down("input");R.checked=!R.checked;Q.toggleClassName(C);if(Q.hasClassName(C)){Q.addClassName(A);}else{Q.removeClassName(A);}if($(N)){$(N).checked=false;}M();};var B=function(P){P.target.addClassName(A);};var H=function(P){var Q=P.target;if(Q.hasClassName(C)){return ;}Q.removeClassName(A);};var F=function(){$(L).getInputs("checkbox",E).each(function(P){P.checked=D;});M();};this.update=function(){M();};this.getCheckboxName=function(){return E;};this.getCheckedValues=function(){return J();};this.reset=function(){$(L).select("li").each(function(P){P.removeClassName(C);P.removeClassName(A);});$(L).getInputs("checkbox",E).each(function(P){P.checked=D;});if($(N)){$(N).checked=!D;}};this.applyListeners=function(){$(L).select("li").each(function(P){P.observe("click",I);P.observe("mouseover",B);P.observe("mouseout",H);});if($(N)){$(N).observe("click",F);}};this.removeListeners=function(){$(L).select("li").each(function(P){P.stopObserving("click",I);P.stopObserving("mouseover",B);P.stopObserving("mouseout",H);});if($(N)){$(N).stopObserving("click",F);}};};EzRez.UI.WaitingOverlay=function(D){var A=$H({name:null,header:"",body:""}).merge(D).toObject();var I="#"+A.name;var K=A.header;var B=A.body;var H=1;var G=1;var J=new YAHOO.widget.Panel(A.name,{width:"240px",close:false,draggable:false,zindex:4,modal:true,visible:false,underlay:"none"});var L=false;var F=false;var C=function(){var P=document.viewport.getScrollOffsets();var M=350;var Q=P.top+350;var O=$$(I+"_c.yui-panel-container")[0];var N="";if(!O){return ;}if(!J.style_top){N=O.getStyle("top");if(N){J.style_top=parseInt(N.replace("px",""));}}if(!J.style_left){N=O.getStyle("left");if(N){J.style_left=parseInt(N.replace("px",""));}}if(!isNaN(J.style_top)){Q=P.top+J.style_top;}if(!isNaN(J.style_left)){M=J.style_left;}J.moveTo(M,Q);};var E=function(){if(L){return ;}J.setHeader(K);J.setBody(B);L=J.render(document.body);};this.setContent=function(N,M){K=N;B=M;L=false;};this.hide=function(){if(F){J.hide();F=false;}G++;};this.show=function(){if(F){return ;}E();if(!F){C();J.show();F=true;}H++;};this.getPanel=function(){return J;};};EzRez.UI.Dialog=function(F){var H=$H({name:null,position:"center",headerSelector:"div.header",bodySelector:"div.body",headerContent:null,bodyContent:null,className:""}).merge(F).toObject();var J=1;var I=1;var A=null;var D=null;var C=false;var B=$$("select","embed","object");var M;var L;var G=function(){if(C){return true;}A=$(H.name);A.addClassName(H.className);D=A.down("div.container");C=(A);if(!C){throw new EzRez.Util.Exception({message:"Missing #"+H.name+" element for EzRez.UI.Dialog."});}if(H.headerContent){D.down(H.headerSelector).update(H.headerContent);}if(H.bodyContent){D.down(H.bodySelector).update(H.bodyContent);}return C;};var E=function(N){if(!G()){return ;}var P={viewport:Object.extend(document.viewport.getScrollOffsets(),document.viewport.getDimensions()),body:$(document.body).getDimensions(),container:D.getDimensions()};P.container.top=Math.floor(P.viewport.top+P.viewport.height/2-P.container.height/2);P.container.left=Math.floor(P.viewport.left+P.viewport.width/2-P.container.width/2);A.setStyle({height:P.body.height+"px",width:P.viewport.width+"px"});var O={center:function(){D.addClassName("center");D.setStyle({top:P.container.top+"px",left:P.container.left+"px"});},topleft:function(){D.addClassName("topleft");},topright:function(){D.addClassName("topright");}};D.removeClassName("center");D.removeClassName("topleft");D.removeClassName("topright");var Q=O[N];if(!Q){Q=O.center;}Q();};var K=function(){E(H.position);};M=function(){Event.observe(window,"resize",K);};L=function(){Event.stopObserving(window,"resize",K);};this.setHeaderText=function(N){if(!G()){return ;}D.down(H.headerSelector).update(N);};this.setBodyText=function(N){if(!G()){return ;}D.down(H.bodySelector).update(N);};this.show=function(){if(!G()){return ;}A.show();E(H.position);B.invoke("setStyle","visibility: hidden");M();J++;};this.hide=function(){if(!G()){return ;}B.invoke("setStyle","visibility: visible");A.hide();L();I++;};this.applyListeners=function(){M();};this.removeListeners=function(){L();};};(function(){var D=false;var B={lightbox:null};var A=false;var C=false;EzRez.UI.LightBox=function(K){var L=$H({className:"",type:"iframe",opened:function(){},hidden:function(){}}).merge(K).toObject();var E=1;var H=1;var J;var V;var S={};var G=null;var M=function(){if(A){return ;}var W=$("lightbox");B={lightbox:W,container:W.down("div.container"),loading:W.down("div.loading"),effect:W.down("div.container div.effect_container"),header:W.down("div.container div.header"),title:W.down("div.container div.header h3.title"),caption:W.down("div.container div.header p.caption"),main:W.down("div.container div.main"),content:W.down("div.container div.main div.content"),footer:W.down("div.container div.footer"),close:W.down("div.container div.header a.close_button"),overlapping:$$("select","embed","object")};};var N=function(){if(C){return A;}if(A){return true;}M();var W=Object.values(B);A=!(W.include(null)||W.include(undefined));return A;};var R=function(){if(!S.container){S.container=B.container.getDimensions();}if(!S.main){S.main=B.main.getDimensions();}if(!S.loading){S.loading=B.loading.getDimensions();}if(!S.hspace){S.hspace=2*parseInt(B.main.getStyle("padding-left").replace("px",""));}if(!S.vspace){S.vspace=B.header.getHeight()+B.footer.getHeight();}var W={container:{style:"top:#{top}px; left:#{left}px; width:#{width}px; height:#{height}px;"},main:{style:""}};W.viewport=Object.extend(document.viewport.getScrollOffsets(),document.viewport.getDimensions());W.viewport.margin=10;W.container.height=S.main.height+S.vspace;W.container.width=S.main.width;if(W.container.height>W.viewport.height){W.container.height=W.viewport.height;}W.container.top=Math.floor(W.viewport.top+W.viewport.height/2-W.container.height/2);W.container.left=Math.floor(W.viewport.left+W.viewport.width/2-W.container.width/2);if(W.viewport.width-W.container.width<2*W.viewport.margin){W.container.width=W.viewport.width-2*W.viewport.margin;W.container.left=W.viewport.margin;W.main.width=W.container.width-S.hspace;W.main.style+="width:#{width}px !important;";}if(W.viewport.height-W.container.height<2*W.viewport.margin){W.container.height=W.viewport.height-2*W.viewport.margin;W.container.top+=W.viewport.margin;W.main.height=W.container.height-S.vspace;W.main.style+="height:#{height}px !important;";}if(W.container.top<W.viewport.margin){W.container.top=W.viewport.margin;}if(W.container.left<W.viewport.margin){W.container.left=W.viewport.margin;}B.container.writeAttribute("style",W.container.style.interpolate(W.container));B.main.writeAttribute("style",W.main.style.interpolate(W.main));B.loading.setStyle({top:Math.floor(W.viewport.top+W.viewport.height/2-S.loading.height/2)+"px",left:Math.floor(W.viewport.left+W.viewport.width/2-S.loading.width/2)+"px"});};var U=function(){if(!A){return ;}var W=document.viewport.getWidth();var X=$(document.body).getHeight();B.lightbox.setStyle({height:X+"px",width:W+"px"});};var P=function(Y){var Z;var b=Y.getAttribute("title")||"::";b=b.split("::");if(b.length>=1){B.title.innerHTML=b[0];}if(b.length>=2){B.caption.innerHTML=b[1];}switch(L.type){case"iframe":Z=new Element("iframe",{"class":"frame",src:$(Y).href,frameBorder:0,hspace:0,scrolling:"auto"});G=Z;break;case"inline":var W=Y.href.split("#");if(W.length>=2){var a=$(W[1]);Z=new Element("div",{"class":"inline"}).update(a.innerHTML);}break;case"flash":var X="<object class='flash' pluginspage='http://www.adobe.com/go/getflashplayer' wmode='transparent' quality='high' type='application/x-shockwave-flash' data='#{src}'><param value='#{src}' name='movie'/><param value='true' name='allowFullScreen'/></object>";Z=X.interpolate({src:Y.href});break;}if(!Z){return ;}setTimeout(function(){B.content.insert(Z);L.opened();},500);};var T=function(){if(!A){return ;}if(G){G=null;}B.content.innerHTML="";B.loading.show();V();setTimeout(L.hidden,100);D=false;H++;};var F=function(){if(!A){return ;}B.overlapping.invoke("setStyle","visibility: visible");B.lightbox.hide();B.main.removeClassName(L.className);if(G){G.src="javascript:false";setTimeout(T,10);}else{T();}};var Q=function(W){if(!A){return ;}if(D){F();}U();B.overlapping.invoke("setStyle","visibility: hidden");B.lightbox.show();B.main.addClassName(L.className);R();B.container.hide();Effect.Appear(B.container,{duration:0.5});P(W);J();D=true;E++;};var I=function(W){setTimeout(F,100);Event.stop(W);return false;};var O=function(W){R();U();};J=function(){if(!A){return ;}B.close.observe("click",I);Event.observe(window,"resize",O);};V=function(){if(!A){return ;}B.close.stopObserving("click",I);Event.stopObserving(window,"resize",O);};this.show=function(W){Q(W);};this.hide=function(){F();};this.applyListeners=function(){J();};this.removeListeners=function(){V();};N();};})();EzRez.UI.Expander=function(H){var E=$H({outer_classnames:["outer_container"],inner_classname:"inner_container"}).merge(H).toObject();var F="div.show_more";var L="a.open";var I="a.close";var J="first";var M="last";var C="opened";var B=E.inner_classname;var G=E.outer_classnames;if(G.size()===0){throw ("EzRez.UI.ShowMore missing required classnames");}if($$(G[0]).size()===0){throw ("EzRez.UI.ShowMore missing required classnames");}if($$(G[0]+" "+B).size()===0){throw ("EzRez.UI.ShowMore missing required classnames");}var D=function(O){var P=$(O);G.each(function(R){var Q=P.up(R);if(Q!==undefined){Q.addClassName(C);}});P.hide();P.adjacent(I).each(function(Q){Q.show();});};var A=function(O){var P=$(O);G.each(function(R){var Q=P.up(R);if(Q!==undefined){Q.removeClassName(C);}});P.hide();P.adjacent(L).each(function(Q){Q.show();});};var N=function(O){D(O.target);Event.stop(O);return false;};var K=function(O){A(O.target);Event.stop(O);return false;};this.open=function(O){D(O);};this.close=function(O){A(O);};this.applyListeners=function(){var O=G.reverse(false).concat([F,L]).join(" ");var P=G.reverse(false).concat([F,I]).join(" ");EzRez.Util.Profiler.start("EzRez.UI.Expander applyListeners "+O);$$(O).each(function(Q){Q.observe("click",N);});EzRez.Util.Profiler.stop("EzRez.UI.Expander applyListeners "+O);EzRez.Util.Profiler.start("EzRez.UI.Expander applyListeners "+P);$$(P).each(function(Q){Q.observe("click",K);});EzRez.Util.Profiler.stop("EzRez.UI.Expander applyListeners "+P);};this.removeListeners=function(){var O=G.reverse(false).concat([F,L]).join(" ");var P=G.reverse(false).concat([F,I]).join(" ");$$(O).each(function(Q){Q.stopObserving("click",N);});$$(P).each(function(Q){Q.stopObserving("click",K);});};this.hideUnnecessaryLinks=function(O){O=(!O||O.length===0)?$$(G.last()+" "+G.first()):O;O.each(function(P){var V=P.down(B);if(!V){return ;}var R=V.select("p");var U=R.findAll(function(X){var W=(X.innerHTML.strip().length==0);if(W){X.hide();return false;}return X.visible();});var T=U.first();if(T){T.addClassName(J);}var Q=U.last();if(Q){Q.addClassName(M);}var S=P.down(F+" a");if(V.getHeight()<=P.getHeight()){S.hide();}else{S.show();}});};};EzRez.UI.Sorter=function(A){var B=$H({elements:null}).merge(A).toObject();var D=B.elements;var C=function(){D=null;};this.sortBy=function(F,E){E=(E===undefined)?true:E;D=D.sortBy(function(H){if(Object.isElement(H)){H=H.identify();}return F(H);});if(!E){D.reverse();}var G=D.first();if(!Object.isElement(G)){G=$(G);}D.slice(1,D.length).each(function(H){if(!Object.isElement(H)){H=$(H);}G.insert({after:H});G=H;});G=null;return D;};this.setElements=function(E){D=E;};this.getElements=function(){return D;};this.unload=function(){C();};};EzRez.UI.MultiAutoComplete=function(C){var D=$H({name:null,maxInputs:0}).merge(C).toObject();var B=D.name;if(!$(B)||!$(B+"_auto")){throw new EzRez.Util.Exception({message:"Missing element for EzRez.UI.AutoComplete."});}var E=new FacebookList(B,B+"_auto",{maxInputs:D.maxInputs,startinput:false,extrainputs:false});this.loadAirportsFromSelect=function(F){if(!F){F=$(B+"_select");}if(!F){throw new EzRez.Util.Exception({message:"Missing SELECT input for EzRez.UI.AutoComplete."});}var G=[];F.select("option").each(function(H){var I={caption:H.innerHTML,value:H.value,selected:false};if(H.readAttribute("selected")){E.add(I);I.selected=true;}E.autoFeed(I);G.push(I);});return G;};function A(F){if(F.selected){E.add(F);}E.autoFeed(F);}this.loadAirportsFromArray=function(F){var G=F.concat([]);var H=function(){var I=G.shift();A(I);if(G.length>0){setTimeout(H,100);}};setTimeout(H,100);};this.getFacebookList=function(){return E;};this.update=function(){E.update();};this.getValues=function(){E.update();return $F(B);};};EzRez.UI.DOMCache=function(F){var I=$H({rootNode:"",nodes:{}}).merge(F).toObject();var C=$H();var G=false;var E=null;var J=[];var D=this;var A=function(M,L){C.set(M,{name:M,selector:L});};var H=function(){$H(I.nodes).each(function(L){A(L.key,L.value);});};var K=function(L){try{var N=Object.isElement(L.selector)?L.selector:L.selector(E);if(!N){J.push(L.name);G=false;}L.elm=N;D[L.name]=L.elm;}catch(M){J.push(L.name);G=false;}return L;};var B=function(){try{E=$$(I.rootNode).first();D.rootNode=E;G=Object.isElement(E);C.each(function(M){K(M.value);});return G;}catch(L){J.push("rootNode: "+I.rootNode);G=false;return false;}};this.rootNode=E;this.add=function(M,L){A(M,L);};this.get=function(L){return C.get(L).elm;};this.refresh=function(L){var M=C.get(L);K(M);return M.elm;};this.cache=function(){return B();};this.clearAll=function(){E=null;C.each(function(L){L.value.elm=null;});};this.isValidHtml=function(){return G;};this.getInvalidNodes=function(){return J;};H();};(function(){var C=["af-ZA","ar-AE","ar-BH","ar-DZ","ar-EG","ar-IQ","ar-JO","ar-KW","ar-LB","ar-LY","ar-MA","ar-OM","ar-QA","ar-SA","ar-SY","ar-TN","ar-YE","az-Cyrl-AZ","az-Latn-AZ","be-BY","bg-BG","bs-Latn-BA","ca-ES","cs-CZ","cy-GB","da-DK","de-AT","de-CH","de-DE","de-LI","de-LU","dv-MV","el-GR","en-029","en-AU","en-BZ","en-CA","en-GB","en-IE","en-JM","en-NZ","en-PH","en-TT","en-US","en-ZA","en-ZW","es-AR","es-BO","es-CL","es-CO","es-CR","es-DO","es-EC","es-ES","es-GT","es-HN","es-MX","es-NI","es-PA","es-PE","es-PR","es-PY","es-SV","es-UY","es-VE","et-EE","eu-ES","fa-IR","fi-FI","fo-FO","fr-BE","fr-CA","fr-CH","fr-FR","fr-LU","fr-MC","gl-ES","gu-IN","he-IL","hi-IN","hr-BA","hr-HR","hu-HU","hy-AM","id-ID","is-IS","it-CH","it-IT","ja-JP","ka-GE","kk-KZ","kn-IN","kok-IN","ko-KR","ky-KG","lt-LT","lv-LV","mi-NZ","mk-MK","mn-MN","mr-IN","ms-BN","ms-MY","mt-MT","nb-NO","nl-BE","nl-NL","nn-NO","ns-ZA","pa-IN","pl-PL","pt-BR","pt-PT","quz-BO","quz-EC","quz-PE","ro-RO","ru-RU","sa-IN","se-FI","se-NO","se-SE","sk-SK","sl-SI","sma-NO","sma-SE","smj-NO","smj-SE","smn-FI","sms-FI","sq-AL","sr-Cyrl-BA","sr-Cyrl-CS","sr-Latn-BA","sr-Latn-CS","sv-FI","sv-SE","sw-KE","syr-SY","ta-IN","te-IN","th-TH","tn-ZA","tr-TR","tt-RU","uk-UA","ur-PK","uz-Cyrl-UZ","uz-Latn-UZ","vi-VN","xh-ZA","zh-CN","zh-HK","zh-MO","zh-SG","zh-TW","zu-ZA"];var F=$H();var B="mm/dd/yyyy";var D="mm/yyyy";var A=EzRez.path+"/ezrez/js/locales/date/";var E=function(H,J){try{var G=null;if(H.blank()){return false;}if(J){G=Date.parseExact(H,J.replace(/m/g,"M"));}else{G=Date.parse(H);}return(G);}catch(I){return false;}};EzRez.UI.Calendar=function(M){var N=$H({name:"CalendarFormInput",dateFormat:"mm/dd/yy",pages:2,advanceOnSelect:true,locale:"en-US",minDate:null,maxDate:null}).merge(M).toObject();var e;var S=false;var G={container:null};var U="";var X=[];var h=false;var k=document.viewport.getWidth();var J=-1;if(Object.isString(N.minDate)){N.minDate=Date.parse(N.minDate);}if(Object.isString(N.maxDate)){N.maxDate=Date.parse(N.maxDate);}var V=function(n,p){try{if(Object.isString(n)){if(p){n=Date.parseExact(n,p.replace(/m/g,"M"));}else{n=Date.parse(n);}}else{if(Object.isArray(n)){n=Date.parse(n[1]+"/"+n[2]+"/"+n[0]);}}}catch(o){n=null;}return n;};var a=function(o){var n=V(o,N.dateFormat);if(!n){return o;}return n.format(B);};var Z=function(o){var n=V(o,N.dateFormat);if(!n){return o;}return n.format(N.dateFormat);};var m=function(o,p,q){o=V(o,N.dateFormat);p=V(p,N.dateFormat);q=V(q,N.dateFormat);var n=[o,p,q].compact().first();if(!o){return n;}if(!p&&!q){return o;}if(q&&!p){return o.isBefore(q)?o:q;}if(p&&!q){return o.isAfter(p)?o:p;}if(o.between(p,q)){return o;}if(o.isAfter(q)){return q;}if(o.isBefore(p)){return p;}};var O=function(o,p,n){e.cfg.setProperty(o,p,n);};var I=function(n){return e.cfg.getProperty(n);};var g=function(n){if(!C.include(n)){g("en-US");return ;}N.locale=n;var p=A+n+".js";var o=YAHOO.util.Get.script(p,{onSuccess:function(){var q=EzRez.Util.Locales.get(n);if(!q||q.name!==n){return ;}O("MONTHS_SHORT",q.abbreviatedMonthNames);O("MONTHS_LONG",q.monthNames);O("WEEKDAYS_1CHAR",q.firstLetterDayNames);O("WEEKDAYS_SHORT",q.shortestDayNames);O("WEEKDAYS_MEDIUM",q.abbreviatedDayNames);O("WEEKDAYS_LONG",q.dayNames);O("START_WEEKDAY",q.firstDayOfWeek);e.render();}});};var R=function(){G.container=$(N.name);e=new YAHOO.widget.CalendarGroup(N.name,{pages:N.pages});O("hide_blank_weeks",true);if(N.minDate){O("mindate",N.minDate);}if(N.maxDate){O("maxdate",N.maxDate);}g(N.locale);S=true;};var Q=function(n){U=n;};var j=function(n){X=n;};var P=function(n,o){if(!e[n]){return ;}e[n].subscribe(o,this,true);};var Y=function(n,o){if(!e[n]){return ;}e[n].unsubscribe(o,this,true);};var H=function(n){var o=e.getCalendarPage(m(n));if(o){return true;}return false;};var c=function(n){if(Object.isString(n)&&n.include(",")){var p=n.split(",").map(function(q){q=m(q,I("mindate"),I("maxdate"));if(q){q=q.format(B);}return q;}).compact();if(N.advanceOnSelect||!H(p.first())){O("pagedate",p.first());}O("selected",p.join(","));return ;}n=m(n,null,null);if(N.advanceOnSelect){var o=I("mindate");if(!n&&o){O("pagedate",o);return ;}if(!n&&!o){O("pagedate",new Date());return ;}}n=m(n,I("mindate"),I("maxdate"));O("selected",a(n));if(N.advanceOnSelect||!H(n)){O("pagedate",n);}};var W=function(){var n=e.getSelectedDates();return n.map(function(o){return Z(o,N.dateFormat);}).join(",");};var L=function(){e.removeRenderers();e.addRenderer(U,e.renderOutOfBoundsDate);X.each(function(n){e.addWeekdayRenderer(n,e.renderOutOfBoundsDate);});};var K=function(){L();e.render();e.show();h=true;};var T=function(){e.hide();h=false;};var l=function(p,n){var r=Object.extend(p.cumulativeOffset(),p.getDimensions());var o={right:{top:r.top+"px",left:r.left+r.width+"px"},bottom:{top:r.top+r.height+"px",left:r.left+"px"},fixed:{}};var q=o[n];if(!q){q=o.right;}G.container.setStyle(q);K();};var b=function(){k=document.viewport.getWidth();};var f=function(){var n=G.container.cumulativeOffset();if(J<0){J=G.container.getDimensions();}var o=(n.left+J.width)-k;if(o>0){var p=(n.left-o)+"px";G.container.setStyle({left:p});}};this.shiftCalendarIntoViewPort=function(){f();};this.show=function(){K();};this.hide=function(){T();};this.position=function(o,n){l(o,n);};this.setBlackoutDates=function(n){Q(n);};this.setBlackoutDaysOfTheWeek=function(n){return j(n);};this.setLocale=function(n){g(n);};this.setProperty=function(o,p,n){O(o,p,n);};this.setEvent=function(n,o){P(n,o);};this.getProperty=function(n){return I(n);};this.removeEvent=function(n,o){Y(n,o);};this.observe=function(n,o){P(n,o);};this.stopObserving=function(n,o){Y(n,o);};this.setSelectedDate=function(n){c(n);};this.getSelectedDates=function(){return W();};this.getValidDate=function(n){return m(n,N.minDate,N.maxDate);};this.setDateFormat=function(n){N.dateFormat=n;};this.getYuiCalendar=function(){return e;};this.getConfig=function(){return N;};this.getElements=function(){return G;};this.getContainerId=function(){return e.containerId;};R();Event.observe(window,"resize",b);};EzRez.UI.CalendarFormInput=function(J){EzRez.UI.Calendar.apply(this,arguments);var V={show:this.show,setSelectedDate:this.setSelectedDate,getSelectedDates:this.getSelectedDates,position:this.position,setProperty:this.setProperty,getProperty:this.getProperty,getValidDate:this.getValidDate,positionWithinViewport:this.shiftCalendarIntoViewPort,getElements:this.getElements};var Y=$H({inputs:[],position:"right",disableInputMinDate:false}).merge(J).toObject();var K=this.getConfig();K.inputs=Y.inputs;K.position=Y.position;var T=this.getYuiCalendar();var Q;var P=[];var S=[];var U=false;var Z;var N=false;var M=function(){P=[];K.inputs.uniq().each(function(a){var b=$$(a).first();if(!b){return ;}P.push(b);S.push(b.identify());});N=true;};var I=function(a){Q=a.identify();var b=S.indexOf(Q);var c=P[b-1];T.deselectAll();if(K.minDate){V.setProperty("mindate",K.minDate);}if(K.maxDate){V.setProperty("maxdate",K.maxDate);}if(c&&b>0&&!K.disableInputMinDate){var e=P.slice(0,b).invoke("getValue").reverse().find(function(f){return f.match(/[0-9]{2,4}\/[0-9]{2,4}\/[0-9]{2,4}/)!==null;});if(E(e,K.dateFormat)){V.setProperty("mindate",V.getValidDate(e));}}V.setSelectedDate(a.getValue());V.position(a,K.position);V.positionWithinViewport();if(!U){document.observe("click",Z);}U=true;};var O=function(){T.hide();};var H=function(a){if(!a){throw new EzRez.Util.Exception({message:"Missing input for EzRez.UI.CalendarFormInput."});}a.setValue(V.getSelectedDates());};var R=function(b){if(!N){K.inputs.push(b);return ;}if(S.include(b)){return ;}var a=$(b);if(!a){return ;}P.push(a);S.push(b);a.observe("click",W);};var X=function(){P.each(function(a){a.stopObserving("click",W);});P=[];S=[];};Z=function(a){console.info("_documentClickListener");var b=$(a.target);if(P.include(b)){return ;}if(b.descendantOf(V.getElements().container)){return ;}O();};var G=function(){O();H($(Q));};var L=function(){U=false;document.stopObserving("click",Z);console.info("_hideCalendar");};var W=function(a){var b=$(a.target);I(b);};this.show=function(a){if(!Object.isElement(a)){a=$(a);}I(a);};this.addInput=function(a){R(a);};this.clearInputs=function(){X();};this.setPosition=function(a){K.position=a;};this.positionWithinViewport=function(){K.shiftCalendarIntoViewPort();};this.applyListeners=function(){P.each(function(a){a.observe("click",W);});T.selectEvent.subscribe(G,this,true);T.hideEvent.subscribe(L,this,true);};this.removeListeners=function(){P.each(function(a){a.stopObserving("click",W);});};M();};EzRez.UI.Calendar.getLocales=function(G){var H=0;C.each(function(K){var J=A+K+".js";var I=YAHOO.util.Get.script(J,{onSuccess:function(){var L=EzRez.Util.Locales.get(K);if(!L||L.name!==K){H++;}else{F.set(K,L);}if(F.size()===C.length-H){G(F);}}});});};EzRez.UI.FormValidator=function(L){var M=Object.extend({formName:""},L);var N;var G=[];var I=[];var J=function(){N=$(document.body).down('form[name="'+M.formName+'"]');};var K=function(){I.each(function(R){R.inputs.each(function(S){S.removeClassName("invalid");});});I=[];};var P=function(R){var S=[];K();G.each(function(U){U.inputs=U.inputNames.collect(function(V){return R[V];});var T=U.validator(U.inputs);if(!T){T=U.onFailure(U,I);}else{T=U.onSuccess();}S.push(T);});return S.compact().all();};var O=function(R){var V=true;K();var T=$(R.target);var U=Event.findElement(R,"form");var S=T.readAttribute("name");G.each(function(X){if(X.event==="blur"&&X.inputNames.include(S)){X.inputs=X.inputNames.collect(function(Y){return U[Y];});var W=X.validator(X.inputs);if(!W){W=X.onFailure(X,I);}else{W=X.onSuccess();}V=W;}});if(!V){Q();}};var Q=function(){if(!I.first()||!I.first().message){return ;}alert(I.first().message);try{I.first().inputs.first().focus();}catch(R){}};var H=function(R){var S=$(R.target);if(!P(S)){Event.stop(R);Q();}};this.getResults=function(){return I;};this.highLightInvalidFields=function(R){I.each(function(S){S.inputs.each(function(T){T.addClassName("invalid");});});};this.validate=function(){if(!P(N)){Q();return false;}return true;};this.validateAndSubmit=function(){if(!P(N)){Q();return ;}N.submit();};this.addRule=function(R){var S=Object.extend({inputNames:[],message:"",event:"submit",validator:function(T){},onFailure:function(U,T){T.push({inputs:U.inputs,message:U.message});return false;},onSuccess:function(){return true;}},R);G.push(S);};this.applyListeners=function(){N.observe("submit",H);N.select("input").each(function(R){if(R.type=="checkbox"){R.observe("click",O);}else{if(R.type=="button"){R.observe("click",O);}else{R.observe("blur",O);}}});N.select("select").each(function(R){R.observe("blur",O);});};J();};EzRez.UI.FormValidator.Validators={};EzRez.UI.FormValidator.Validators.hasValue=function(G){var H=G.collect(function(I){var J=I.getValue();if(J==null||J.blank()){return false;}else{return true;}});return H.compact().all();};EzRez.UI.FormValidator.Validators.isValidDOBPullDownsYMD=function(G){if(!EzRez.UI.FormValidator.Validators.hasValue(G)){return false;}var L=G[0].value;var I=G[1].value;var K=G[2].value;var H=new Date();var J=new Date(H.getTime());J.setFullYear(L,I-1,K);return(J<=H);};})();EzRez.UI.FormErrors=new function(){var A=$H();this.addError=function(B,C){A.set(B,C);};this.removeError=function(B){A.unset(B);};this.hasErrors=function(){return A.size()>0;};this.hasErrorKey=function(B){return A.get(B)!=null;};this.clearAll=function(){A=$H();};this.submitFormIfNoErrors=function(B){if(A.size()==0){$(B).submit();}A.keys().each(function(C){if(C=="checkbox"){C="malibu_error";}new Effect.Highlight(C,{duration:0.75});});};};if(EzRez===undefined){throw ("ezrez-app.js requires ezrez.js");}if(EzRez.Util===undefined){throw ("ezrez-app.js requires ezrez-util.js");}if(EzRez.UI===undefined){throw ("ezrez-app.js requires ezrez-ui.js");}EzRez.App={};EzRez.App.Messenger=new function(){var B=$H();this.begin=function(E,C){var D=$H({onEnd:null,keep:false}).merge(C).toObject();EzRez.Util.Profiler.start("Message "+E+".");B.set(E,{data:new Array(),ended:false,onEnd:D.onEnd,keep:D.keep});};this.write=function(C,D){var E=B.get(C);if(E===undefined){return ;}if(E.ended){return ;}E.data.push(D);B.set(C,E);};var A=function(D,C){var E=B.get(D);if(C===undefined){C=false;}if(E===undefined){return ;}if(!E.ended){return ;}if(!C&&!E.keep){B.unset(D);}return E.data;};this.read=function(D,C){return A(D,C);};this.end=function(C){var E=B.get(C);E.ended=true;if(E.onEnd!=null){var D=A(C,E.keep);E.onEnd(D);}EzRez.Util.Profiler.stop("Message "+C+".");};};EzRez.App.Page=function(F){var C=$H({create:function(){},loading:function(){},complete:function(){},validate:function(){return true;},error:function(){},exception:function(){},parent:null}).merge(F).toObject();var E=C.parent;var I=C.create;var B=C.loading;var D=C.complete;var G=C.validate;var H=C.error;var A=C.exception;this.create=function(){return I;};this.loading=function(){return B;};this.complete=function(){return D;};this.validate=function(){return G;};this.error=function(){return H;};this.exception=function(){return A;};this.updater=function(K,M,L){var J=$H({asynchronous:true,evalScripts:true,method:"get",parameters:null}).merge(L).toObject();new Ajax.Updater(K,M,{asynchronous:J.asynchronous,evalScripts:J.evalScripts,method:J.method,parameters:J.parameters,onCreate:function(N){I(N);if(E!=null){E.loading(N);}},onLoading:function(N){B(N);if(E!=null){E.loading(N);}},onComplete:function(N){D(N);if(E!=null){E.complete(N);E.applyPageBehaviors();}},onError:function(N){H(N);if(E!=null){E.error(N);}},onException:function(O,N){A(O,N);if(E!=null){E.exception(O,N);}}});};};(function(){var A;EzRez.App.Widget=function(B){var C=$H({loading:function(){},complete:function(){},error:function(){},exception:function(){}}).merge(B).toObject();A=$H();this.loading=C.loading;this.complete=C.complete;this.error=C.error;this.exception=C.exception;};EzRez.App.Widget.prototype={updateElementID:null,complete:null,loading:null,error:null,createPage:function(C,B){B.parent=this;var D=new EzRez.App.Page(B);A.set(C,D);},getPage:function(B){return A.get(B);},getPages:function(){return A;},onPageComplete:function(B){A.get(B).complete()();},updatePage:function(B,D,C){A.get(B).updater(this.updateElementID,D,C);},applyPageBehaviors:function(){A.each(function(F){var B=F.key;var D=F.value;var E="a.GoTo_"+B.strip();var C="form.GoTo_"+B.strip();$$(E).each(function(G){D.action_elm=G;G.observe("click",function(H){if(!D.validate()()){Event.stop(H);return false;}D.updater(this.updateElementID,G.href);Event.stop(H);return false;}.bindAsEventListener(this));}.bind(this));$$(C).each(function(G){D.action_elm=G;G.observe("submit",function(H){if(!D.validate()()){Event.stop(H);return false;}D.updater(this.updateElementID,G.action,{method:G.method,parameters:G.serialize()});Event.stop(H);return false;}.bindAsEventListener(this));}.bind(this));}.bind(this));}};})();EzRez.App.DOMController=function(E){var B=$H(E);var I=$H();var C=this;var A=new Array();var G=0;var D=null;var J=function(P){var N=P.split(",");var M=N[0];var O=N[1];if(Object.isString(M)){M=M.strip();}if(Object.isString(O)){O=O.strip();}return{selector:M,event:O};};var F=function(M,N){return M+"_"+N;};var L=function(M,O,R){if(M==="before"||M=="after"){return ;}var Q;var N=F(M,O);var P=I.get(N);if(!P){P=function(S){var T=O+": "+M;var U=EzRez.Util.Profiler.start(T);var V=R(S,C);U.stop();return V;};I.set(N,P);}if(M==="window"){Event.observe(window,O,P);return ;}if(M==="document"){document.observe(O,P);return ;}Q=(D===null)?$$(M):D.select(M);Q.each(function(S){S.observe(O,P);});};var K=function(M,O){if(M==="before"||M=="after"){return ;}var N;var Q;var P;if(M==="window"){N=F(M,O);Q=I.get(N);Event.stopObserving(window,O,Q);return ;}if(M==="document"){N=F(M,O);Q=I.get(N);document.stopObserving(O,Q);return ;}P=(D===null)?$$(M):D.select(M);P.each(function(T){var R=F(M,O);var S=I.get(R);T.stopObserving(O,S);});};var H=function(){I=null;B=null;};this.unload=function(){H();};this.setActions=function(M){B=$H(M);this.applyActions();};this.addAction=function(N,M){B.set(N,M);};this.applyAction=function(P,N){D=($(N))?$(N):null;var M=J(P);var O=B.get(P);if(O===undefined){return ;}L(M.selector,M.event,O);};this.applyActions=function(M){D=($(M))?$(M):null;EzRez.Util.Profiler.start("ApplyListeners  "+G);var N=B.get("before");var P=B.get("after");EzRez.Util.Profiler.start("    ApplyListeners  "+G+" Before");if(N!=undefined){try{N(C);}catch(O){A.push(O);}}EzRez.Util.Profiler.stop("    ApplyListeners  "+G+" Before");EzRez.Util.Profiler.start("    ApplyListeners  "+G+" Each");B.each(function(R){try{var Q=J(R.key);EzRez.Util.Profiler.start("        ApplyListeners  "+G+" "+R.key);L(Q.selector,Q.event,R.value);EzRez.Util.Profiler.stop("        ApplyListeners  "+G+" "+R.key);}catch(S){A.push(S);}});EzRez.Util.Profiler.stop("    ApplyListeners  "+G+" Each");EzRez.Util.Profiler.start("    ApplyListeners  "+G+" After");if(P!=undefined){try{P(C);}catch(O){A.push(O);}}EzRez.Util.Profiler.stop("    ApplyListeners  "+G+" After");if(A.size()>0){A.each(function(Q){throw (Q);});}EzRez.Util.Profiler.stop("ApplyListeners  "+G);G++;};this.removeAction=function(P,N){D=($(N))?$(N):null;var O=B.get(P);var M=J(P);if(O===undefined){return ;}K(M.selector,M.event,O);};this.removeActions=function(M){D=($(M))?$(M):null;B.each(function(O){var N=J(O.key);K(N.selector,N.event,O.value);});};this.getAction=function(M){return B.get(M);};this.extend=function(M){var N=new EzRez.App.DOMController(B.merge(M));N.uber=function(O){return B.get(O);};return N;};this.uber=function(M){return B.get(M);};this.get=function(){return this;};Event.observe(window,"unload",H);};EzRez.App.UIComponent=function(A){var C=$H({initialize:function(){},applyListeners:function(){},removeListeners:function(){},unload:function(){}}).merge(A).toObject();var B=null;var D=false;var E=false;this.initialize=function(F){if(D){return ;}B=C.initialize(F);D=true;};this.applyListeners=function(){if(E){return ;}C.applyListeners(B);E=true;};this.removeListeners=function(){if(!E){return ;}C.removeListeners(B);E=false;};this.unload=function(){C.unload(B);};this.get=function(){return B;};this.isInitialized=function(){return D;};this.areListenersApplied=function(){return E;};};EzRez.App.Application=function(){var B=$H();var E=$H();var I=[];var A=[];var J=false;var D=false;var K=[];var H=$H();var C=[];var G=function(L,M){if(M&&!J){I.push(L);}else{L();C.each(function(N){throw N;});C=[];}};var F=function(){C.each(function(L){new EzRez.Util.Exception({},L);});C=[];};this.createDOMController=function(M,N){var L=new EzRez.App.DOMController(N);B.set(M,L);L.requires=function(O){this.requires(M,O);}.bind(this);return L;};this.createAJAXConroller=function(L,M){};this.createUIComponent=function(M,N){var L=new EzRez.App.UIComponent(N);E.set(M,L);L.requires=function(O){this.requires(M,O);}.bind(this);return L;};this.loadDOMController=function(M,P,O){O=(O===undefined)?true:O;var L=B.get(M);if(!L){return ;}var N=function(){try{if(K.include(M)){return ;}var Q=EzRez.Util.Profiler.start("Loaded "+M+" DOMController");L.applyActions();K.push(M);Q.stop();}catch(R){C.push(R);}};G(N,O);};this.loadUIComponent=function(M,P,O){O=(O===undefined)?true:O;var L=E.get(M);if(!L){return ;}var N=function(){try{if(K.include(M)){return ;}var Q=EzRez.Util.Profiler.start("Loaded "+M+" UIComponent");L.initialize(P);L.applyListeners();K.push(M);Q.stop();}catch(R){C.push(R);}};G(N,O);};this.loadAJAXConroller=function(L,N,M){};this.getUIComponent=function(L){return E.get(L);};this.getDOMController=function(L){return B.get(L);};this.getAJAXConroller=function(L){};this.use=function(M){var L=E.get(M);if(!L){return null;}return L.get();};this.getClientScript=function(L){var N=Object.extend({dsn:null,cobrand:null,file:null,onSuccess:function(){},onFailure:function(){}},L);var O={};if(N.dsn){O.dsn=N.dsn;}if(N.cobrand){O.cobrand=N.cobrand;}if(N.file){O.page=N.file;}var M="/service/clientjs.cfm?"+Object.toQueryString(O);YAHOO.util.Get.script(M,{onSuccess:function(P){EzRez.Util.Debug.info("Loaded "+M+".");N.onSuccess(P);},onFailure:function(P){EzRez.Util.Debug.error("Failed to load "+M+".");N.onFailure(P);},scope:window});};this.requires=function(L,N){var M=H.get(L);if(M){M=M.concat(N).uniq();H.set(L,M);return ;}H.set(L,N);};this.load=function(L,O,N){N=(N===undefined)?true:N;var M=H.get(L);if(M){M.each(function(P){this.load(P,{},N);}.bind(this));}this.loadDOMController(L,O,N);this.loadUIComponent(L,O,N);this.loadAJAXConroller(L,O,N);};this.unload=function(M){K=K.without(M);var L=E.get(M);if(!L){return ;}L.unload();};this.domload=function(L){G(L,true);};this.isDOMLoaded=function(){return J;};this.isWindowLoaded=function(){return D;};this.Message=EzRez.App.Messenger;this.Temp=$H();this.Profile=EzRez.Util.Profiler;this.Debug=EzRez.Util.Debug;this.Cookie=EzRez.Util.Cookie;this.Env=EzRez.Util.Env;this.Omniture=EzRez.Util.Omniture;this.WebAnalytics=EzRez.Util.WebAnalytics;this.SysConf=new EzRez.WebApi.SysConf({});this.WebContext=new EzRez.WebApi.WebContext({});this.TravelerProfile=new EzRez.WebApi.TravelerProfile({});this.RedemptionContract=new EzRez.WebApi.RedemptionContract({});this.Search=new EzRez.WebApi.Search({});this.Availability=new EzRez.WebApi.Availability({});this.Itinerary=new EzRez.WebApi.Itinerary({});this.Booking=new EzRez.WebApi.Booking({});this.Agent=new EzRez.WebApi.Agent({});this.FormErrors=EzRez.UI.FormErrors;document.observe("dom:loaded",function(){EzRez.Util.Profiler.stop("dom:load");J=true;I.each(function(M){M();});var L=new PeriodicalExecuter(function(){if(EzRez.Application.SysConf.isActiveSession()){return ;}L.stop();document.fire("ezrez:sessionExpired");},5);EzRez.Util.WebAnalytics.transmitWebBeacons();EzRez.Util.WebAnalytics.GA.trackPageview();EzRez.Util.WebAnalytics.GA.trackTrans();F();});Event.observe(window,"load",function(L){EzRez.Util.Profiler.stop("window:load");D=true;A.each(function(M){M();});F();}.bindAsEventListener(this));};if(EzRez===undefined){throw ("ezrez-webapi.js requires ezrez.js");}if(EzRez.Util===undefined){throw ("ezrez-webapi.js requires ezrez-util.js");}if(EzRez.UI===undefined){throw ("ezrez-webapi.js requires ezrez-ui.js");}if(EzRez.App===undefined){throw ("ezrez-webapi.js requires ezrez-app.js");}EzRez.WebApi={};(function(){var B="$Revision: 43474 $".match(/^\$Revision: (\d+) \$$/);var A=1;EzRez.WebApi.revision=B[1];EzRez.WebApi.Base=function(D){var C=Object.extend({_ezrezObjectKey:null},D);this.ezrezObjectKey=(!C._ezrezObjectKey)?"localObjectKey"+A++:C._ezrezObjectKey;};})();EzRez.WebApi.Address=function(B){var A=Object.extend({_addressLines:[],_city:"",_countryCode:"",_stateCode:"",_zip:""},B);EzRez.WebApi.Base.apply(this,arguments);this.addressLines=A._addressLines;this.city=A._city;this.countryCode=A._countryCode;this.stateCode=A._stateCode;this.zip=A._zip;};EzRez.WebApi.Price=function(B){var A=Object.extend({_maxPoints:0,_maxPointsTax:0,_taxTotal:0,_markup:0,_total:0,_currency:""},B);EzRez.WebApi.Base.apply(this,arguments);this.maxPoints=A._maxPoints;this.maxPointsTax=A._maxPointsTax;this.taxTotal=A._taxTotal;this.markup=A._markup;this.total=A._total;this.currency=A._currency;};EzRez.WebApi.Traveler=function(B){var A=Object.extend({_firstName:"",_lastName:"",_address:{}},B);EzRez.WebApi.Base.apply(this,arguments);this.firstName=A._firstName;this.lastName=A._lastName;this.address=new EzRez.WebApi.Address(A._address);};EzRez.WebApi.Room=function(B){var A=Object.extend({_name:"",_hotelName:"",_code:"",_description:"",_checkIn:"",_checkOut:"",_rateCode:"",_crsName:"",_airportCode:"",_hotelSharedId:0,_numNights:0,_numAdults:0,_numChildren:0,_numTravelers:0,_supplierId:0,_pricePartial:{},_address:{}},B);EzRez.WebApi.Base.apply(this,arguments);this.name=A._name;this.hotelName=A._hotelName;this.code=A._code;this.rateCode=A._rateCode;this.description=A._description;this.crsName=A._crsName;this.airportCode=A._airportCode;this.numNights=A._numNights;this.numAdults=A._numAdults;this.numChildren=A._numChildren;this.numTravelers=A._numTravelers;this.supplierId=A._supplierId;this.hotelSharedId=A._hotelSharedId;this.price=new EzRez.WebApi.Price(A._pricePartial);this.address=new EzRez.WebApi.Address(A._address);this.checkIn=new Date(Date.parseJSON(A._checkIn));this.checkOut=new Date(Date.parseJSON(A._checkOut));};EzRez.WebApi.Hotel=function(D){var A=Object.extend({_name:"",_sharedHotelId:0,_hotelCode:"",_supplierId:0,_connectorPreference:0,_neighborhoodId:0,_amenities:[],_address:{},_priceForFiltering:0,_geoLat:0,_geoLng:0,_rating:0,_compositeScore:0,_checkIn:"",_checkOut:"",_roomPartials:[],_crsName:"",_brandCode:"",_chainCode:"",_chainName:"",_airportCode:"",_pricePartial:{}},D);EzRez.WebApi.Base.apply(this,arguments);var C=$H();var B=function(){if(C.size()===0){var E=EzRez.Util.Profiler.start("EzRez.WebApi.Hotel ("+this.ezrezObjectKey+")::build rooms");A._roomPartials.each(function(F){var G=new EzRez.WebApi.Room(F);C.set(G.ezrezObjectKey,G);});E.stop();}};this.name=A._name;this.sharedId=A._sharedHotelId;this.code=A._hotelCode;this.supplierId=A._supplierId;this.connectorPreference=A._connectorPreference;this.neighborhoodId=A._neighborhoodId;this.amenities=A._amenities;this.priceForFiltering=A._priceForFiltering;this.price=new EzRez.WebApi.Price(A._pricePartial);this.lat=A._geoLat;this.lng=A._geoLng;this.rating=A._rating;this.compositeScore=A._compositeScore;this.checkIn=new Date(Date.parseJSON(A._checkIn));this.checkOut=new Date(Date.parseJSON(A._checkOut));this.address=new EzRez.WebApi.Address(A._address);this.crsName=A._crsName;this.airportCode=A._airportCode;this.brandCode=A._brandCode;this.chainCode=A._chainCode;this.chainName=A._chainName;this.getRooms=function(){B();return C.values();};this.getRoom=function(E){B();return C.get(E);};};EzRez.WebApi.Car=function(B){var A=Object.extend({_name:"",_code:"",_description:"",_airportCode:"",_companyCode:"",_companyName:"",_crsName:"",_pickupTime:"",_returnTime:"",_pricePartial:{}},B);EzRez.WebApi.Base.apply(this,arguments);this.name=A._name;this.code=A._code;this.description=A._description;this.airportCode=A._airportCode;this.companyCode=A._companyCode;this.companyName=A._companyName;this.crsName=A._crsName;this.pickupDate=new Date(Date.parseJSON(A._pickupTime));this.returnDate=new Date(Date.parseJSON(A._returnTime));this.price=new EzRez.WebApi.Price(A._pricePartial);};EzRez.WebApi.Activity=function(B){var A=Object.extend({_name:"",_activityProductId:0,_isAnyDateEvent:false,_numAdults:0,_numChildren:0,_numInfants:0,_crsName:"",_eventDateRangeEnd:"",_eventDateRangeBegin:"",_pricePartial:{}},B);EzRez.WebApi.Base.apply(this,arguments);this.name=A._name;this.productId=A._activityProductId;this.isAnyDateEvent=A._isAnyDateEvent;this.beginDate=new Date(Date.parseJSON(A._eventDateRangeBegin));this.endDate=new Date(Date.parseJSON(A._eventDateRangeEnd));this.price=new EzRez.WebApi.Price(A._pricePartial);this.numAdults=A._numAdults;this.numChildren=A._numChildren;this.numInfants=A._numInfants;this.crsName=A._crsName;};EzRez.WebApi.Flight=function(B){var A=Object.extend({_flightNumber:0,_departureAirportCode:"",_arrivalAirportCode:"",_fareClass:"",_cabin:"",_airlineCode:"",_departureTimestamp:"",_arrivalTimestamp:"",_supplierCode:"",_miles:-1,_durationMinutes:-1,_stops:0,_layoverDurationMinutes:-1,_hasLayover:false,_isBulk:false},B);EzRez.WebApi.Base.apply(this,arguments);this.flightNumber=A._flightNumber;this.departureAirportCode=A._departureAirportCode;this.arrivalAirportCode=A._arrivalAirportCode;this.fareClass=A._fareClass;this.cabin=A._cabin;this.isBulk=A._isBulk;this.airlineCode=A._airlineCode;this.supplierCode=A._supplierCode;this.miles=A._miles;this.stops=A._stops;this.layoverDurationMinutes=A._layoverDurationMinutes;this.hasLayover=A._hasLayover;this.departureTimestamp=new Date(Date.parseJSON(A._departureTimestamp));this.arrivalTimestamp=new Date(Date.parseJSON(A._arrivalTimestamp));this.durationMinutes=A._durationMinutes;};EzRez.WebApi.AirLeg=function(C){var B=Object.extend({_departureAirportCode:"",_arrivalAirportCode:"",_departureTimestamp:"",_arrivalTimestamp:"",_durationMinutes:-1,_stops:0,_airlines:[],_airSegmentPartialList:[]},C);EzRez.WebApi.Base.apply(this,arguments);var A=[];B._airSegmentPartialList.each(function(D){A.push(new EzRez.WebApi.Flight(D));});this.flights=A;this.departureAirportCode=B._departureAirportCode;this.arrivalAirportCode=B._arrivalAirportCode;this.departureTimestamp=new Date(Date.parseJSON(B._departureTimestamp));this.arrivalTimestamp=new Date(Date.parseJSON(B._arrivalTimestamp));this.durationMinutes=B._durationMinutes;this.stops=B.stops;this.airlines=B._airlines;this.isNonStop=A.length===1;};EzRez.WebApi.AirOption=function(B){var A=Object.extend({_numAirLegs:0,_numAdults:0,_numChildren:0,_numSeniors:0,_numInfantsInSeat:0,_numInfantsInLap:0,_isRoundTrip:false,_airLegPartialList:[],_pricePartial:{},_fareBasisCodeList:[]},B);EzRez.WebApi.Base.apply(this,arguments);var C=[];A._airLegPartialList.each(function(D){C.push(new EzRez.WebApi.AirLeg(D));});this.numAdults=A._numAdults;this.numChildren=A._numChildren;this.numSeniors=A._numSeniors;this.numInfantsInSeat=A._numInfantsInSeat;this.numInfantsInLap=A._numInfantsInLap;this.isRoundTrip=A._isRoundTrip;this.legs=C;this.price=new EzRez.WebApi.Price(A._pricePartial);this.fareBasisCodeList=A._fareBasisCodeList;};EzRez.WebApi.Insurance=function(B){var A=Object.extend({_contractName:"",_crsName:"",_productName:"",_description:"",_pricePartial:{}},B);EzRez.WebApi.Base.apply(this,arguments);this.contractName=A._contractName;this.crsName=A._crsName;this.productName=A._productName;this.description=A._description;this.price=new EzRez.WebApi.Price(A._pricePartial);};EzRez.WebApi.Certificate=function(B){var A=Object.extend({_agentId:0,_custId:0,_amount:0,_beneficiary:"",_beginDate:"",_endDate:""},B);EzRez.WebApi.Base.apply(this,arguments);this.agentId=A._agentId;this.custId=A._custId;this.amount=A._amount;this.beneficiary=A._beneficiary;this.beginDate=new Date(Date.parseJSON(A._beginDate));this.endDate=new Date(Date.parseJSON(A._endDate));};EzRez.WebApi.Products=function(B){var A=Object.extend({_hasAir:false,_hasRoom:false,_hasCar:false,_hasActivity:false,_hasCruise:false,_hasInsurance:false,_hasCertificate:false},B);EzRez.WebApi.Base.apply(this,arguments);this.hasAir=A._hasAir;this.hasRoom=A._hasRoom;this.hasCar=A._hasCar;this.hasActivity=A._hasActivity;this.hasCruise=A._hasCruise;this.hasInsurance=A._hasInsurance;this.hasCertificate=A._hasCertificate;};EzRez.WebApi.Travelers=function(B){var A=Object.extend({_numPassengers:0,_numAdults:0,_numSeniors:0,_numChildren:0,_numInfantsInSeat:0,_numInfantsInLap:0,_numTotalChildren:0,_numTotalAdults:0},B);EzRez.WebApi.Base.apply(this,arguments);this.total=A._numPassengers;this.adults=A._numAdults;this.seniors=A._numSeniors;this.children=A._numChildren;this.infantsInSeat=A._numInfantsInSeat;this.infantsInLap=A._numInfantsInLap;this.totalChildren=A._numTotalChildren;this.totalAdults=A._numTotalAdults;};EzRez.WebApi.Search=function(B){var A=Object.extend({_departingArea:"",_arrivingArea:"",_departureDate:"",_returnDate:"",_airCabin:"",_featuredHotelIds:[],_hotelRoomCount:0,_isMultiDestination:false,_isRoundTrip:true},B);EzRez.WebApi.Base.apply(this,arguments);this.departing={area:A._departingArea,date:new Date(Date.parseJSON(A._departureDate))};this.arriving={area:A._arrivingArea,date:new Date(Date.parseJSON(A._returnDate))};this.travelers=new EzRez.WebApi.Travelers(A);this.products=new EzRez.WebApi.Products(A);this.airCabin=A._airCabin;this.featuredHotelId=A._featuredHotelIds[0];this.featuredHotelIds=A._featuredHotelIds;this.hotelRoomCount=A._hotelRoomCount;this.isRoundTrip=A._isRoundTrip;this.isMultiDestination=A._isMultiDestination;};EzRez.WebApi.Availability=function(J){var G=Object.extend({_activityPartials:[],_airOptionPartials:[],_carPartials:[],_hotelsPartials:[]},J);EzRez.WebApi.Base.apply(this,arguments);var I=$H();var E=$H();var D=$H();var F=$H();var C=function(){if(I.size()===0){var K=EzRez.Util.Profiler.start("EzRez.WebApi.Availability::build hotels");G._hotelsPartials.each(function(L){var M=new EzRez.WebApi.Hotel(L);I.set(M.ezrezObjectKey,M);});K.stop();}};var H=function(){if(D.size()===0){var K=EzRez.Util.Profiler.start("EzRez.WebApi.Availability::build cars");G._carPartials.each(function(L){var M=new EzRez.WebApi.Car(L);D.set(M.ezrezObjectKey,M);});K.stop();}};var A=function(){if(E.size()===0){var K=EzRez.Util.Profiler.start("EzRez.WebApi.Availability::build air options");G._airOptionPartials.each(function(L){var M=new EzRez.WebApi.AirOption(L);E.set(M.ezrezObjectKey,M);});K.stop();}};var B=function(){if(F.size()===0){var K=EzRez.Util.Profiler.start("EzRez.WebApi.Availability::build activities");G._activityPartials.each(function(L){var M=new EzRez.WebApi.Activity(L);F.set(M.ezrezObjectKey,M);});K.stop();}};this.products=new EzRez.WebApi.Products(G);this.getHotels=function(){C();return I.values();};this.getHotel=function(K){C();return I.get(K);};this.getAirOptions=function(){A();return E.values();};this.getAirOption=function(K){A();return E.get(K);};this.getCars=function(){H();return D.values();};this.getCar=function(K){H();return D.get(K);};this.getActivities=function(){B();return F.values();};this.getActivity=function(K){B();return F.get(K);};this.numHotels=G._hotelsPartials.length;this.numAirOptions=G._airOptionPartials.length;this.numCars=G._carPartials.length;this.numActivities=G._activityPartials.length;};EzRez.WebApi.Itinerary=function(C){var A=Object.extend({_hasInsurance:false,_roomPartials:[],_insurancePartial:{},_certificatePartials:[]},C);EzRez.WebApi.Availability.apply(this,arguments);var B=new EzRez.WebApi.Hotel(A);var D=$H();var F=new EzRez.WebApi.Certificate();delete this.getHotels;delete this.getHotel;var E=function(){if(D.size()>0){return ;}var G=EzRez.Util.Profiler.start("EzRez.WebApi.Itinerary::build certificates");A._certificatePartials.each(function(I){var H=new EzRez.WebApi.Certificate(I);D.set(H.ezrezObjectKey,H);});F=D.values().first();G.stop();};this.insurance=new EzRez.WebApi.Insurance(A._insurancePartial);this.getCertificates=function(){E();return D.values();};this.getCertificate=function(G){E();return D.get(G);};E();this.certificate=F;this.getRooms=B.getRooms;this.getRoom=B.getRoom;this.numRooms=A._roomPartials.length;};EzRez.WebApi.Booking=function(B){var A=Object.extend({_bookingNumber:0,_agencyAgentMarkup:0,_agencyCommissionTotal:0,_packagePriceInCustomerCurrency:0,_packagePriceInPoints:0,_customerOwe:0,_customerPaymentTotal:0,_paymentTotalPoints:0,_paymentTotal:0,_customerPaidPoints:0,_customerPaidCashInCustomerCurrency:0,_creditCardType:"",_discountCode:"",_frequentFlyerNumber:"",_beginDate:"",_endDate:"",_enteredDate:"",_departureAirportCode:"",_destinationAirportCode:"",_isOnHold:false,_isSubsequentPayment:false,_isSubscribedToEmailList:false,_itineraryPartial:{},_leadTravelerPartial:{}},B);EzRez.WebApi.Itinerary.apply(this,[A._itineraryPartial]);this.customerPaidPoints=A._customerPaidPoints;this.customerPaidCashInCustomerCurrency=A._customerPaidCashInCustomerCurrency;this.departureAirportCode=A._departureAirportCode;this.destinationAirportCode=A._destinationAirportCode;this.beginDate=new Date(Date.parseJSON(A._beginDate));this.endDate=new Date(Date.parseJSON(A._endDate));this.enteredDate=new Date(Date.parseJSON(A._enteredDate));this.travelers=new EzRez.WebApi.Travelers(A);this.number=A._bookingNumber;this.packagePriceInCustomerCurrency=A._packagePriceInCustomerCurrency;this.packagePriceInPoints=A._packagePriceInPoints;this.customerOwe=A._customerOwe;this.customerPaymentTotal=A._customerPaymentTotal;this.paymentTotal=A._paymentTotal;this.paymentTotalPoints=A._paymentTotalPoints;this.frequentFlyerNumber=A._frequentFlyerNumber;this.creditCardType=A._creditCardType;this.isPaidInFull=(A._customerOwe===0&&A._customerPaymentTotal>0);this.isOnHold=A._isOnHold;this.isSubsequentPayment=A._isSubsequentPayment;this.isSubscribedToEmailList=A._isSubscribedToEmailList;this.agencyAgentMarkup=A._agencyAgentMarkup;this.agencyCommissionTotal=A._agencyCommissionTotal;this.leadTraveler=new EzRez.WebApi.Traveler(A._leadTravelerPartial);this.discountCode=A._discountCode;this.isFirstPayment=false;};EzRez.WebApi.WebContext=function(B){var A=Object.extend({_url:"",_clientUrl:"",_clientName:"",_cobrandName:"",_webAssetsRoot:"",_develSystemDsn:"",_tab:"",_pageName:"",_fileName:"",_debugMode:"",_webDevMode:"",_isAgent:""},B);EzRez.WebApi.Base.apply(this,arguments);this.isDebugMode=A._debugMode;this.isWebDevMode=A._webDevMode;this.isAgent=A._isAgent;this.clientUrl=A._clientUrl;this.clientName=A._clientName;this.cobrandName=A._cobrandName;this.url=A._url;this.webAssetsRoot=A._webAssetsRoot;this.develSystemDsn=A._develSystemDsn;this.searchFormTab=A._tab;this.pageName=A._pageName;this.fileName=A._fileName;};EzRez.WebApi.SysConf=function(C){var B=Object.extend({_hotelsPerPage:10,_defaultCountryCode:"US",_omnitureAccountId:"",_useResultsAccordian:false,_isDisplayCashColumn:false,_timeZoneOffset:0,_timeZoneName:"",_sessionTimeoutInMinutes:0,_sessionTrackCookieName:"EZ_SESSION_TRACK"},C);EzRez.WebApi.Base.apply(this,arguments);var D=new Date();var A=EzRez.Util.Cookie.read(B._sessionTrackCookieName);this.hotelsPerPage=B._hotelsPerPage;this.defaultCountryCode=B._defaultCountryCode;this.useResultsAccordian=B._useResultsAccordian;this.omnitureAccountId=B._omnitureAccountId;this.isDisplayCashColumn=B._isDisplayCashColumn;this.timeZoneOffset=B._timeZoneOffset;this.timeZoneName=B._timeZoneName;this.systemTime=Date.convertToOffset(new Date(),B._timeZoneOffset);this.isActiveSession=function(){var E=EzRez.Util.Cookie.read(B._sessionTrackCookieName);return D.isAfter(new Date())&&A===E&&E!==null&&E!==undefined;};this.resetSessionExpiration=function(){D=new Date().add({minutes:B._sessionTimeoutInMinutes});};this.resetSessionExpiration();};EzRez.WebApi.TravelerProfile=function(B){var A=Object.extend({_totalRedemptionPoints:0,_customInfo:"",_accountDisplay:"",_externalProfileId:""},B);EzRez.WebApi.Traveler.apply(this,arguments);this.totalRedemptionPoints=A._totalRedemptionPoints;this.customInfo=A._customInfo;this.accountDisplay=A._accountDisplay;this.externalProfileId=A._externalProfileId;};EzRez.WebApi.Agent=function(B){var A=Object.extend({_id:0,_type:"",_agencyId:0,_firstName:"",_lastName:""},B);EzRez.WebApi.Base.apply(this,arguments);this.id=A._id;this.type=A._type;this.agencyId=A._agencyId;this.firstName=A._firstName;this.lastName=A._lastName;};EzRez.WebApi.RedemptionContract=function(B){var A=Object.extend({_customerMessage:""},B);EzRez.WebApi.Base.apply(this,arguments);this.customerMessage=A._customerMessage;};var formWasSubmitted=false;function validateAndDisableForm(A){if(validateForm(A)){A.submit.disabled=true;return true;}else{return false;}}function disableForm(A){A.submit.disabled=true;return true;}function submitAndDisableForm(A){if(!formWasSubmitted){formWasSubmitted=true;A.submit();}return true;}function submitForm(A){var B=document[A];if(!B){return ;}B.submit();}function confirmAction(A){return confirm("Are you sure you want to "+A);}function displaySection(C,B){var A=document.getElementById(B);if(C){A.style.visibility="visible";A.style.display=(A.tagName.toUpperCase()!="TR"||document.all)?"block":"table-row";}else{A.style.visibility="hidden";A.style.display="none";}}function visibilitySection(C,B){var A=document.getElementById(B);if(C){A.style.visibility="visible";}else{A.style.visibility="hidden";}}function areaWindow(A){bookWindow=window.open(A,"_blank","height=500,width=400,scrollbars=yes");bookWindow.focus();}function newWindow(A){bookWindow=window.open(A,"_blank","height=500,width=680,scrollbars=yes");bookWindow.focus();}function newTallWindow(A){bookWindow=window.open(A,"_blank","height=700,width=680,scrollbars=yes");bookWindow.focus();}function isText(A,D){var B=/^[a-zA-Z0-9]+$/;if(B.test(A.value)){return true;}else{alert(D);try{A.focus();}catch(C){}return false;}}function isNonNull(A,C){if(trim(A.value)>""){return true;}else{alert(C);try{A.focus();}catch(B){}return false;}}function isNumeric(A,D){var B=/(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/;if(B.test(A.value)){return true;}else{alert(D);try{A.focus();}catch(C){}return false;}}function isNumericList(A,F){if(trim(A.value)==""){return true;}var E=A.value.split(/ *, */);var C=/(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/;for(var B=0;B<E.length;B++){if(!C.test(E[B])){alert(F);try{A.focus();}catch(D){}return false;}}return true;}function isIntegerList(A,F){if(trim(A.value)==""){return true;}var E=A.value.split(/ *, */);var C=/(^-?\d\d*$)/;for(var B=0;B<E.length;B++){if(!C.test(E[B])){alert(F);try{A.focus();}catch(D){}return false;}}return true;}function isPositive(B,C){if(B.value>0){return true;}else{alert(C);try{B.focus();}catch(A){}return false;}}function isInteger(A,D){var B=/(^-?\d\d*$)/;if(B.test(A.value)){return true;}else{alert(D);try{A.focus();}catch(C){}return false;}}function isEmail(A,D){var B=/^[\w-]+(\.[\w-]+)*@[a-zA-Z0-9]([\w\.-]*[a-zA-Z0-9])*\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/;if(B.test(A.value)){return true;}else{alert(D);try{A.focus();}catch(C){}return false;}}function validateCountryState(D,A,C){if((D.value=="US"&&A.options[A.selectedIndex].value=="")||(D.value=="CA"&&A.options[A.selectedIndex].value=="")){alert(err_message);try{A.focus();}catch(B){}return false;}else{return true;}}function validateSelection(C,B){if((C.options[C.selectedIndex].value==0)||(C.options[C.selectedIndex].value=="")){alert(B);try{C.focus();}catch(A){}return false;}else{return true;}}validationFields=new Array();validationFields2=new Array();validationMessages=new Array();validationType=new Array();function validateForm(B){for(var A=0;A<validationFields.length;A++){if(validationType[A]=="text"){if(!isText(validationFields[A],validationMessages[A])){return false;}}else{if(validationType[A]=="non null"){if(!isNonNull(validationFields[A],validationMessages[A])){return false;}}else{if(validationType[A]=="checkbox_with_text"){if(validationFields[A].checked&&!isNonNull(validationFields2[A],validationMessages[A])){return false;}}else{if(validationType[A]=="int"){if(!isInteger(validationFields[A],validationMessages[A])){return false;}}else{if(validationType[A]=="double"){if(!isNumeric(validationFields[A],validationMessages[A])){return false;}}else{if(validationType[A]=="email"){if(!isEmail(validationFields[A],validationMessages[A])){return false;}}else{if(validationType[A]=="country_state"){if(!validateCountryState(validationFields[A],validationFields2[A],validationMessages[A])){return false;}}else{if(validationType[A]=="selection"){if(!validateSelection(validationFields[A],validationMessages[A])){return false;}}else{if(validationType[A]=="positive"){if(!isNumeric(validationFields[A],validationMessages[A])){return false;}if(!isPositive(validationFields[A],validationMessages[A])){return false;}}else{if(validationType[A]=="numeric_list"){if(!isNumericList(validationFields[A],validationMessages[A])){return false;}}else{if(validationType[A]=="integer_list"){if(!isIntegerList(validationFields[A],validationMessages[A])){return false;}}}}}}}}}}}}}return true;}function addValidation(D,E,C,B){if(D){var A=findValidationField(D);if(A==-1){var F=validationFields.length;validationFields[F]=D;validationFields2[F]=E;validationMessages[F]=C;validationType[F]=B;}}}function removeValidation(B){var A=findValidationField(B);if(A>=0){validationFields[A]=null;validationFields2[A]=null;validationMessages[A]=null;validationType[A]=null;}}function findValidationField(B){var C=-1;for(var A=0;A<validationFields.length;A++){if(validationFields[A]==B){C=A;break;}}return C;}function isDate(E,D,A,C){var B=new Date();day=A[A.selectedIndex].value;E=E-1;if(B.getMonth()>E){D=((D==99999)?B.getFullYear()+1:D);}else{D=((D==99999)?B.getFullYear():D);}var F=new Date(D,E,day);if((D==F.getFullYear())&&(E==F.getMonth())&&(day==F.getDate())){makeDatesClose(C,D,A);return true;}else{for(d=28;d<day;d++){var F=new Date(D,E,d);if((D==F.getFullYear())&&(E==F.getMonth())&&(d==F.getDate())){A[d-1].selected=true;}else{break;}}makeDatesClose(C,D,A);return false;}}function makeDatesClose(D,C,A){try{var E=D.date1_month.value*1;var H=D.date2_month.value*1;var B=D.date1_day.value*1;var G=D.date2_day.value*1;if(E<=H){months_diff=H-E;}else{months_diff=H-E+12;}if((months_diff>4)||((months_diff==0)&&(B>=G))){changeDate2(C,A,D);}if((E==H)&&(D.date1_day.value*1>D.date2_day.value*1)){D.date2_day.value=D.date1_day.value*1;}}catch(F){}}function roundToPennies(A){var B=Math.round(A*Math.pow(10,2))/Math.pow(10,2);return B.toFixed(2);}function changeClass(B,A){B.className=A;}function trim(A){return A.replace(/^\s+|\s+$/g,"");}var req;function loadXMLDoc(A){if(window.XMLHttpRequest){req=new XMLHttpRequest();req.onreadystatechange=processReqChange;req.open("GET",A,true);req.send(null);}else{if(window.ActiveXObject){isIE=true;req=new ActiveXObject("Microsoft.XMLHTTP");if(req){req.onreadystatechange=processReqChange;req.open("GET",A,true);req.send();}}}}function processReqChange(){if(req.readyState==4){if(req.status==200){processAjaxResponse();}else{alert("There was a problem retrieving the XML data:\n"+req.statusText);}}}function hasClass(D,C){var B=D.className.split(" ");for(var A=0;A<B.length;A++){if(B[A]==C){return true;}}return false;}function appendClass(B,A){if(!hasClass(B,A)){B.className=B.className+" "+A;}}function removeClass(B,A){if(hasClass(B,A)){B.className=B.className.replace(A,"");}}function swapClass(B,A,C){removeClass(B,A);appendClass(B,C);}function validateCPF(G){var A,B,E,D,C;var F=new Array(10);C=G.substr(9,2);for(B=0;B<=8;B++){F[B]=G.substr(B,1);}A=10;E=0;for(B=0;B<=8;B++){E=E+F[B]*A;A=A-1;}F[9]=E%11;if(F[9]<2){F[9]=0;}else{F[9]=11-F[9];}A=11;E=0;for(B=0;B<=9;B++){E=E+F[B]*A;A=A-1;}F[10]=E%11;if(F[10]<2){F[10]=0;}else{F[10]=11-F[10];}D=F[9]*10+F[10];if(D!=C){return false;}return true;}var validateNonEmptyField=function(A,B){if($F(A).blank()){alert(B);$(A).focus();return false;}return true;};function displayDetails(C,B,A,D){var G=document.getElementById(C);if(!G){return ;}var F=G.style.visibility;var E=(F=="visible"||F=="")?false:true;displaySection(E,C);createDetailsLinkText(E,B,A,D);}function createDetailsLinkText(E,B,A,C){var F=document.getElementById(B);if(!F){return ;}var D=(E)?A:C;F.innerHTML=D;}function displayAllDetails(G,B,E,A,D,F,C){for(i=0;i<B.length;i++){displaySection(G,B[i].divId);createDetailsLinkText(G,B[i].linkTextId,A,D);}createShowHideAllLinkText(G,E,F,C);}function createShowHideAllLinkText(E,B,D,A){var F=document.getElementById(B);if(!F){return ;}var C=(E)?D:A;F.innerHTML=C;}var highZ=3;function showHelp(A,E){var D=xGetElementById("helpAreaHelpContent");var C=xGetElementById("helpArea");if(!C){var B=document.getElementsByTagName("body").item(0);C=document.createElement("DIV");C.setAttribute("id","helpArea");C.className="helpBox";helpBar=document.createElement("DIV");helpBar.className="helpBar";helpCloseImg=document.createElement("IMG");helpCloseImg.setAttribute("src","/images/delete.gif");helpCloseImg.setAttribute("align","right");xAddEventListener(helpCloseImg,"mousedown",hideHelpArea,false);helpBar.appendChild(helpCloseImg);C.appendChild(helpBar);D=document.createElement("DIV");D.className="helpContent";D.setAttribute("id","helpAreaHelpContent");C.appendChild(D);B.appendChild(C);}D.innerHTML=E;xMoveTo(C,xPageX(A)+50,xPageY(A));C.style.display="block";}function hideHelpArea(){var A=xGetElementById("helpArea");if(A){A.style.display="none";}}