function initSlider() {
	var index = 0;
	var items = $(".slider-item");
	var thumbs = $("#thumbs img");
	
	
	for (i=0;i<thumbs.length;i++)
	{
		$(thumbs[i]).addClass("thumb-"+i);
		$(items[i]).addClass("item-"+i);
	}

	$("#next").click(sift);
	//show(index);
	var fadeSpeed = 0;
	show(0);
	fadeSpeed = 800;
	setInterval(sift,4000);
	thumbs.slice(0,3).clone().appendTo("#thumbs");

	function sift()
	{
		if (index < (thumbs.length-1)) {index += 1; }
		else { index = 0; }
		show(index);
	}

	function show(num)
	{
		items.fadeOut(fadeSpeed);
		items.children().fadeOut(fadeSpeed);
		$(".item-"+num).stop().fadeIn(fadeSpeed);
		$(".item-"+num).children().stop().fadeIn(fadeSpeed);
		var scrollPos = (num+1)*60;
		$("#thumbs").stop().animate({scrollTop: scrollPos}, fadeSpeed);
		
	}
}

function applyFixes() {
	//$("#footer-middle").attr("height",$("#footer").attr("height"));
	//footerHeight = footerHeight+"px";
	//$("#footer .heading").html(footerHeight);
	//$("#footer-middle").animate({height: footerHeight}, 900);
	

	if($(".pages li:first").hasClass("current_page_item"))
	{
		$("#pages-triangle").css('borderColor','transparent #884400 transparent transparent');
	}
	else
	{
		$(".pages li:first").mouseover(function() {
			$("#pages-triangle").css('borderColor','transparent #884400 transparent transparent');
		});
		$(".pages li:first").mouseout(function() {
			$("#pages-triangle").css('borderColor','transparent #000000 transparent transparent');
		});
	}
	
	$(".single-post-wrapper img").each(function() {
		if($(this).width() >=586) {
			$(this).css({'display':'none'});
		}
		else {
			if($(this).width() >= 450) {
				$(this).css({'width':'450px;'});
			}
		}
	});
	
	$("#next").animate({'opacity':'0.5'},0);
	
	$("#next").hover(function() {
		$(this).stop().animate({'opacity':'1'},500);
	}, function() {
		$(this).stop().animate({'opacity':'0.5'},500);
	});
	
	//$("#sidebar").css({'height':$("content").height()});
	//alert($("content").css('height'));
}

function searchForm() {
	var search = document.getElementById('s');
	if (search.value == "Search...") {
		search.value = "";
	}
}
