jQuery.preloadImages = function()
{
	for(var i = 0; i<arguments.length; i++)
	{
		jQuery("<img>").attr("src", arguments[i]);
	}
}


$(document).ready(function(){
	$.preloadImages("../images/home/homepage/header_johnny.jpg", "../images/home/homepage/header_michael.jpg", "../images/home/homepage/header_elvis.jpg");					   
	
	//Hooray! This works but is a bit dull
	/*
	$("#pantheon a").mouseover(function(){
		var newimg = this.id;
		var newimg = "../images/temple/index/" + newimg + ".jpg";
		$("#pantheon_main img").attr("src", newimg);
	
	});*/
	
	$("#pantheon a").mouseover(function(){
	   var newimg = this.id + "img";
	   $("#pantheon img#" + newimg).animate({opacity: 1}, "slow");
	   $(this).addClass("pantheonbg");
	   var text = "#" + this.id + "text";
	   $(text).animate({opacity: 1}, "slow");
	});
	
	$("#pantheon a").mouseout(function(){
	   var newimg = this.id + "img";		
	   $("#pantheon img#" + newimg).animate({opacity: 0}, "slow");
	   $(this).removeClass("pantheonbg");
	   var text = "#" + this.id + "text";
	   $(text).animate({opacity: 0}, "slow");
	});
	
	
	/*
	$("#hpheader a").mouseout(function(){
		var headerclass = this.id;								
		$("#homepage").removeClass(headerclass);
		
		//get name of relevant info box
		var infobox = headerclass.slice(6);
		var infobox = "#" + infobox + "info" + " h2";
		//Decrease the font of the heading
		$(infobox).animate({fontSize: "1.5em"}, "slow");	
		
	});*/

});


