﻿var homepage={slides:Object,current:Number,controls:Object,next:Object,previous:Object,moreShown:Boolean,init:function(){this.slides=$("div.slide");this.current=Math.floor(Math.random()*this.slides.length);this.controls=$("a.controls");this.next=$("a#next");this.previous=$("a#previous");this.moreShown=false;this.run()},run:function(){homepage.controls.fadeTo("fast",0.25);homepage.slides.eq(homepage.current).addClass("on");getThe.newColors();homepage.controls.hover(function(){$(this).stop().fadeTo("fast",
0.6)},function(){$(this).stop().fadeTo(1E3,0.25)});homepage.previous.click(function(a){$("#arrow").remove();alerts.showAlerts=false;if(homepage.current!=0){$("div.slide.on").removeClass("on").prev().addClass("on");homepage.current--}else{$("div.slide.on").removeClass("on");homepage.current=homepage.slides.length-1;homepage.slides.eq(homepage.current).addClass("on")}pageTracker._trackEvent("Home Slides","Click Prev",$("div.slide.on").attr("id"));getThe.newColors();a.preventDefault()});homepage.next.click(function(a){$("#arrow").remove();
alerts.showAlerts=false;if(homepage.current!=homepage.slides.length-1){$("div.slide.on").removeClass("on").next().addClass("on");homepage.current++}else{$("div.slide.on").removeClass("on");homepage.current=0;homepage.slides.eq(homepage.current).addClass("on")}homepage.moreShown==false?pageTracker._trackEvent("Home Slides","Click Next",$("div.slide.on").attr("id")):pageTracker._trackEvent("Home Slides","Click Next After More Shown",$("div.slide.on").attr("id"));getThe.newColors();a.preventDefault()})}},
getThe={changers:Object,newColors:function(){this.changers=$("div.slide.on").find("input[type=hidden]");this.changers.each(function(){if($(this).hasClass("all"))color.all($(this).attr("value"));else if($(this).hasClass("chameleon"))color.chameleon($(this).attr("value"));else if($(this).hasClass("links"))color.links($(this).attr("value"));else $(this).hasClass("background")&&color.background($(this).attr("value"))})}},alerts={showAlerts:Boolean,init:function(){this.showAlerts=true;$("#arrow").css("display",
"block").fadeTo(1,0);setTimeout("alerts.arrow()",15E3);this.run()},run:function(){if($.browser.msie&&$.browser.version.substr(0,1)<7)window.location="/About/"},arrow:function(){if(this.showAlerts==true){$("#arrow").animate({right:"54px",marginTop:"-73px",opacity:0.6},1E3,"easeOutBounce");pageTracker._trackEvent("Home Slides","More Shown","More Label Shown");homepage.moreShown=true}}},eventTracking={init:function(){this.run()},run:function(){$(".col1 a").click(function(){$(this).hasClass("homeButton")?
pageTracker._trackEvent("Home Services","Button Click",$(this).attr("id")):pageTracker._trackEvent("Home Services","Link Clicked",$(this).attr("id"))});$(".tunneler").click(function(){pageTracker._trackEvent("Home Slides","Slide call to action clicked",$("slide.on").attr("id"))})}};function initializeHome(){homepage.init();alerts.init();eventTracking.init()}$(document).ready(function(){initializeHome()});