
$(function () {
	
	// onload, check all images with 'imghover' class; these have an image to display on hover
	$('img.imghover')
		.each(function () {			
			var n = this.src; // our normal image			
			$("<img>").attr("src", n); // preload the image
		
			// store the name of the normal and hover image in element
			$(this)
				.data('img-normal', n)	
				.data('img-hover', n.substring(0, n.lastIndexOf('.')) + '-hover.' + n.substring(n.lastIndexOf('.') + 1));	
		})
		.hover(
			function () {	this.src = $(this).data('img-hover');	 }, 
			function () {	this.src = $(this).data('img-normal'); }	
		);
		
});

/* ============================================================================================== */
/* load slideshow
/* ============================================================================================== */

var flashvars = {
	xmlFile: "frontpage/slideshow/slideshow.xml"
};
var params = {
	menu: "false",
	allowFullscreen: "false",
	allowScriptAccess: "always",
	wmode: "transparent"
};
var attributes = { 
	id:"SimpleSlideshow"
};
swfobject.embedSWF("frontpage/slideshow/SimpleSlideshow.swf", "slideshow", "444", "355", "9.0.0", "frontpage/slideshow/expressInstall.swf", flashvars, params, attributes);

