
if ( $.browser.msie ) {
	if ( $.browser.version == '6.0' ) {
		document.write('<link rel="stylesheet" type="text/css" href="css/ie6_styles.css" />');
		//alert("ie 6")
	} else {
		document.write('<link rel="stylesheet" type="text/css" href="css/ie_styles.css" />');
		//alert("ie > 6")
	}
} else {
	document.write('<link rel="stylesheet" type="text/css" href="css/non_ie_styles.css" />');
}



$(document).ready(function(){	
	
	// Find and turn main menu on to match current page         
	var currentPage = $('body').attr('id');
	if (currentPage != 'null') { 
	    var tmpSrc = $('[name=' + currentPage + ']').attr('src');     
		tmpSrc = tmpSrc.replace('_off.gif', '_on.gif'); 
		     
		$('[name = ' + currentPage + ']').attr('src', tmpSrc);
	}           
	    
	// Match sidebar height to main content height                                   
	var mainContentHeight = $("#main-content").height(); 
	//var sidebarHeight = $("#sidebar").height();
	var sidebarHeight = 1644;                        
	if ( mainContentHeight > sidebarHeight ) {
	   $("#slider:has(li)").height(sidebarHeight);  
	} else {      
	    $("#slider").easySlider({
			prevText: 'Previous',
			nextText: 'Next',		
			firstShow: true,
			lastShow: true,
			vertical: true, 
			continuous: true 		
		});
	    $("#slider:has(li)").height(mainContentHeight-116);
	}
	//$("#slider:has(li)").height(mainContentHeight-116);
	//$("#slider:has(li)").height(540);                                                                                                                             
	
	// Rollovers for main menu
	$("#main-nav li img").mouseover(
		function() {
			var oldSrc = $(this).attr('src');
			var newSrc = oldSrc.replace('_off.gif', '_on.gif');
			$(this).attr('src', newSrc); 
		} 
	);
	
	$("#main-nav li img").mouseout(
		function() {
			var oldSrc = $(this).attr('src');
			var newSrc = oldSrc.replace('_on.gif', '_off.gif');
			
			// Only swap off state if this is not the current page
			if (currentPage != $(this).attr('name')){
				 $(this).attr('src', newSrc); 
			}
			 
		} 
	);
	
	
});