//Change opacity script
var timerID = null; 
var timerOn = false; 
var timecount = 250;


function shownav(id, opacStart, opacEnd) {
	//speed for each frame
	var millisec = 500;
	var speed = Math.round(millisec/100);
	var timer = 0;

	//determine the direction for the blending, if start and end are the same nothing happens
	if(opacStart > opacEnd) {
		var timer = 0; clearTimeout(timerID);
		for(i = opacStart; i >= opacEnd; i--) {
			timerID=setTimeout("changeOpacity("+i+ ",'"+id+"')",(timer*speed));
			timer++;
			if(i == 0) {
				timerID=setTimeout("document.getElementById('"+id+"').style.visibility = 'hidden'",(timer*speed));
			}
		}
	} else if(opacStart < opacEnd) {
		var timer = 0; clearTimeout(timerID);
		document.getElementById(id).style.visibility = 'visible';
		for(i = opacStart; i <= opacEnd; i++)
			{
			timerID=setTimeout("changeOpacity("+i+",'"+id+"')",(timer*speed));
			timer++;
		}
	}
}

function changeOpacity(opacity,id) {
	var object = document.getElementById(id).style; 
	object.opacity = (opacity/100);
	object.MozOpacity = (opacity/100);
	object.KhtmlOpacity = (opacity/100);
	object.filter = "alpha(opacity="+opacity+")";
}

function startTime(id) { 
	if (timerOn == false) { 
		timerID=setTimeout("shownav('"+id+"',80,0)" , timecount); 
		timerOn = true; 
	} 
} 

function stopTime() { 
	if (timerOn) { 
		clearTimeout(timerID); 
		timerID = null; 
		timerOn = false; 
	} 
} 