
try {
  document.execCommand("BackgroundImageCache", false, true);
} catch(err) {}


// Splash Slideshow

function slideshow() {
	if (document.getElementById('splashImage')) {
		$('#splashImage').cycle({
			fx:      'fade', 
			speed:    3000, 
			timeout:  6000,
			next:   '#slideshow', 
			pause:   0
		});
		
		$('#splashImage.paused')
			.each(function () {
				pausePlay();
			})
		;
	}
}

 
// Email address obfuscator

function mangle() {
	if (!document.getElementsByTagName && !document.createElement &&
		!document.createTextNode) return;
	var nodes = document.getElementsByTagName("span");
	for(var i=nodes.length-1;i>=0;i--) {
		if (nodes[i].className=="fixEmail") {
			var at = / at /;
			var dot = / dot /g;
			var node = document.createElement("a");
			var address = nodes[i].firstChild.nodeValue;

			address = address.replace(at, "@");
			address = address.replace(dot, ".");

			node.setAttribute("href", "mailto:"+address);
			node.appendChild(document.createTextNode(address));
			
			var prnt = nodes[i].parentNode;
			for(var j=0;j<prnt.childNodes.length;j++)
				if (prnt.childNodes[j] == nodes[i]) {
					if (!prnt.replaceChild) return;
					prnt.replaceChild(node, prnt.childNodes[j]);
					break;
				}
		}
	}
}


$(document).ready(function() {
	slideshow();
});


