var isvisible = function(x){
	return (x.style.display != 'none');
}

var Effects = new NameSpace({
	show : function(x){
		x.style.display = '';
	},
	
	hide : function(x){
		x.style.display = 'none';
	},
	
	setdepth : function(x, i){
		x.style.zIndex = i;
	},
	
	setopacity : function(x, v){
		if (_typeof(x.style.opacity) != 'undefined'){
			x.style.opacity = v / 100;
		} else if (_typeof(x.style.MozOpacity) != 'undefined'){
			x.style.MozOpacity = v / 100;
		} else {
			x.style.filter = 'alpha(opacity=' + v + ')';
		}
	},
	
	fadein : function(x, t, c){
		var v = 100;
		if (!t){ t = 1000; }
		var f = function(){
			Effects.setopacity(x, v);
			v -= 10;
			if (v < 0){
				clearInterval(i);
				if (c){ c(); }
			}
		}
		var i = setInterval(f, Math.ceil(t / 10));
	},
	
	fadeout : function(x, t, c){
		var v = 0;		
		if (!t){ t = 1000; }		
		var f = function(){
			Effects.setopacity(x, v);
			v += 10;
			if (v > 100){
				clearInterval(i);
				if (c){ c(); }
			}
		}
		var i = setInterval(f, Math.ceil(t / 10));
	}
});
