$(document).ready(function(){
		$('.searchBox').hide();
		
		$(".search").click(function () { 
     		 $(".searchBox").fadeIn("slow");
     		 return false;
		});
		
		$("input.searchInput").click(function () { 
     		 $(this).text(" "); 
		});

		$("a.searchClose").click(function () { 
     		 $(".searchBox").fadeOut("slow");
     		 return false;
		});

		
		$("#closeFeature").live("click", function () {
    		 $("#featured").animate( { top:"-296px"}, "slow" );
    		 $("#closeFeature").text("open featured content");
    		 $("#closeFeature").addClass("openThis");
    		 $.cookie('featuredContent', 'closed', {expires: 30});
    	});
    	$(".openThis").live("click", function(){
      		$("#featured").animate( { top:"100px"}, "slow" );
      		$("#closeFeature").text("close featured content");
      		$("#closeFeature").removeClass("openThis");
      		$.cookie('featuredContent', null);
    	});

    	var featuredContent = $.cookie('featuredContent');
    	if (featuredContent == 'closed') {
        	$('#featured').css("top","-296px");
        	$("#closeFeature").text("open featured content");
    		$("#closeFeature").addClass("openThis");
   		};

		$("#panels").easySlider({
				controlsShow: true,
				auto: true, 
				continuous: true,
				pause: 5000,
				numeric: true
		});
		

		
		
		$('.boxcaption').hide();
		
		$('.caption').hover(function(){
			var boxcaption = $(".boxcaption", this)
			var flag = $(".commentFlag", this)
			if(boxcaption.is(':animated')) {
				boxcaption.stop().fadeTo("slow",.9, function () {
					flag.stop().fadeTo("slow",0);
				})
			}else{
				boxcaption.fadeIn("slow", function () {
					flag.fadeOut("slow");
				})
			}
			
		}, function() {
			var boxcaption = $(".boxcaption", this)
			var flag = $(".commentFlag", this)
			if(boxcaption.is(':animated')) {
				boxcaption.stop().fadeTo("slow",0, function () {
					flag.stop().fadeTo("slow",1);
				})
			}else{
				boxcaption.fadeOut("slow", function () {
					flag.fadeIn("slow");
				})
			}
		});
		
		
		//For Shitty Old IE.....YAY!!!
		$('.article:nth-child(2), .article:nth-child(5), .article:nth-child(8)').css({"margin-left": 62, "margin-right" : 62});
		
		
		
		
		var indexID = $("#indexID").text();
		
		if (indexID != ":)")
		{
			$('#footer').always_at_bottom();
		}
		
});
$(window).resize(function(){
		var indexID = $("#indexID").text();
		
		if (indexID != ":)")
		{
			$('#footer').always_at_bottom();
		}
});

