
	
var numSteps = 30;
var speed = 10;

if(navigator.appVersion.indexOf("MSIE 8") >-1 )
{
	numSteps = 15;
	speed = 5;
}

var timerArray = new Array();
timerArray[0] = { val:-1 };
timerArray[1] = { val:-1 };
timerArray[2] = { val:-1 };
timerArray[3] = { val:-1 };
timerArray[4] = { val:-1 };
timerArray[5] = { val:-1 };
timerArray[6] = { val:-1 };
timerArray[7] = { val:-1 };

 
 
fadeOut = function(id, totalSteps, steps, timerIdx) {
 
	if (steps < 1)
		return true; 
 
	if (id === undefined) { 
		return false; 
		
	} else {
 
		if (steps === undefined)
			steps = 10;
		else 
			steps--;
 
		var ieOpacity = steps / totalSteps * 100;
		var Opacity = steps / totalSteps;
 
		document.getElementById(id).setAttribute('style', 'filter:alpha(opacity=' + ieOpacity + ');-moz-opacity:' + Opacity + ';-khtml-opacity:' + Opacity + ';-webkit-opacity:' + Opacity + '; opacity:' + Opacity + ';');
 
		clearTimeout(timerArray[timerIdx].val);
		timerArray[timerIdx].val = window.setTimeout('fadeOut("' + id + '", ' + totalSteps + ', ' + steps + ',' + timerIdx + ')', speed); 
	} 
}

fadeIn = function(id, totalSteps, steps, timerIdx) {
 
	if (steps < 1)
		return true; 
 
	if (id === undefined) { 
		return false; 
		
	} else {
 
		if (steps === undefined)
			steps = 10;
		else 
			steps--;
 
		var ieOpacity = 100 - (steps / totalSteps) * 100;
		var Opacity = 1 - steps / totalSteps;
 
		document.getElementById(id).setAttribute('style', 'filter:alpha(opacity=' + ieOpacity + ');-moz-opacity:' + Opacity + ';-khtml-opacity:' + Opacity + ';-webkit-opacity:' + Opacity + '; opacity:' + Opacity + ';');
 
		clearTimeout(timerArray[timerIdx].val);
		timerArray[timerIdx].val = window.setTimeout('fadeIn("' + id + '", ' + totalSteps + ', ' + steps + ',' + timerIdx + ')', speed); 
	} 
}

///////////////////////////////////////////////


changeMenuBackground = function(itemId) {

	document.getElementById(itemId).setAttribute('style', 'background-image: url(img/menu1_sel.png);');
}

























