/**
 * @author ssen (i@ssen.name)
 * @version 0.1 (071215)
 */
var HTMLayerMember = {
	initialize: function(bodyContainer) {
		this.list = new Array();
		this.count = 2;
		this.body = bodyContainer; 
	},
	create: function(name, x, y, width, height) {
		this.count++;
		var divconfig = {
			"styles":{
				"display":"none",
				"position":"absolute",
				"z-index":this.count,
				"top":y+"px",
				"left":x+"px",
				"width":width+"px",
				"height":height+"px",
				"word-break":"break-all",
				"word-wrap":"break-word"
			}
		}
		this.list[name] = new Element("div",divconfig);
		this.list[name].injectTop(this.body);
		this.list[name].id = name;
	},
	visible: function(name, bool) {
		switch (bool) {
			case "on" : this.list[name].setStyle("display","block"); break;
			case "off" : this.list[name].setStyle("display","none"); break;
		}
	},
	transform: function(name, x, y, width, height) {
		this.list[name].setStyles({
			"top":y+"px",
			"left":x+"px",
			"width":width+"px",
			"height":height+"px"
		});
	},
	innerHTML: function(name) {
		return this.list[name].innerHTML;
	},
	injectTop: function(name) {
		this.count++;
		this.list[name].injectTop(this.body);
		this.list[name].setStyle("z-index",this.count);
	},
	setContent: function(name, content) {
		this.list[name].innerHTML = content;
	},
	setIFrame: function(name, url, scroll) {
		this.list[name].innerHTML = '<iframe src="'+url+'" frameborder="0" width="100%" height="100%" scrolling="'+scroll+'"></iframe>';
	},
	addCssClass: function(name, css) {
		this.list[name].addClass(css);
	},
	removeCssClass: function(name, css) {
		this.list[name].removeClass(css);
	},
	bgColor: function(name, color) {
		this.list[name].setStyle("background-image","");
		this.list[name].setStyle("background-color",color);
	},
	bgPattern: function(name, img) {
		this.list[name].setStyle("background-color","");
		this.list[name].setStyle("background-image","url("+img+")");
	},
	bgTransparent: function(name) {
		this.list[name].setStyle("background-image","");
		this.list[name].setStyle("background-color","");
	},
	scrollMode: function(name, type) {
		var type2;
		switch (type) {
			case "yes" : type2 = "scroll"; break;
			case "no" : type2 = "hidden"; break;
			case "auto" : type = "auto"; break;
		}
		this.list[name].setStyle("overflow",type2);
	}
}



