/* ----------------------------------------------------------------------------------------------------
 * Image fade by Gabriel McGovern - Requires jQuery 1.2.6+
 * Requires: 	images to fade in div#mainImage
 *				links to start fade have class="fade" where idref == div#mainImage img#id
 * To change fade time, replace: .animate({opacity: 1}); with .animate({opacity: 1},1500); where 1500 = the number of milliseconds to run.
 * --------------------------------------------------------------------------------------------------- */
 
$(document).ready(function(){ 	   
	var zIndex=1;
	
	$(".fade").mouseover(function(){
			var idref = $(this).attr("idref");																		// get id of image to show
			if($("#mainImage img[id='"+idref+"']").css('zIndex') != zIndex){ 									  	// fire if not on top already
				zIndex+=1;																							// advance z index
				$("#mainImage img[id='"+idref+"']").css('opacity',0).css('z-Index',zIndex).animate({opacity: 1},500); // hide,move to top, show
			}
	});
});