//smooth view & hide
//coded by hanulis
var smooth_stats="";
var aValue=100;

function smoothView(obj) {

	var obj=document.getElementById(obj);

	if(smooth_stats!="") smooth_stats="";

	this.hide=function(aValue) {
		if(smooth_stats!="s") {
			smooth_stats="h";
			aValue=aValue-(aValue/1.5);
			if(aValue>1) {
				obj.style.filter="alpha(opacity="+aValue+")";
				setTimeout("this.hide("+aValue+")",10);
			} else {
				obj.style.filter="alpha(opacity=0)";
				obj.style.display="none";
				smooth_stats="";
				aValue=0;
			}
		} else {
			setTimeout("this.hide("+aValue+")",10);
		}
	}

	this.show=function(aValue) {
		if(smooth_stats!="h") {
			smooth_stats="s";
			aValue=aValue+((100-aValue)/4);
			if(aValue<99) {
				obj.style.filter="alpha(opacity="+aValue+")";
				setTimeout("this.show("+aValue+")",10);
			} else {
				obj.style.filter="alpha(opacity=100)";
				smooth_stats="";
				aValue=100;
			}

		} else {
			setTimeout("this.show("+aValue+")",10);
		}

	}

	if(obj.style.display!="none") {
		this.hide(100);
	} else {
		obj.style.display="";

		this.show(0);
	}

}
