//////////////////////////////////////////////////////////////////////////
function browserobj() {
	this.ns4=document.layers&&!document.getElementById;
	this.ns6=document.getElementById&&!document.all;
	this.ie4=document.all;
	this.opr=navigator.userAgent.indexOf("Opera")+1;
	
	this.ms = document.all;
	this.ns = document.layers;
	this.dom = document.getElementById;
}
browserobj.prototype.innerWidth = function () {
	if(this.ns || this.opr) return window.innerWidth;
	else return document.body.offsetWidth;
}

var browser = new browserobj();

//////////////////////////////////////////////////////////////////////////
 function setImage(bild,hide) {
		myPic=new divobj(bild,0,0);
		if(hide=="false") {
			myPic.hide();
		}	
		else myPic.show();
}


function divobj(id,width,height) {
	this.id = id;
	this.width = width;
	this.height = height;
	this.xpos = 0;
	this.ypos = 0;
}

divobj.prototype.getobject = function () {
	if(browser.dom) {
		if(typeof document.getElementById(this.id) == "object")	return document.getElementById(this.id);
		else return void(0);
	} else if(browser.ms) {
		if (typeof document.all[p2] == "object") return document.all[this.id];
		else return void(0);
	} else if(browser.ns) {
		if (typeof document[p2] == "object") return document[this.id];
		else return void(0);
	} else return void(0);
}

divobj.prototype.setstyle = function (name,value) {
	if(this.getobject()) {
		//if(browser.dom || browser.ms) this.getobject().style.setAttribute(name,value);
		if(browser.dom || browser.ms) this.getobject().style[name] = value;
		else if(browser.ns) this.getobject()[name] = value;
	}
}
divobj.prototype.getstyle = function (name) {
	if(this.getobject()) {
//		if(browser.dom || browser.ms) return this.getobject().style.getAttribute(name);
		if(browser.dom || browser.ms) return this.getobject().style[name];
		else if(browser.ns) return this.getobject()[name];
	}
}
divobj.prototype.show = function () {
	if(browser.ns && !browser.dom) this.setstyle("visibility","show");
	else this.setstyle("visibility","visible");
}
divobj.prototype.hide = function () {
	if(browser.ns && !browser.dom) this.setstyle("visibility","hide");
	else this.setstyle("visibility","hidden");
}
divobj.prototype.moveto = function (x,y) {
	this.setstyle("left",x+"px");
	this.setstyle("top",y+"px");
}
divobj.prototype.moveby = function (x,y) {
	this.setstyle("left",this.posx()+x+"px");
	this.setstyle("top",this.posy()+y+"px");
}
divobj.prototype.posx = function () { return parseInt(this.getstyle("left")) }
divobj.prototype.posy = function () { return parseInt(this.getstyle("top")) }
