$(document).ready(function() {

/*the following function makes the feature boxes an equal height */

    $(".smallBox ul").equalHeights();
    $(".largeBox blockquote").equalHeights();
    $(".feature").equalHeights();

/*
This function runs the slider.
*/	
	$("#slider").easySlider();	

/*
The following function makes each of the preview boxes a link. If javascript is off, just the 
image and more tab are links.
*/	
	
    $("div.featureBox").css("cursor","pointer");
	$("div.featureBox").click(function(){
		window.location=$(this).find("a").attr("href"); return false;
	});

/*
The following function makes the box link change to it's hover state when anywhere in the box is rolled over. Then returns it to it's normal state when rolled out.
*/	
	
	$("div#blogFeature").hover(
	    function(){
		    $("#blogFeature .box_links a").css("background", "transparent url(/media//box_links.png) 0 -120px");
	    },
	    function(){
		    $("#blogFeature .box_links a").css("background", "transparent url(/media//box_links.png) 0 0");
		}
	);

	$("div#pressFeature").hover(
	    function(){
		    $("#pressFeature .box_links a").css("background", "transparent url(/media//box_links.png) 0 -160px");
	    },
	    function(){
		    $("#pressFeature .box_links a").css("background", "transparent url(/media//box_links.png) 0 -40px");
		}
	);

	$("div#ourauthorsFeature").hover(
	    function(){
		    $("#ourauthorsFeature .box_links a").css("background", "transparent url(/media//box_links.png) 0 -200px");
	    },
	    function(){
		    $("#ourauthorsFeature .box_links a").css("background", "transparent url(/media//box_links.png) 0 -80px");
		}
	);

	$("div#authorsFeature").hover(
	    function(){
		    $("#authorsFeature .box_links a").css("background", "transparent url(/media//box_links.png) 0 -320px");
	    },
	    function(){
		    $("#authorsFeature .box_links a").css("background", "transparent url(/media//box_links.png) 0 -240px");
		}
	);
	
	$("div#agentsFeature").hover(
	    function(){
		    $("#agentsFeature .box_links a").css("background", "transparent url(/media//box_links.png) 0 -360px");
	    },
	    function(){
		    $("#agentsFeature .box_links a").css("background", "transparent url(/media//box_links.png) 0 -280px");
		}
	);

});


