Glry.Display = {
	Item:Object(),
	Position:Boolean(false),
	Show:function(Item,Position){
		Glry.Display.Item = Item;
		Glry.Display.Item.style.display = "block";
		if(Position !== undefined){
			Params = Glry.Util.Position(Position);
			Glry.Display.Item.style.position = "absolute";
			Correction = Glry.Util.Position(Glry.Display.Item);
			FixPosition = (Params.x+Params.width)-Correction.width;
			if(FixPosition < 0){
				FixPosition = Params.x;
			}
			Glry.Display.Item.style.left = FixPosition+"px";
			Glry.Display.Item.style.top = Params.y+Params.height+"px";
		}
	},
	Hide:function(Item){
		Glry.Display.Item = Item;
		Glry.Display.Item.style.display = "none";
	},
	Swap:function(Item,Position){
		Glry.Display.Item = Item;
		if(Glry.Display.Item.style.display == "block"){
			Glry.Display.Item.style.display = "none";
		}else{
			Glry.Display.Item.style.display = "block";
		}
		if(Position !== undefined){
			Params = Glry.Util.Position(Position);
			Glry.Display.Item.style.position = "absolute";
			Correction = Glry.Util.Position(Glry.Display.Item);
			Glry.Display.Item.style.left = (Params.x+Params.width)-Correction.width+"px";
			Glry.Display.Item.style.top = Params.y+Params.height+"px";
		}
	},
	Fade:function(Item){
		Glry.Display.Item = Item;
		Glry.Display.Item.Direction = "FadeId";
		if(Glry.Display.Item == null || Glry.Display.Item == undefined){
			return;
		}
		if(Glry.Display.Item.filters == undefined){
			//Glry.Display.Item.Cooef = 100;
			Glry.Display.Item.Opacity = Glry.Display.Item.style.opacity;
		}else{
			Glry.Display.Show(Glry.Display.Item);
			return;
			//Glry.Display.Item.Opacity = Glry.Display.Item.filters.alpha.opacity;
		}
		
		if(Glry.Display.Item.getAttribute("style") == null){
			Glry.Display.Item.Opacity = 1;
		}
		//alert(Glry.Display.Item.Opacity)
		//<br class="clear" />
		if(Glry.Display.Item.Opacity < 0.2){
 			Glry.Display.Item.Opacity = 0;
			Glry.Display.Item.style.display = "block";
			Glry.Display.Item.Direction = "FadeIn";
		}else{
			Glry.Display.Item.Direction = "FadeOut";
		}
		Glry.Util.CreateInterval(Glry.Display.Animate,30);
	},
	Animate:function(){
		var TMP = parseFloat(Glry.Display.Item.Opacity);
		if(Glry.Display.Item.Direction == "FadeOut"){
			Glry.Display.Item.Opacity = parseFloat(TMP-0.2);
			if(Glry.Display.Item.Opacity < 0.2){
				Glry.Display.Item.Opacity = 0;
				Glry.Display.Item.Opacity = "none";
				clearInterval(Glry.Util.Param.IntervalId);
			}
		}else{
			Glry.Display.Item.Opacity = parseFloat(TMP+0.2)
			if(Glry.Display.Item.Opacity >= 0.8){
				Glry.Display.Item.Opacity = 1;
				clearInterval(Glry.Util.Param.IntervalId);
			}
		}
	}
}


