$(document).ready(function(){
	$("#nav li.current ul").show(0);
	
	var imageSet = 1;
	var number;
	
	/*
		var homeSlider = ['home', 'Holstein', 'High Component Breeds', 'Beef', 'Designations', 'Programs'];
		function formatText(index, panel) {
			return homeSlider[index - 1];
		}
	*/
	// Add rounded corners to the main content areaOfImageSets = 2;
	
	//Grab the last image set the user veiewed from the cookie and increment it
	imageSet = Number($.cookie('lastImgSet')) + 1;
	
	// If we don't have that many image sets, start back at 1 
	if (imageSet > 3)
		imageSet = 1;
	
	// Replace the src of the images with the new set
	$("#homeSlider li").each(function(index){
		var imgNumber = index + 1;
		$(this).children("img").attr('src', 'images/slider/group' + imageSet + "img" + imgNumber + '.jpg');
	});
			
		// Set up the slider on the homepage
		$("#homeSlider").anythingSlider({
			buildArrows: false,
			buildNavigation: false,
			easing: 'easeInOutCubic',
			delay: 5000
		});
		
	
	// Switch to the appropriate panel when the link is hovered (by looking at the class of <a>
	$(".sliderNav a").hover(function () {
		var slider = $(this).attr("class");
		$('#homeSlider').anythingSlider(slider);
	});
	
	$('#homeSlider').bind('slide_begin', function(e, slider){
		$(".sliderNav a").removeClass("cur");
		$(".sliderNav ." + slider.currentPage).addClass("cur");
		// alert(slider.currentPage);
	});
	
	$("ul.thumbNav li:first").hide();
	$("ul.thumbNav li:last").addClass("last");
	$(".no-boxshadow #nav li a").addClass("cufon");
	$("#nav ul ul li a").removeClass("cufon");
	$(".no-boxshadow ul.thumbNav").addClass("cufon");
	$(".boxshadow .sliderNav").removeClass("cufon");
	
	// $(".whiteBox").corner();
	// $(".whiteBoxWrap").corner();
	
	Cufon.replace('.cufon')
	$.cookie("lastImgSet", imageSet, { expires: 7 });
	
	// Add a class to odd rows for zebra striping
	$("table tr:nth-child(even)").addClass("even");
	$("td:last-child").addClass("last");
	$("th:last-child").addClass("last");
	
	$(".search").focus(function(){
		log("focused");
		if ($(this).val() == $(this)[0].title){
            $(this).removeClass("defaultTextActive");
            $(this).val("");
        }
    });
    
    
    $(".search").blur(function(){
    	log("blurred");
        if ($(this).val() == ""){
            $(this).addClass("defaultTextActive");
            $(this).val($(this)[0].title);
        }
    });
    
    $(".search").blur();  

});






















