
$.fn.wait = function(time, type) {
	time = time || 1000;
	type = type || "fx";
	return this.queue(type, function() {
		var self = this;
		setTimeout(function() {
			$(self).dequeue();
		}, time);
	});
};

$(".fade_image").ready(function() {
	function fadeImage() {
		$(".fade_image").wait(5000)
			.animate({opacity:'0.0'},1000)
			.wait(5000)
			.animate({opacity:'1.0'},1000,fadeImage);
	}

	fadeImage();
});

$("#navigation").ready(function() {
	$("#navigation").css("opacity","0.8");
});

//Various IE Fixes
if ($.browser.msie && $.browser.version<7) {
	$(document).ready(function() {
		/*Png fixes*/
		$("#navigation li img").each(function(i) {
			DD_belatedPNG.fixPng(this);
		});
		
		DD_belatedPNG.fix("#logo");
		DD_belatedPNG.fix("#navigation li.selected a");
		DD_belatedPNG.fix("#content_text");
		
		$("#content h3").css({"border-bottom":"1px solid white", "background-image":"none"});
		
		/*Height: 100% fix*/
		document.body.onresize = function() {
			/*Height: 100% fix*/
			$("#navigation").css("height", $("#header").height());
		};
		$("#navigation").css("height", $("#header").height());
	});
}
