var DDSPEED=5,DDTIMER=10;
function ddMenu(a,c){var d=$(a+"-ddheader"),e=$(a+"-ddcontent");a=$(d).getDimensions();var f=a.width;a=a.height;clearInterval(e.timer);if(c==1){clearTimeout(d.timer);if(!(e.maxh&&e.maxh<=e.offsetHeight)){if(!e.maxh){e.style.display="block";e.style.height="auto";e.maxh=e.offsetHeight;e.style.height="0px";e.style.left=findPosX(d)+"px";e.style.top=findPosY(d)+a+"px"}e.timer=setInterval(function(){ddSlide(e,1)},DDTIMER)}}else{d.timer=setTimeout(function(){ddCollapse(e)},50);d.className=""}}
function ddCollapse(a){a.timer=setInterval(function(){ddSlide(a,-1)},DDTIMER)}function cancelHide(a){var c=$(a+"-ddheader"),d=$(a+"-ddcontent");c.className="active";clearTimeout(c.timer);clearInterval(d.timer);if(d.offsetHeight<d.maxh)d.timer=setInterval(function(){ddSlide(d,1)},DDTIMER)}
function ddSlide(a,c){var d=a.offsetHeight,e;e=c==1?Math.round((a.maxh-d)/DDSPEED):Math.round(d/DDSPEED);if(e<=1&&c==1)e=1;a.style.height=d+e*c+"px";a.style.opacity=d/a.maxh;a.style.display=d<5&&c!=1?"none":"block";a.style.filter="alpha(opacity="+d*100/a.maxh+")";if(d<2&&c!=1||d>a.maxh-2&&c==1)clearInterval(a.timer)}
Event.addBehavior({"a#quotesLoc1:click":function(){dom.quotesSetCity("Las Vegas, NV")},"a#quotesLoc2:click":function(){dom.quotesSetCity("New York, NY")},"a#quotesLoc3:click":function(){dom.quotesSetCity("Phoenix, AZ")},"a#quotesLoc3:click":function(){dom.quotesSetCity("Washington, DC")},"a#quotesLoc3:click":function(){dom.quotesSetCity("Los Angeles, CA")},"a#quotesClose:click":function(){dom.quotesClose()}});
Ajax.Responders.register({onCreate:function(){$("loader").update('<img src="/images/loading.gif" border="0" alt="loading..." title="loading..." />')},onComplete:function(){$("loader").update("")}});
dom={currPanel:1,nextPanel:1,panelTimer:null,panelDelay:6,panelSpeed:10,panelButtons:true,panelTotal:0,blackOut:function(){var a=document.documentElement.offsetWidth,c=document.documentElement.scrollHeight;$("blackout").style.display="block";$("blackout").style.height=c+"px";$("blackout").style.width=a+"px"},playVideo:function(){navigator.userAgent.indexOf("Safari")!=-1&&$("movieSm").hide();this.blackOut();$("blackout").style.display="block";$("movie").style.display="block";$("VideoFlash").Gotoframe(1)},
stopVideo:function(){if($("movieSm"))navigator.appName.indexOf("Microsoft")!=-1?$("SmVideo").stopIt():document.SmVideo.stopIt()},fadeIn:function(a,c){var d,e=0,f=0,g=Math.round(5);d=$("panel-"+a);if(dom.panelButtons)b=$("panel-button-"+a);$("panel-"+dom.currPanel).hide();dom.panelButtons&&$("panel-button-"+dom.currPanel).removeClassName("ison");d.style.opacity=e;d.style.MozOpacity=e;d.style.KhtmlOpacity=e;d.style.filter="alpha(opacity="+e+")";d.show();dom.panelButtons&&b.addClassName("ison");for(i=
0;i<=100;i++){setTimeout("dom.showIt("+i+","+a+")",f*g);f++}dom.currPanel=a;if(c==1){clearInterval(dom.panelTimer);dom.initFades()}},showIt:function(a,c){c=$("panel-"+c);c.style.opacity=a/100;c.style.MozOpacity=a/100;c.style.KhtmlOpacity=a/100;c.style.filter="alpha(opacity="+a+")"},rotateFades:function(){var a=dom.panelTotal;if(a==1)return false;dom.nextPanel=dom.nextPanel==a?1:dom.currPanel+1;dom.fadeIn(dom.nextPanel,2)},initFades:function(){dom.panelTimer=setInterval("dom.rotateFades()",dom.panelDelay*
1000)},registerNewsletter:function(){if($("form_newsletter").email.value==""){alert("Please enter a valid email");return false}if($("form_newsletter").state.value==""){alert("Please select a state");return false}var a=Form.serialize($("form_newsletter"));new Ajax.Request("/js/ajax/newsletter.php?action=newsletter&"+a,{method:"post",onSuccess:function(c){c=c.responseText||"Error 1";alert(c);$("form_newsletter").email.value=""},onLoading:function(){},onLoaded:function(){var c=transport.responseText||
"0"},onFailure:function(){alert("Error")}})},unregisterNewsletter:function(){if($("form_newsletter").email.value==""){alert("Please enter a valid email");return false}if(!window.confirm("Are you sure you want to opt out of our newsletter?")){$("form_newsletter").email.value="";return false}var a=Form.serialize($("form_newsletter"));new Ajax.Request("/js/ajax/newsletter.php?action=unsubscribe&"+a,{method:"post",onSuccess:function(c){c=c.responseText||"Error 1";alert(c);$("form_newsletter").email.value=
""},onLoading:function(){},onLoaded:function(){var c=transport.responseText||"0"},onFailure:function(){alert("Error")}})},inc:0,quotesAtStep:0,quotesInterval:null,quotesIntervalDone:false,quotesGetAvailableWinProps:function(){var a=0,c=0;if(typeof window.innerWidth=="number"){a=window.innerWidth;c=window.innerHeight}else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){a=document.documentElement.clientWidth;c=document.documentElement.clientHeight}else if(document.body&&
(document.body.clientWidth||document.body.clientHeight)){a=document.body.clientWidth;c=document.body.clientHeight}return[a,c]},quotesBegin:function(){var a,c;c=dom.quotesGetAvailableWinProps();a=c[0];c=c[1];var d,e;d=$("quotes").getDimensions();e=d.width;d=d.height;var f=document.documentElement.scrollTop||document.body.scrollTop||window.pageYOffset,g=document.documentElement.scrollLeft||document.body.scrollLeft||window.pageXOffset;f=!f?0:f;g=!g?0:g;a=(a-e)/2+g;c=(c-d)/2+f;dom.blackOut();$("quotes").setStyle({left:a+
"px",top:c+"px"});$("quotes").show()},quotesStep1:function(){new Ajax.Updater({success:"quotesContainer",failure:"quotesContainer"},"/index.php",{parameters:{action:"ajax.quotes",func:"step1"}},{evalScripts:true},{evalJS:true})},quotesSetCity:function(a){new Ajax.Updater({success:"quotesContainer",failure:"quotesContainer"},"/index.php",{parameters:{action:"ajax.quotes",func:"step2",theCity:a}},{evalScripts:true},{evalJS:true});dom.quotesAtStep=2},quotesSetType:function(a){new Ajax.Updater({success:"quotesContainer",
failure:"quotesContainer"},"/index.php",{parameters:{action:"ajax.quotes",func:"step3",quoteType:a}},{evalScripts:true},{evalJS:true});dom.quotesAtStep=3},quotesSetBuildType:function(a){$("quotesContainer").update('<img src="/images/loading.gif" border="0" alt="loading..." title="loading..." />');dom.quotesInterval=setInterval(function(){dom.quotesExpandWindow(a,"expand")},10)},quotesRentalsByFilter:function(){var a=$("category").value,c=$("manufacturer").value;new Ajax.Updater({success:"rentalsEntries",
failure:"rentalsEntries"},"/index.php",{parameters:{action:"ajax.quotes",func:"rentalsByFilter",category:a,manufacturer:c}},{evalScripts:true},{evalJS:true})},quotesRentalsByFilterUser:function(){new Ajax.Updater({success:"rentalsEntries",failure:"rentalsEntries"},"/index.php",{parameters:{action:"ajax.quotes",func:"rentalsByFilter",user:"sess"}},{evalScripts:true},{evalJS:true})},quotesRentalsSetQuantity:function(a,c){new Ajax.Updater({success:"quotesLoader"},"/index.php",{parameters:{action:"ajax.quotes",
func:"rentalsSetQty",qty:a,rental:c}},{evalScripts:true},{evalJS:true})},quotesRentalsPrepare:function(){new Ajax.Request("/index.php",{method:"post",parameters:"action=ajax.quotes&func=rentalsPrepare&comments="+$("comments").value,onSuccess:function(a){if(a.responseText<=0){alert("Error, please select at least one item from our inventory");return false}else $("quotesContainer").update(a.responseText)}})},quotesExpandWindow:function(a,c){var d,e;c=680;var f=0,g,h;e=dom.quotesGetAvailableWinProps();
g=e[0];h=e[1];var j=document.documentElement.scrollTop||document.body.scrollTop||window.pageYOffset,k=document.documentElement.scrollLeft||document.body.scrollLeft||window.pageXOffset;j=!j?0:j;k=!k?0:k;d=$("quotes").getWidth();e=$("quotes").getHeight();var l=Math.round(5);if(e<c){dom.inc++;a=(g-d)/2+k;f=(h-(f+e))/2+j;$("quotes").setStyle({left:a+"px",top:f+"px"});f=Math.round((c-e)/l);$("quotes").setStyle({height:f+e+dom.inc+"px"});$("quotesContainer").setStyle({height:f+e+dom.inc+"px"})}else{clearInterval(dom.quotesInterval);
new Ajax.Updater({success:"quotesContainer",failure:"quotesContainer"},"/index.php",{parameters:{action:"ajax.quotes",func:"step4",buildType:a}},{evalScripts:true},{evalJS:true});return true}},quotesCollapseWindow:function(){var a,c,d=215,e,f;c=dom.quotesGetAvailableWinProps();e=c[0];f=c[1];var g=document.documentElement.scrollTop||document.body.scrollTop||window.pageYOffset,h=document.documentElement.scrollLeft||document.body.scrollLeft||window.pageXOffset;g=!g?0:g;h=!h?0:h;a=$("quotes").getWidth();
c=$("quotes").getHeight();var j=Math.round(5);c==d&&clearInterval(dom.quotesInterval);if(c>d){d=Math.round(c/j);$("quotes").setStyle({height:c-d+"px"});$("quotesContainer").setStyle({height:c-d+"px"});e=(e-a)/2+h;c=(f-(d+c))/2+g;$("quotes").setStyle({left:e+"px",top:c+"px"})}else{clearInterval(dom.quotesInterval);return true}},quotesInit:function(){dom.quotesBegin();switch(dom.quotesAtStep){case 2:dom.quotesSetCity();break;case 3:dom.quotesSetType();break;default:dom.quotesStep1()}},quotesUploadListRefresh:function(){new Ajax.Updater({success:"uploadedFiles",
failure:"uploadedFiles"},"/index.php",{parameters:{action:"ajax.quotes",func:"uploadListRefresh"}},{evalScripts:true},{evalJS:true})},quotesUploadDeleteFile:function(a){new Ajax.Updater({success:"uploadedFiles",failure:"uploadedFiles"},"/index.php",{parameters:{action:"ajax.quotes",func:"uploadDeleteFile",file:a}},{evalScripts:true},{evalJS:true})},quotesSubmit:function(a){new Ajax.Request("/index.php",{method:"post",parameters:"action=ajax.quotes&func=quotesSubmit&type="+a+"&"+$("quotesInfoForm").serialize(),
onSuccess:function(c){if(c.responseText==1||c.responseText==true){$("quotesContainer").update('<img src="/images/loading.gif" border="0" alt="loading..." title="loading..." />');new Ajax.Updater({success:"quotesContainer",failure:"quotesContainer"},"/index.php",{parameters:{action:"ajax.quotes",func:"quotesThanks"}});dom.quotesInterval=setInterval(function(){dom.quotesCollapseWindow()},10);dom.quotesAtStep=0}else alert(c.responseText)}})},quotesClose:function(){$("quotes").hide();$("blackout").hide()}};