var _lang=new Array();_lang.same="-- Same as start --";_lang.enterboth="Please enter both start and return location.";_lang.bookmark="Bookmark ";_lang.clickclose="Click to close";_lang.loading="Loading, please wait";_lang.tooltip="ToolTip Content";try{if(!_basePath){_basePath=""}}catch(e){var _basePath=""}window.AllLocations=[];window.Locations={};window.addEvent("domready",function(){Tip.create();var pickup=$E("#searchform select[name=pickup_location]");var dropoff=$E("#searchform select[name=dropoff_location]");if(pickup&&dropoff){pickup.addEvent("change",function(e){e=new Event(e);dropoff.empty();var tmpEl=new Element("option",{value:this.value});tmpEl.setText("-- Same as start --");tmpEl.injectInside(dropoff);if(window.Locations[this.value]){for(var i=0;i<window.Locations[this.value].length;i++){var loc=window.AllLocations[window.Locations[this.value][i]];var cloneEl=tmpEl.clone();cloneEl.setProperty("value",loc[0]);cloneEl.setText(unescape(loc[1]));cloneEl.injectInside(dropoff)}}else{for(key in window.AllLocations){var loc=window.AllLocations[key];var cloneEl=tmpEl.clone();cloneEl.setProperty("value",loc[0]);cloneEl.setText(unescape(loc[1]));cloneEl.injectInside(dropoff)}}e.stop()})}var start=$$("#searchform select[name=start_day]","#searchform select[name=start_month]","#searchform select[name=start_year]");start.each(function(elm){elm.addEvent("change",function(e){updateHidden();updateDropdown("start")})});var end=$$("#searchform select[name=end_day]","#searchform select[name=end_month]","#searchform select[name=end_year]");end.each(function(elm){elm.addEvent("change",function(e){updateHidden();updateDropdown("end")})});var pickup_date=$E("#searchform input[name=pickup_date]");var pickup_date_cal=$E("#searchform #pickup_date_cal");if(pickup_date){pickup_date.addEvent("click",function(e){e=new Event(e);JACS.show(this,e);e.stop()});if(pickup_date_cal){pickup_date_cal.setStyle("cursor","pointer");pickup_date_cal.addEvent("click",function(e){e=new Event(e);JACS.show(pickup_date,e);e.stop()})}}var dropoff_date=$E("#searchform input[name=dropoff_date]");var dropoff_date_cal=$E("#searchform #dropoff_date_cal");if(dropoff_date){dropoff_date.addEvent("click",function(e){e=new Event(e);JACS.show(this,e);e.stop()});if(dropoff_date_cal){dropoff_date_cal.setStyle("cursor","pointer");dropoff_date_cal.addEvent("click",function(e){e=new Event(e);JACS.show(dropoff_date,e);e.stop()})}}var start_cal=$E("#start_cal");if(start_cal){start_cal.setStyle("cursor","pointer");start_cal.addEvent("click",function(e){e=new Event(e);updateHidden();scwNextAction=updateDropdown.runsAfterSCW(this,"start");scwShow(scwID("start_hidden"),this);e.stop()})}var end_cal=$E("#end_cal");if(end_cal){end_cal.setStyle("cursor","pointer");end_cal.addEvent("click",function(e){e=new Event(e);updateHidden();scwNextAction=updateDropdown.runsAfterSCW(this,"end");scwShow(scwID("end_hidden"),this);e.stop()})}var searchform=$E("#searchform");if(searchform){searchform.addEvent("submit",function(e){e=new Event(e);if(this.pickup_location.value==0||this.dropoff_location.value==0){alert("Please enter both a pick up location and a drop off location.");e.stop()}})}var bookmark=$E("#bookmark");if(bookmark){bookmark.addEvent("click",function(e){e=new Event(e);var bookLink=window.location.toString().replace("#","");bookLink=bookLink.split("?a=");bookLink=bookLink[0];bookLink+=(bookLink.indexOf("?")<0)?"?bookmark=1":"&bookmark=1";window.status=_lang.bookmark+bookLink;if(window.sidebar){window.sidebar.addPanel(document.title,bookLink,"")}else{if(window.opera&&window.print){var elem=document.createElement("a");elem.setAttribute("href",bookLink);elem.setAttribute("title",document.title);elem.setAttribute("rel","sidebar");elem.click()}else{if(document.all){window.external.AddFavorite(bookLink,document.title)}}}e.stop()})}try{}catch(e){alert(e)}var newsletterform=$E("#newsletterform");if(newsletterform){newsletterform.addEvent("submit",function(e){e=new Event(e);var url="remote?method=subscribeNewsletter";var respDiv=$E("#javascriptrespDiv");if(!respDiv){respDiv=new Element("div",{styles:{padding:"5px",color:"#ff0000",border:"dashed 1px #ff8b8b",cursor:"pointer","text-align":"center","font-size":"11px"},events:{click:function(){this.remove()}},id:"javascriptrespDiv"});respDiv.injectBefore(newsletterform)}var req=new Json.Remote(url,{method:"post",onRequest:function(){respDiv.empty();respDiv.addClass("ajax-loading")},onComplete:function(jsonObj){respDiv.removeClass("ajax-loading");respDiv.setHTML(jsonObj.data);if(jsonObj.script&&jsonObj.script!=""){eval(jsonObj.script)}},onFailure:function(){}}).send("&"+newsletterform.toQueryString()+"&tmp=1");e.stop()})}createPopups()});function createPopups(){var popups=$$("a.popup");popups.each(function(itm){itm.addEvent("click",function(e){e=new Event(e);var popup=new Popup();popup.create();var url="remote?method=getInfo";var request=new Json.Remote(url,{method:"post",onRequest:function(){popup.startLoading()},onComplete:function(jsonObj){popup.stopLoading();popup.setTitl(jsonObj.title);popup.setCnt(jsonObj.data);if(jsonObj.script!=""){eval(jsonObj.script)}},onFailure:function(){}}).send("&data="+this.rel+"&tmp=1");e.stop()})});var imgpopups=$$("a.imgpopups");imgpopups.each(function(itm){ImgGallery.add(itm)});var tooltips=$$("a.tooltip");tooltips.each(function(itm){itm.addEvent("mouseover",function(e){e=new Event(e);Tip.setPos((this.getTop()+20),(this.getLeft()-25));var ttl=this.getProperty("title");this.removeProperty("title");if(ttl=="span"){var tmpElem=this.getElement("span");Tip.setCnt(tmpElem.innerHTML)}else{Tip.setCnt(ttl)}itm.addEvent("mouseout",function(ev){ev=new Event(ev);Tip.hideIt();itm.removeEvents("mouseout");itm.setProperty("title",ttl)})});itm.addEvent("click",function(e){e=new Event(e).stop();e.stop()})});var ratetabs=$$("div.rtSrch a.rtPnl");ratetabs.each(function(itm){itm.addEvent("click",function(e){e=new Event(e).stop();var elmnt=this.getParent().getParent();var elmnts=elmnt.getElements(".slctr");elmnts.each(function(itm2){if(itm2.hasClass(itm.rel)){itm2.style.display="block"}else{itm2.style.display="none"}});var elmnts2=elmnt.getElements("a.rtPnl");elmnts2.each(function(itm3){if(itm3.rel==itm.rel){itm3.addClass("rtPnlSlct")}else{itm3.removeClass("rtPnlSlct")}});e.stop()})})}function updateHidden(){var a=new Date();var f=$E("#start_hidden");if(f){var c=$E("select[name=start_day]");var g=$E("select[name=start_month]");var j=$E("select[name=start_year]");if((g.value*1)<(a.getMonth()+1)&&(j.value*1)<=a.getFullYear()){j.value=a.getFullYear()+1}$("start_hidden").value=j.value+"-"+g.value+"-"+c.value}var b=$E("#end_hidden");if(b){var i=$E("select[name=end_day]");var h=$E("select[name=end_month]");var d=$E("select[name=end_year]");if((h.value*1)<(a.getMonth()+1)&&(d.value*1)<=a.getFullYear()){d.value=a.getFullYear()+1}$("end_hidden").value=d.value+"-"+h.value+"-"+i.value}}function updateDropdown(b){var a=new Date();var c=new String($E("#"+b+"_hidden").value).split("-");if((c[1]*1)<(a.getMonth()+1)&&(c[0]*1)<=a.getFullYear()){c[0]=a.getFullYear()+1}if(b=="start"){var d=$E("select[name=start_day]");var g=$E("select[name=start_month]");var j=$E("select[name=start_year]");d.value=c[2];g.value=c[1];j.value=c[0]}else{if(b=="end"){var i=$E("select[name=end_day]");var h=$E("select[name=end_month]");var f=$E("select[name=end_year]");i.value=c[2];h.value=c[1];f.value=c[0]}}}var Popup=new Class({initialize:function(){this.initialised=false;this.pophold=new Element("div",{styles:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%"}});var d=this.pophold;this.popup=new Element("div",{styles:{background:"#FFFFFF url("+_basePath+"images/common/popbg.gif) repeat-x top left",width:"500px",border:"solid 1px #e0dede"}});this.popup.inject(this.pophold);var a=new Element("div",{styles:{height:"20px","padding-top":"5px","border-bottom":"solid 1px #e0dede"}});a.inject(this.popup);this.titl=new Element("h2",{styles:{"font-size":"14px","font-weight":"bold","line-height":"15px",display:"block","float":"left",width:"480px",height:"19px",margin:"0",padding:"0","text-align":"center",cursor:"pointer"},"class":"popTitle"});this.titl.inject(a);var b=new Element("span",{styles:{"font-size":"1px","line-height":"1px",display:"block","float":"left",background:"url("+_basePath+"images/common/close_off.gif) no-repeat top left",width:"14px",height:"14px",cursor:"pointer"},events:{click:function(){window.removeEvents("scroll");d.remove()},mouseover:function(){this.setStyle("background","url("+_basePath+"images/common/close_on.gif) no-repeat top left")},mouseout:function(){this.setStyle("background","url("+_basePath+"images/common/close_off.gif) no-repeat top left")}}});b.inject(a);var c=new Element("div",{styles:{"font-size":"11px",padding:"10px",clear:"both"}});c.inject(this.popup);this.content=new Element("div",{styles:{height:"400px",padding:"0 10px 0 0",overflow:"auto","overflow-x":"hidden"},"class":"popContent"});this.content.inject(c);new Drag.Move(this.popup,{handle:this.titl,container:this.pophold});this.titl.setText("")}});Popup.implement({setTitl:function(a){this.titl.setText(a)},setCnt:function(a){this.content.setHTML(a)},startLoading:function(){this.content.addClass("ajax-loading")},stopLoading:function(){this.content.removeClass("ajax-loading")},create:function(){if(!this.initialised){this.initialised=true;this.pophold.injectInside($E("body"));this.pophold.setStyle("top",window.getScrollTop());var c=this.pophold;window.addEvent("scroll",function(f){c.setStyle("top",window.getScrollTop())});var d=window.getSize();var a=((d.size.y-this.popup.getStyle("height").toInt())/2);if(d.size.y<this.popup.getStyle("height").toInt()){a=5}var b=((d.size.x-this.popup.getStyle("width").toInt())/2);this.popup.setStyles({top:a,left:b})}}});var Loader=new Class({initialize:function(){this.initialised=false;this.loader=new Element("div",{styles:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%"}});this.loader.injectInside($E("body"));this.loadin=new Element("div",{styles:{background:"url("+_basePath+"images/common/loader.png) no-repeat top left",padding:"5px",width:"180px",height:"77px","text-align":"center",cursor:"pointer"}});this.loadin.inject(this.loader);this.titl=new Element("h2",{styles:{"font-size":"13px","font-weight":"bold",color:"#000000",display:"block",margin:"0",padding:"0",height:"20px","line-height":"18px"}});this.titl.inject(this.loadin);var a=new Element("span",{styles:{display:"block",background:"url("+_basePath+"images/common/loader.gif) no-repeat center center",height:"57px"}});a.inject(this.loadin);this.titl.setText("Loading, please wait")}});Loader.implement({setTitl:function(a){this.titl.setText(a)},create:function(){if(!this.initialised){this.initialised=true;new Drag.Move(this.loadin,{container:this.loader});var b=window.getSize();var a=this.loader;window.addEvent("scroll",function(){a.setStyle("top",window.getScrollTop())});this.loadin.setStyles({top:(b.scroll.y+((b.size.y-this.loadin.getStyle("height").toInt())/2)),left:(b.scroll.x+((b.size.x-this.loadin.getStyle("width").toInt())/2))})}},remove:function(){this.loader.remove()}});var ImgLoader=new Class({initialize:function(){this.initialised=false;this.imghold=new Element("div",{styles:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",opacity:"0.50",filter:"alpha(opacity=50)",background:"#666666"}});this.imghold.injectInside($E("body"));this.tmpholder=new Element("div",{styles:{background:"#FFFFFF",padding:"5px",position:"absolute","text-align":"center",cursor:"pointer",border:"solid 1px #666666"}});this.tmpholder.inject($E("body"));this.holder=new Element("div",{styles:{background:"#FFFFFF url("+_basePath+"images/common/loader.gif) no-repeat center center",padding:"5px",width:"180px",height:"77px","text-align":"center",cursor:"pointer"}});this.holder.inject(this.tmpholder);var a=new Element("div",{styles:{height:"20px","text-align":"center"}});a.inject(this.tmpholder);a.setHTML("click to close")}});ImgLoader.implement({create:function(b){if(!this.initialised){this.initialised=true;new Drag.Move(this.tmpholder,{container:this.imghold});var a=window.getSize();tmpholder=this.tmpholder;holder=this.holder;imag=new Asset.image(b,{id:"popupImage",title:"Click to close",style:"border:solid 1px #999999",alt:"Click to close",onload:function(){holder.setStyles({height:this.height+10,width:this.width+10});tmpholder.setStyles({height:this.height+40,width:this.width+20,top:((a.scroll.y+(a.size.y-(this.height+40))/2)),left:((a.scroll.x+(a.size.x-(this.width+20))/2))});this.inject(holder)}});imghold=this.imghold;tmpholder.addEvent("click",function(c){c=new Event(c).stop();imghold.remove();tmpholder.remove()});imghold.addEvent("click",function(c){c=new Event(c).stop();imghold.remove();tmpholder.remove()});imghold.setStyles({top:0,height:a.scrollSize.y});window.addEvent("scroll",function(){tmpholder.setStyle("top",(window.getScrollTop()+((a.size.y-tmpholder.getStyle("height").toInt())/2)))});tmpholder.setStyles({top:(a.scroll.y+((a.size.y-tmpholder.getStyle("height").toInt())/2)),left:(a.scroll.x+((a.size.x-tmpholder.getStyle("width").toInt())/2))})}},remove:function(){this.imghold.remove();this.tmpholder.remove()}});var ImgGallery=new Class({initialize:function(){this.initialised=false;this.shown=false;this.currentImg=0;this.imgRepo=new Array;this.ttlRepo=new Array;this.thmbRepo=new Array;var c=this;this.imghold=new Element("div",{styles:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",opacity:"0.50",filter:"alpha(opacity=50)",cursor:"pointer",background:"#666666"}});this.tmpholder=new Element("div",{styles:{background:"#FFFFFF",padding:"5px",position:"absolute",width:"700px",height:"450px","text-align":"center","font-family":"Arial, Helvetica",border:"solid 1px #666666"}});var g=this.tmpholder;this.tmpHdr=new Element("div",{styles:{background:"#cccccc",height:"25px","text-align":"right","padding-right":"5px","line-height":"24px","font-weight":"bold","font-size":"14px"}});this.tmpHdr.inject(this.tmpholder);this.tmpClose=new Element("a",{styles:{background:"url("+_basePath+"images/common/close.gif) no-repeat top right","padding-right":"20px"},href:"#"});this.tmpClose.setHTML("Close window");this.tmpClose.inject(this.tmpHdr);var i=new Element("div");i.inject(this.tmpholder);var h=new Element("div",{styles:{height:"25px","text-align":"center","line-height":"24px"}});h.inject(this.tmpholder);this.ftr=new Element("div",{styles:{height:"24px",width:(g.getStyle("width").toInt()-200),"float":"left"}});this.ftr.inject(h);var b=new Element("div",{styles:{height:"24px",width:"200px","float":"left"}});b.inject(h);var f=new Element("a",{styles:{background:"url("+_basePath+"images/common/previous.gif) no-repeat center center",width:"15px",height:"15px",padding:"2px 10px 2px 10px",display:"inline"},events:{click:function(j){j=new Event(j).stop();c.previous()}},href:"#"});f.inject(b);f.setHTML("&nbsp;");this.ftr2=new Element("span");this.ftr2.inject(b);var d=new Element("a",{styles:{background:"url("+_basePath+"images/common/next.gif) no-repeat center center",width:"15px",height:"15px",padding:"2px 10px 2px 10px",display:"inline"},events:{click:function(j){j=new Event(j).stop();c.next()}},href:"#"});d.inject(b);d.setHTML("&nbsp;");var a=new Element("div",{styles:{height:"1px","font-size":"1px","line-height":"1px",padding:"0",margin:"0",clear:"both"}});a.inject(h);this.holder=new Element("div",{styles:{background:"#ffffff url("+_basePath+"images/common/loader.gif) no-repeat center center",width:(g.getStyle("width").toInt()-140),height:(g.getStyle("height").toInt()-50),"text-align":"center","float":"left",overflow:"hidden"}});this.holder.inject(i);this.gallery=new Element("div",{styles:{background:"#ffffff",width:"140px",height:(g.getStyle("height").toInt()-60),"text-align":"center","float":"left",padding:"5px 0 5px 0",overflow:"auto"}});this.gallery.inject(i);var a=new Element("div",{styles:{height:"1px","font-size":"1px","line-height":"1px",padding:"0",margin:"0",clear:"both"}});a.inject(i)}});ImgGallery.implement({add:function(d){var a=this;var c=this.imgRepo.indexOf(d.getProperty("href"));var f=c;if(f<0){var f=this.imgRepo.length}d.removeEvents();d.addEvent("click",function(g){g=new Event(g).stop();a.create(f)});if(c<0){var b=d.getElements("img");if(b){this.thmbRepo[f]=b.getProperty("src")}else{this.thmbRepo[f]=d.getProperty("href")}this.imgRepo[f]=d.getProperty("href");this.ttlRepo[f]=(d.getProperty("title"))?d.getProperty("title"):""}},create:function(h){var a=this;var c=this.tmpholder;var b=this.imghold;var d=this.holder;if(!this.initialised){this.initialised=true;this.shown=true;this.imghold.injectInside($E("body"));this.tmpholder.inject($E("body"));b.addEvent("click",function(i){i=new Event(i).stop();a.hide()});this.tmpClose.addEvent("click",function(i){i=new Event(i).stop();a.hide()});new Drag.Move(this.tmpholder,{handle:this.tmpHdr,container:this.imghold});var g=window.getSize();b.setStyles({top:0,height:g.scrollSize.y});window.addEvent("scroll",function(){c.setStyle("top",(window.getScrollTop()+((g.size.y-c.getStyle("height").toInt())/2)))});c.setStyles({top:(g.scroll.y+((g.size.y-c.getStyle("height").toInt())/2)),left:(g.scroll.x+((g.size.x-c.getStyle("width").toInt())/2))});this.createImages()}if(!this.shown){this.show()}this.holder.empty();var f=this.holder.getSize();imag=new Asset.image(a.imgRepo[h],{id:"popupImage",title:_lang.clickclose,alt:_lang.clickclose,onload:function(){if(this.height>f.size.y){this.height=f.size.y}if(this.width>f.size.x){this.width=f.size.x}else{this.setStyle("margin-top",Math.ceil((f.size.y-this.height)/2))}this.addEvent("mousewheel",function(i){i=new Event(i).stop();if(i.wheel>0){this.width*=1.1;this.height*=1.1;this.setStyle("margin-top",Math.ceil((f.size.y-this.height)/2))}else{if(i.wheel<0){this.width/=1.1;this.height/=1.1;this.setStyle("margin-top",Math.ceil((f.size.y-this.height)/2))}}});a.currentImg=h;a.updateFooter();this.inject(d)}})},createImages:function(){if(this.initialised){var a=this;this.imgRepo.each(function(f){var d=a.imgRepo.indexOf(f);var b=new Element("div",{styles:{border:"1px solid #666666",width:"100px",height:"70px",overflow:"hidden","text-align":"center",margin:"0 auto","margin-bottom":"5px"}});var c=new Element("img",{src:a.thmbRepo[d].toString(),styles:{cursor:"pointer",width:"auto",height:"70px"},events:{click:function(g){g=new Event(g).stop();a.create(d)}}});c.inject(b);b.inject(a.gallery)})}},updateFooter:function(){if(this.initialised){this.ftr.setHTML(this.ttlRepo[this.currentImg]);this.ftr2.setHTML("&nbsp;&nbsp; image "+(this.currentImg+1)+" of "+this.imgRepo.length+" &nbsp;&nbsp;")}},next:function(){if(this.initialised){var a=this.currentImg+1;if(a>=this.imgRepo.length){a=0}this.create(a)}},previous:function(){if(this.initialised){var a=this.currentImg-1;if(a<0){a=this.imgRepo.length-1}this.create(a)}},remove:function(){if(this.initialised){this.imghold.remove();this.tmpholder.remove()}},show:function(){if(this.initialised){this.imghold.setStyle("display","block");this.tmpholder.setStyle("display","block");this.shown=true}},hide:function(){if(this.initialised){this.imghold.setStyle("display","none");this.tmpholder.setStyle("display","none");this.shown=false}}});var ImgGallery=new ImgGallery();var ToolTip=new Class({initialize:function(){this.initialised=false;this.ttip=new Element("div",{styles:{position:"absolute",top:"0",left:"0",width:"250px",display:"none"}});this.ttiptop=new Element("div",{styles:{background:"url("+_basePath+"images/common/ttip.gif) no-repeat top left",height:"16px","line-height":"1px","font-size":"1px"}});this.ttiptop.inject(this.ttip);this.ttipbtm=new Element("div",{styles:{background:"#f5eca3","border-right":"solid 1px #000000","border-bottom":"solid 1px #000000","border-left":"solid 1px #000000",padding:"5px","font-size":"11px"}});this.ttipbtm.inject(this.ttip);this.ttipbtm.setText("ToolTip Content")}});ToolTip.implement({setCnt:function(a){this.ttipbtm.setHTML(a);this.ttip.style.display="block"},setPos:function(a,b){this.ttip.setStyles({top:a,left:b})},showIt:function(){this.ttip.style.display="block"},hideIt:function(){this.ttip.style.display="none"},create:function(){if(!this.initialised){this.initialised=true;this.ttip.injectInside($E("body"))}}});var Tip=new ToolTip();
