
$(document).ready(function(){

    $("#slides").slides({
        generatePagination: true,
        play: 10000,
		paginationClass: 'pagination' 
    });
    $(".nav2 li:first").css("border-left","none");
    $(".nav2 li:last").css("border-right","none");
    
	
    
    $(".pagination li a:first").css({
        'border-radius': '6px 0px 0px 6px'
    });
    
    $(".pagination li a:last").css({
        'border-radius': '0px 6px 6px 0px'
    });
    
    var k = 0;
        
	var slideTitles = ["Lennox Winter Promotion","Warm up with a Gas Fireplace","HomeStars - Reviews","Homestars - Furnace Replacement"];

	$(".pagination li").each(function() {
		$(this).find('a').text(slideTitles[k]);
		k++;
	});
	
	
	
    $(".homeowners").hover(function(){
        $(".toolbox").css('right','190px').show().animate({
			top: '164px'
        }, 200, function(){
            animating = false;
        });
    }, function(){
            $(".toolbox").hide().css('top','212px');
    });
    
    $(".programs").hover(function(){
        $(".clipboard").css('right','20px').show().animate({
            top: '164px'
        }, 200, function(){
        
		});
        
    }, function(){
        $(".clipboard").hide().css('top','212px');
    });
    
    
    $(".expert").hover(function(){
        $(".dude").css('right','372px').show().animate({
			top: '164px'
        }, 200, function(){
            animating = false;
        });
    }, function(){
            $(".dude").hide().css('top','212px');
    });
    
    
    
    $("#home, #heating, #cooling, #fireplacing,#airquality, #geothermal,#boilers,#hvac").mousemove(function(){
        $$ = $(this).attr('id');
        $("." + $$ + "Link").css('color', '#FFFFFF');
    });
    
    $(".home,.heating,.cooling,.fireplacing,.airquality,.geothermal,.boilers,.hvac").mouseenter(function(){
        $$ = $(this).attr('class');
        if ($(this).hasClass('home')) {
        
        }
        else {
            $("." + $$ + "Link").css('color', '#FFFFFF');
        }
       
	   if ($(this).hasClass("cooling")) {
        $("#" + $$).css('left', '92px');
	   }  else if ($(this).hasClass("fireplacing")) {
        $("#" + $$).css('left', '188px');
	   }  else if ($(this).hasClass("airquality")) {
        $("#" + $$).css('left', '302px');
	   }  else if ($(this).hasClass("geothermal")) {
        $("#" + $$).css('left', '423px');
	   }  else if ($(this).hasClass("boilers")) {
        $("#" + $$).css('left', '554px');
       }  else if ($(this).hasClass("hvac")) {
        $("#" + $$).css('left', '642px');
       }
	   else {
        $("#" + $$).css('left', '0px');
	   }
		
		
    });
    
    $(".home,.heating,.cooling,.fireplacing,.airquality,.geothermal,.boilers,.hvac").mouseleave(function(e){
        $$ = $(this).attr('class');
        $("." + $$ + "Link").css('color', '#333333');
        $("#" + $$).css('left', '-7000px');
    });
    
    $("#home").mouseleave(function(e){
        $$ = $(this).attr('id');
        if (e.pageY > 195) {
            $("." + $$ + "Link").css('color', '#333333');
            Cufon.refresh();
            $("#" + $$).css('left', '-7000px');
        }
    });
    
    $("#heating,#cooling,#fireplacing,#airquality,#geothermal,#boilers,#hvac").mouseleave(function(e){
        $$ = $(this).attr('id');
        if (e.pageY > 232) {
            $("." + $$ + "Link").css('color', '#333333');
            Cufon.refresh();
            $("#" + $$).css('left', '-7000px');
        }
    });
    
    $(".header-ad1,.header-ad2").hover(function(){
        $(this).css('background-position', '0px -146px')
    }, function(){
        $(this).css('background-position', '0px 0px')
    });
    
    if ($(".firstCol").height() > $(".thirdCol").height()) {
        $(".thirdCol").height($(".firstCol").height());
    }
    else {
        $(".firstCol").height($(".thirdCol").height());
    }
    
    $(".nav:first li").addClass("normal");
    
    $(".nav:first li a").hover(function(){
        $(this).parent().addClass("hovered");
        $(this).parent().removeClass("normal");
        $(this).css('color', 'white');
        Cufon.refresh();
    }, function(){
        $(this).css('color', '#333');
        $(this).parent().addClass("normal");
        $(this).parent().removeClass("hovered");
        Cufon.refresh();
        
    });
});

