var InHide = 0, InHideLast, new_id,opacity = 0.90,opacity_last;
var speed = 0.01, notclosed = 0;

// Array for futher use!
var last_id

var bname = navigator.appName;
if (bname == "Microsoft Internet Explorer")	speed=0.10
else speed = 0.03;

function changein(id, idHead) {
		if  (last_id != id && notclosed){
		Hidedelay(last_id)
		
		}
		notclosed = 0
		if (!notclosed){
		last_id = id
		document.getElementById(idHead).style.backgroundColor = "orange"
		document.getElementById(id).style.visibility = "visible"
		document.getElementById(id).style.MozOpacity=0.90
		document.getElementById(id).style.filter =  'alpha(opacity=' + 90 + ')'
		document.getElementById(id).style.height = "auto"
		document.getElementById(id).style.zIndex = "10000"
		}
		clearInterval(InHide)
}
	
function Hidedelay(id){
	if (document.getElementById) document.getElementById(id).style.visibility = "hidden";
	notclosed = 0;
	
}

function fadeout(id){
	opacity -= speed;
	document.getElementById(id).style.MozOpacity=opacity
	document.getElementById(id).style.filter =  'alpha(opacity=' + opacity*100 + ')';
	if (opacity <= 0.02)Hidedelay(id);
}

function changeout(id, idHead) {
	opacity = 0.99
	last_id = id;
	notclosed = 1
	document.getElementById(idHead).style.backgroundColor = "#bcbcbc"
	document.getElementById(id).style.zIndex = "9999";
	InHide = setInterval("fadeout('"+id+"');",10);
}

