
$(document).ready(function(){var active=$("#navigation #active").attr("title");var activeClass=active.replace("&",'').replace(/\s+/g,'-').toLowerCase();var aSpeed=200;$("#navigation li a").hoverIntent({sensitivity:10,interval:500,over:showSubnav,timeout:100,out:emptyfn});function showSubnav(){var over=$(this);var overClass=over.attr("title").replace("&",'').replace(/\s+/g,'-').toLowerCase();var currentClass=$("#subNavigation li:visible").attr("class");if(overClass!==currentClass){$("#navigation li").find(".active").removeClass("active");$(this).addClass("active");$("#subNavigation li:visible").stop().animate({opacity:0},200);setTimeout(function(){$("#subNavigation li:visible").hide();$("#subNavigation").find("."+overClass).css({opacity:0}).show().stop().animate({opacity:1},aSpeed);},200);if($("#navWrapper ul").size()==3&&$("#accordianNav").css("opacity")==1){$("#accordianNav").animate({"opacity":0},300,function(){$(this).hide(150);});}else if($(this).attr("id")=="active"&&$("#accordianNav").css("opacity")==0){$("#accordianNav").show(150);setTimeout(function(){$("#accordianNav").animate({"opacity":1},300);},150);}}
resizeColumn(overClass);};function emptyfn(){};$("#navWrapper").mouseleave(hideSubNav);function hideSubNav(){var currentClass=$("#subNavigation li:visible").attr("class");if(activeClass!==currentClass){$("#navigation li").find(".active").removeClass("active");$("#subNavigation li").animate({opacity:0},200);$("#subNavigation li").hide();$("#subNavigation").find("."+activeClass).show().animate({opacity:1},aSpeed);if($("#navWrapper ul").size()==3){$("#accordianNav").show(150);setTimeout(function(){$("#accordianNav").animate({"opacity":1},300);},150);}}
resizeColumn(activeClass);};var resizeColumn=function(newClass){var newWidth=0;if(newClass=="company"){newWidth=122;}
if(newClass=="roofing"){newWidth=158;}
if(newClass=="sheet-metal"){newWidth=145;}
if(newClass=="news-events"){newWidth=123;}
if(newClass=="contact"){newWidth=167;}
if(newClass=="air-control"){newWidth=104;}
if(newClass=="energy-solutions"){newWidth=200;}
if(newWidth==0){window.setTimeout(function(){$("#subNavigation").hide();$("#subNavigation").width(0);$("#subNavigation").show();},100);}else if(newWidth<$("#subNavigation").width()){window.setTimeout(function(){$("#subNavigation").stop().animate({width:newWidth},300);},200);}else{window.setTimeout(function(){$("#subNavigation").stop().animate({width:newWidth},300);},200);}};setTimeout(function(){resizeColumn(activeClass);},520);});
