var temp = null;
var tempColor = null;

function changeColors(el, i, newColor){
	if(el.className == null || el.className != "_selected"){
		if(tempColor == null) getTempColor();
		document.getElementById("spacer").style.backgroundColor = newColor;
		document.getElementById("topmenu_item" + i).style.backgroundColor = newColor;
		temp = i;
	}
}

function restoreColors(){
	if(temp != null){	
		document.getElementById("spacer").style.backgroundColor = tempColor;
		document.getElementById("topmenu_item" + temp).style.backgroundColor = "#000000";
	};
}

function getTempColor(){
	for(var i=0; i<=4; i++) if(document.getElementById("topmenu_item" + i).className == "_selected") tempColor = getColorForElement("topmenu_item" + i); 
}

function getColorForElement(el){
	if(navigator.appVersion.indexOf("MSIE") > -1) return document.getElementById(el).currentStyle['backgroundColor'];
	return window.getComputedStyle(document.getElementById(el),null).backgroundColor;
}
