(function($){if(!document.defaultView||!document.defaultView.getComputedStyle){var oldCurCSS=jQuery.curCSS;jQuery.curCSS=function(elem,name,force){if(name==='background-position'){name='backgroundPosition'}if(name!=='backgroundPosition'||!elem.currentStyle||elem.currentStyle[name]){return oldCurCSS.apply(this,arguments)}var style=elem.style;if(!force&&style&&style[name]){return style[name]}return oldCurCSS(elem,'backgroundPositionX',force)+' '+oldCurCSS(elem,'backgroundPositionY',force)}}var oldAnim=$.fn.animate;$.fn.animate=function(prop){if('background-position'in prop){prop.backgroundPosition=prop['background-position'];delete prop['background-position']}if('backgroundPosition'in prop){prop.backgroundPosition='('+prop.backgroundPosition}return oldAnim.apply(this,arguments)};function toArray(strg){strg=strg.replace(/left|top/g,'0px');strg=strg.replace(/right|bottom/g,'100%');strg=strg.replace(/([0-9\.]+)(\s|\)|$)/g,"$1px$2");var res=strg.match(/(-?[0-9\.]+)(px|\%|em|pt)\s(-?[0-9\.]+)(px|\%|em|pt)/);return[parseFloat(res[1],10),res[2],parseFloat(res[3],10),res[4]]}$.fx.step.backgroundPosition=function(fx){if(!fx.bgPosReady){var start=$.curCSS(fx.elem,'backgroundPosition');if(!start){start='0px 0px'}start=toArray(start);fx.start=[start[0],start[2]];var end=toArray(fx.options.curAnim.backgroundPosition);fx.end=[end[0],end[2]];fx.unit=[end[1],end[3]];fx.bgPosReady=true}var nowPosX=[];nowPosX[0]=((fx.end[0]-fx.start[0])*fx.pos)+fx.start[0]+fx.unit[0];nowPosX[1]=((fx.end[1]-fx.start[1])*fx.pos)+fx.start[1]+fx.unit[1];fx.elem.style.backgroundPosition=nowPosX[0]+' '+nowPosX[1]}})(jQuery);(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev])}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev])};var handleHover=function(e){var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t)}if(e.type=="mouseenter"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob)},cfg.timeout)}}};return this.bind('mouseenter',handleHover).bind('mouseleave',handleHover)}})(jQuery);$.fn.pause=function(duration){$(this).animate({dummy:1},duration);return this};$(document).ready(function(){$("body").css({'background-image':'url(img/mainbg2.png)'});function megaHoverOver(){$(this).find("a").animate({'backgroundPosition':'0px -70px'},300);$(this).find(".sub").stop().fadeTo(800,1).show();(function($){jQuery.fn.calcSubWidth=function(){rowWidth=0;$(this).find("ul").each(function(){rowWidth+=$(this).width()})}})(jQuery);if($(this).find(".row").length>0){var biggestRow=0;$(this).find(".row").each(function(){$(this).calcSubWidth();if(rowWidth>biggestRow){biggestRow=rowWidth}});$(this).find(".sub").css({'width':biggestRow});$(this).find(".row:last").css({'margin':'0'})}else{$(this).calcSubWidth();$(this).find(".sub").css({'width':rowWidth})}}function megaHoverOut(){$(this).find(".sub").stop().fadeTo('fast',0,function(){$(this).hide()});var pageison=$("#pageon").val();$("ul#topnav li a").each(function(){var hovpage=$(this).attr("name");if(pageison==hovpage){$(this).animate({'backgroundPosition':'0px -70px'},300)}else{$(this).animate({'backgroundPosition':'0px -150px'},300)}})}var config={sensitivity:5,interval:50,over:megaHoverOver,timeout:0,out:megaHoverOut};$("ul#topnav li").hoverIntent(config);$("ul#topnav li a").click(function(e){$('#landscape_specials_west_palm_beach').hide();$('#irrigation_contractor').hide();var linkname=$(this).attr("name");var prevlink=$("#pageon").val();if(linkname=="contact_usz"){}else{e.preventDefault();$(this).removeAttr("href");linkname=linkname.replace("sub_services_","sub/");$("#pageon").val(linkname);$('#innerBody').empty().html("<div style='height:1000px;'></div>").load(linkname+".php");$('#landscape_specials_west_palm_beach').show();$('#irrigation_contractor').show()}});$("ul#topnav li .sub").css({'opacity':'0'})});
