var currentImg=1;
	
var effectInProgress=false;


window.onload=function()
{
	if (document.all && document.getElementById)
	{
		navRoot = document.getElementById("nav");
		
		for (var 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 changeImg(img)
{
	if (!effectInProgress)
	{
		if (img!=currentImg)
		new Effect.Parallel([
			new Effect.Fade('img'+currentImg, { from: 1, to: 0, sync: true}),
			new Effect.Appear('img'+img, { from: 0, to: 1, sync: true})
		], {duration: 0.5, fps: 50, queue: 'end', beforeStart: function(){effectInProgress=true;}, afterFinish: function(){effectInProgress=false; currentImg=img}});
	}	

}
