jQuery.timer=function(interval,callback)
{var interval=interval||100;if(!callback)
return false;_timer=function(interval,callback){this.stop=function(){clearInterval(self.id);};this.internalCallback=function(){callback(self);};this.reset=function(val){if(self.id)
clearInterval(self.id);var val=val||100;this.id=setInterval(this.internalCallback,val);};this.interval=interval;this.id=setInterval(this.internalCallback,this.interval);var self=this;};return new _timer(interval,callback);};;(function($){function History()
{this._curHash='';this._callback=function(hash){};};$.extend(History.prototype,{init:function(callback){this._callback=callback;this._curHash=location.hash;if($.browser.msie){if(this._curHash==''){this._curHash='#';}
$("body").prepend('<iframe id="jQuery_history" style="display: none;"></iframe>');var iframe=$("#jQuery_history")[0].contentWindow.document;iframe.open();iframe.close();iframe.location.hash=this._curHash;}
else if($.browser.safari){this._historyBackStack=[];this._historyBackStack.length=history.length;this._historyForwardStack=[];this._isFirst=true;this._dontCheck=false;}
this._callback(this._curHash.replace(/^#/,''));setInterval(this._check,100);},add:function(hash){this._historyBackStack.push(hash);this._historyForwardStack.length=0;this._isFirst=true;},_check:function(){if($.browser.msie){var ihistory=$("#jQuery_history")[0];var iframe=ihistory.contentDocument||ihistory.contentWindow.document;var current_hash=iframe.location.hash;if(current_hash!=$.history._curHash){location.hash=current_hash;$.history._curHash=current_hash;$.history._callback(current_hash.replace(/^#/,''));}}else if($.browser.safari){if(!$.history._dontCheck){var historyDelta=history.length-$.history._historyBackStack.length;if(historyDelta){$.history._isFirst=false;if(historyDelta<0){for(var i=0;i<Math.abs(historyDelta);i++)$.history._historyForwardStack.unshift($.history._historyBackStack.pop());}else{for(var i=0;i<historyDelta;i++)$.history._historyBackStack.push($.history._historyForwardStack.shift());}
var cachedHash=$.history._historyBackStack[$.history._historyBackStack.length-1];if(cachedHash!=undefined){$.history._curHash=location.hash;$.history._callback(cachedHash);}}else if($.history._historyBackStack[$.history._historyBackStack.length-1]==undefined&&!$.history._isFirst){if(document.URL.indexOf('#')>=0){$.history._callback(document.URL.split('#')[1]);}else{$.history._callback('');}
$.history._isFirst=true;}}}else{var current_hash=location.hash;if(current_hash!=$.history._curHash){$.history._curHash=current_hash;$.history._callback(current_hash.replace(/^#/,''));}}},load:function(hash){var newhash;if($.browser.safari){newhash=hash;}else{newhash='#'+hash;location.hash=newhash;}
this._curHash=newhash;if($.browser.msie){var ihistory=$("#jQuery_history")[0];var iframe=ihistory.contentWindow.document;iframe.open();iframe.close();iframe.location.hash=newhash;this._callback(hash);}
else if($.browser.safari){this._dontCheck=true;this.add(hash);var fn=function(){$.history._dontCheck=false;};window.setTimeout(fn,200);this._callback(hash);location.hash=newhash;}
else{this._callback(hash);}}});$(document).ready(function(){$.history=new History();});})(jQuery);;var featuredWorkSecond=0;jQuery.preloadImages=function(){for(var i=0;i<arguments.length;i++)
{jQuery("<img/>").attr("src",arguments[i]);}};$("document").ready(function(){$.preloadImages("/images/nav-main-li-a-hover.png","/media/pool-house-935x375.jpg","/media/mountain-view-935x375.jpg","/media/bean-garden-pool-935x375.jpg","/media/patio-seating-935x375.jpg","/media/bean-935x375.jpg","/media/pergola-935x375.jpg","/media/fieldstone-freeform-935x375.jpg","/media/stone-patio-wall-935x375.jpg","/media/freeform-garden-pool-935x375.jpg");$("a.external").click(function(){urchinTracker(this.href);});$("a.pdf").click(function(){urchinTracker(this.href);});$("#nav-main li").mouseover(function(){$(this).addClass("sfHover");});$("#nav-main li").mouseout(function(){$(this).removeClass("sfHover");});$("ul#featured-work-controls").show();$("ul#featured-work-controls li a#play").parent().hide();$("ul#featured-work").addClass("loop");$.timer(1000,function(timer){if($("ul#featured-work").hasClass("loop")){featuredWorkSecond++;if(featuredWorkSecond>=5){featuredWorkSecond=0;moveNext();}}});$("ul#featured-work-controls li a#next").click(function(){pause();moveNext();$("ul#featured-work-controls li a#pause").parent().hide();$("ul#featured-work-controls li a#play").parent().show();return false;});$("ul#featured-work-controls li a#previous").click(function(){pause();movePrevious();$("ul#featured-work-controls li a#pause").parent().hide();$("ul#featured-work-controls li a#play").parent().show();return false;});$("ul#featured-work-controls li a#play").click(function(){moveNext();play();$("ul#featured-work-controls li a#play").parent().hide();$("ul#featured-work-controls li a#pause").parent().show();return false;});$("ul#featured-work-controls li a#pause").click(function(){pause();$("ul#featured-work-controls li a#pause").parent().hide();$("ul#featured-work-controls li a#play").parent().show();return false;});});function moveNext(){if($("ul#featured-work li.current").next("li").size()==0){$("ul#featured-work li.current").fadeOut(500).removeClass("current");$("ul#featured-work li").fadeOut(500).filter(":first").addClass("current").fadeIn(500);}else{$("ul#featured-work li.current").fadeOut(500).removeClass("current").next("li").addClass("current").fadeIn(500);}};function movePrevious(){if($("ul#featured-work li.current").prev("li").size()==0){$("ul#featured-work li.current").fadeOut(500).removeClass("current");$("ul#featured-work li").fadeOut(500).filter(":last").addClass("current").fadeIn(500);}else{$("ul#featured-work li.current").fadeOut(500).removeClass("current").prev("li").addClass("current").fadeIn(500);}};function play(){featuredWorkSecond=0;$("ul#featured-work").addClass("loop");};function pause(){$("ul#featured-work").removeClass("loop");};;$("document").ready(function(){$("a[rel='history']").click(function(){$(this).each(function(i){$.history.load(this.hash.substr(1));});return false;});});