function fade_in(el,o,st) {
	if(typeof el!='object') el=document.getElementById(el);
	if(!el) return;
	if(typeof o=='undefined') o=el.style.opacity;
	if(typeof st=='undefined') st=.05;
	if(o<1) {
		o+=st;
		set_opac(el,o);
		setTimeout(function() { fade_in(el,o,st); },50);
	} else set_opac(el,1);
}

function fade_out(el,o,st) {
	if(typeof el!='object') el=document.getElementById(el);
	if(!el) return;
	if(typeof o=='undefined') o=el.style.opacity;
	if(typeof st=='undefined') st=.05;
	if(o>0) {
		o-=st;
		set_opac(el,o);
		setTimeout(function() { fade_out(el,o,st); },50);
	} else set_opac(el,0);
}

function set_opac(el,o) {
	el.style.opacity = o;
	el.style.MozOpacity = o;
	el.style.filter = 'alpha(opacity=' + (o*100) + ')';	
}
