function bgFade_start(item) {
	if(item.timeout) { clearTimeout(item.timeout); item.timeout=null; }
	item.style.backgroundColor="rgb("+item.Ron+","+item.Gon+","+item.Bon+")";
}

function bgFade_fct(id,pos) {
	if(document.getElementById(id)) {
		var item=document.getElementById(id);
		if(pos>0) {
			item.style.backgroundColor="rgb("+parseInt((item.Ron*pos+item.Roff*(256-pos))/256)+","+parseInt((item.Gon*pos+item.Goff*(256-pos))/256)+","+parseInt((item.Bon*pos+item.Boff*(256-pos))/256)+")";
			item.timeout=setTimeout("if(bgFade_fct) bgFade_fct('"+id+"',"+(pos-7)+")",10);
		} else {
			item.style.backgroundColor="rgb("+item.Roff+","+item.Goff+","+item.Boff+")";
		}
	}
}

function bgfade_init(id,on,off) {
	var item=document.getElementById(id);
	item.timeout=null;
	item.Ron=parseInt(on.substring(0,2),16); item.Gon=parseInt(on.substring(2,4),16); item.Bon=parseInt(on.substring(4,6),16);
	item.Roff=parseInt(off.substring(0,2),16); item.Goff=parseInt(off.substring(2,4),16); item.Boff=parseInt(off.substring(4,6),16);
	item.style.backgroundColor="rgb("+item.Roff+","+item.Goff+","+item.Boff+")";

	item.onmouseover=function() { bgFade_start(item); }
	item.onmouseout= function() { bgFade_fct(id,256); }
}


