// stoo slideShow 1.1
// (c)2007 Stoo - http://www.glitch.co.nz
//
// Credit where credit is due: Inspiration from JonDesign's SmoothGallery (http://www.jondesign.net/)
// and of course Valerio's mootools (http://mootools.net/)
// --------------------------------------------------------------------------------------------------------------

// ---------------------------------------------------
// variables

// ---------------------------------------------------
// nav menu
function startList() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("nav");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}

function sfHover() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
//if (window.attachEvent) window.attachEvent("onload", sfHover);

// ---------------------------------------------------
// bac image
function startGallery() {
	var myGallery = new gallery($('myGallery'), {
	timed: true,
	showArrows: false,
	showCarousel: false,
	embedLinks: false,
	showInfopane: false
});
}

// dropdown menu
function formHandler(form){
	var URL = document.form.nav.options[document.form.nav.selectedIndex].value;
	if (URL) { window.location.href = URL; }
}

// ---------------------------------------------------
// init
function run() {
	//Window.disableImageCache(); // Trying to disable the imageCache to fix IE6 issues
	
	emailCloak();
	startList();
	//sfHover();
	
	startGallery();
	domRollover();
	//new Png();
}

Window.onDomReady(run);

// --------------------------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------
