$(document).ready(function() {
				
				//controls jwSlider
	$("#imageslider").jwSlider();						
	
				//handles dimensional styling for main navigation list elements
	$("ul#navigation li").hover( 
		function () {
			$(this).addClass("hover");
		}, 
		function () {
			$(this).removeClass("hover");
		}
	);		
	
	//makes sure that the slider and the nav are always the same width
	function sliderWidth(liwidth){
		
		navwidth = 0;
		
		liwidth.each(function() {
			navwidth += $(this).width();
		});
		
		/*if ($.browser.mozilla) {
			navwidth -= 2;
		}
		*/
		
		$("#header").css( "width", navwidth);
		$("#navigation").css( "width", navwidth);
		$("#navcontainer").css( "width", navwidth);
		$("#imageslider").css( "width", navwidth);
		$("#imageslider li").css( "width", navwidth);
	}
	
	sliderWidth($("ul#navigation li"));

});




$(window).load(function() {				
	
	$("#content").equalHeights();	
	$("#pagetitle").SubContentEqualHeight();

});




$.fn.SubContentEqualHeight = function(pt)
{
	var pth = $(this).height();
	
	$("#subcontent").equalHeights();
	
	if ($.browser.msie && $.browser.version == 6.0) 
	{ 
		$(this).css({'height': pth}); 
	}
			
	$(this).css({'min-height': pth});
};




$.fn.equalHeights = function(px) 
{	
	$(this).each(function()
	{
		var currentTallest = 0;
		
		$(this).children().each(function(i)
		{
			if ($(this).height() > currentTallest) 
			{ 
				currentTallest = $(this).height(); 
			}
		});
		
		currentTallest += 20;

		if ($.browser.msie && $.browser.version == 6.0) 
		{ 
			$(this).children().css({'height': currentTallest}); 
		}
		
		$(this).children().css({'min-height': currentTallest}); 
	
	});
	
	return this;
	
};

