// object handling
create_obj = function() {
};

create_obj.prototype.loadhandler = function() {
	if (this.onload) {
		this.onload();
	}
}

function create_layer() {
	a = arguments;
	this.create_obj = create_obj;
	this.create_obj();
	this.obj = a[0];
	if (a[1]) {
		this.subobj = a[1];
		switch(check.b) {
    		case "ie":
				this.css = document.all(this.subobj).style;
				this.css2 = document.all(this.subobj);
			break;
			case "ns":
				this.css = document.layers[this.obj].document.layers[this.subobj];
				this.css2 = document.layers[this.obj].document.layers[this.subobj];
			break;
			case "dom":
				this.css = document.getElementById(this.subobj).style;
				this.css2 = document.getElementById(this.subobj);
			break;
			case "opera":
				this.css = document.getElementById(this.subobj).style;
				this.css2 = document.getElementById(this.subobj).style;
			break;
		}
	}
	else {
		switch(check.b) {
    		case "ie":
				this.css = document.all(this.obj).style;
				this.css2 = document.all(this.obj);
			break;
			case "ns":
				this.css = document.layers[this.obj];
				this.css2 = document.layers[this.obj];
			break;
			case "dom":
				this.css = document.getElementById(this.obj).style;
				this.css2 = document.getElementById(this.obj);
			break;
			case "opera":
				this.css = document.getElementById(this.obj).style;
				this.css2 = document.getElementById(this.obj).style;
			break;
		}
	}
	switch(check.b) {
    		case "ie":
				this.css_hide = "hidden";
				this.css_show = "visible";
				this.css_clip = "rect";
				this.css_px = "";
				this.css_top = "pixelTop";
				this.css_left = "pixelLeft";
				this.css_offsetheight = "offsetHeight";
				this.css_offsetwidth = "offsetWidth";
				this.css_height = "height";
				this.css_width = "width";
			break;
			case "ns":
				this.css_hide = "hide";
				this.css_show = "show";
				this.css_clip = "rest";
				this.css_px = "";
				this.css_top = "top";
				this.css_left = "left";
				this.css_offsetheight = "clip.bottom";
				this.css_offsetwidth = "clip.right";
				this.css_height = "height";
				this.css_width = "width";
			break;
			case "dom":
				this.css_hide = "hidden";
				this.css_show = "visible";
				this.css_clip = "rect";
				this.css_px = "px";
				this.css_top = "top";
				this.css_left = "left";
				this.css_offsetheight = "offsetHeight";
				this.css_offsetwidth = "offsetWidth";
				this.css_height = "height";
				this.css_width = "width";
			break;
			case "opera":
				this.css_hide = "hidden";
				this.css_show = "visible";
				this.css_clip = "no support";
				this.css_px = "";
				this.css_top = "pixelTop";
				this.css_left = "pixelLeft";
				this.css_offsetheight = "pixelHeight";
				this.css_offsetwidth = "pixelWidth";
				this.css_height = "height";
				this.css_width = "width";
			break;
		}
};

create_layer.prototype.hide = function() {
	this.css.visibility = this.css_hide;
};

create_layer.prototype.show = function() {
	this.css.visibility = this.css_show;
};

create_layer.prototype.zindex = function() {
	a = arguments;
	this.css.zIndex = a[0];
};

create_layer.prototype.clip = function() {
	a = arguments;
	switch(this.css_clip) {
		case "rect":this.css.clip = "rect("+a[0]+","+a[1]+","+a[2]+","+a[3]+")";break;
		case "rest":this.css.clip.top = a[0];this.css.clip.right = a[1];this.css.clip.bottom = a[2];this.css.clip.left = a[3]; break;
	}
};

create_layer.prototype.move = function() {
	a = arguments;
	switch(a[0]) {
		case "t":
			this.css.top = a[1];
		break;
		case "l":
			this.css.left = a[1];
		break;
	}
};

create_layer.prototype.move_relative = function() {
	a = arguments;
	switch(a[0]) {
		case "u": this.css.top = parseInt(this.css.top) - a[1] + this.css_px;break;
		case "d": this.css.top = parseInt(this.css.top) + a[1] + this.css_px;break;
		case "l": this.css.left = parseInt(this.css.left) - a[1] + this.css_px;break;
		case "r": this.css.left = parseInt(this.css.left) + a[1] + this.css_px;break;
	}
};

create_layer.prototype.get_top = function() {
	return eval("this.css."+this.css_top);
};

create_layer.prototype.get_left = function() {
	return eval("this.css."+this.css_left);
};

create_layer.prototype.get_zindex = function() {
	return this.css.zIndex;
};

create_layer.prototype.get_visibility = function() {
	return this.css.visibility;
};

create_layer.prototype.get_offsetheight = function() {
	return eval("this.css2."+this.css_offsetheight);
};

create_layer.prototype.get_offsetwidth = function() {
	return eval("this.css2."+this.css_offsetwidth);
};

create_layer.prototype.get_height = function() {
	return eval("this.css."+this.css_height);
};

create_layer.prototype.get_width = function() {
	return eval("this.css."+this.css_width);
};
