/**** Made by Frank Hoffmann, www.frank.st ****/
function Browser(){
	this.IE=false;
	this.IE4=false;
	this.Nav=false;
	this.Moz=false;
	this.Mac=false;
	this.Version=0;
	if(navigator.appName == "Netscape"){
		if(parseInt(navigator.appVersion)>= 5) this.Moz=true;
		else if(parseInt(navigator.appVersion.charAt(0))==4&&parseInt(navigator.appVersion.charAt(2))>=5) this.Nav=true;
	}
	else if(navigator.appVersion.indexOf('Mozilla')!=-1) this.Moz=true;
	else if(parseInt(navigator.appVersion.charAt(navigator.appVersion.indexOf('MSIE')+ 5))>=4) this.IE=true;
	this.Mac=(navigator.appVersion.lastIndexOf('Win')==-1);
	if(parseInt(navigator.appVersion.charAt(navigator.appVersion.indexOf('MSIE')+ 5))==4) this.IE4=true;
}
is=new Browser();

function pLayer(id, left, top, width, height, nestedID, nestedID2, zIndex, visibility){
	this.id=id;
	this.x=left;
	this.y=top;
	this.w=width;
	this.h=height;
	this.nested=nestedID;
	this.nested2=nestedID2;
	this.nID = (nestedID) ? "document.layers." + nestedID + "." : "";
	this.nID2 = (nestedID2) ? "document.layers." + nestedID2 + "." : "";
	this.vis=visibility;
	this.zIndex=zIndex;
	this.HTML="";
	this.cont="";
	this.style="";
	this.cTag = (is.Nav) ? "</layer>" : "</div>";
	this.clipped=false;
	this.cursor=false;
	this.BGC=false;
	this.BGI=false;
	this.evtStr="";
	this.ref2 = (is.Nav) ? this.nID + this.nID2 + "document.layers." + this.id : (is.IE) ? "document.all." + this.id : "document.getElementById('" + this.id +"')";
	
	this.setClip=setClipMethod;
	this.setBGI=setBGIMethod;
	this.setCont=setContMethod;
	this.setStyle=setStyleMethod;
	this.fixLayer=fixLayerMethod;
	this.place=placeMethod;
	this.move=moveMethod;
	this.writeHTML=writeHTMLMethod;
	this.clip=clipMethod;
	this.clipBy=clipByMethod;
	this.opacity=opacityMethod;
	this.setVis=setVisibilityMethod;
}

function setClipMethod(top, right, bottom, left){
	this.clipped=true;
	this.cT=top;
	this.cR=right;
	this.cB=bottom;
	this.cL=left;
}
function setBGIMethod(background){
	this.BGI=background;
}
function setContMethod(str){
	this.cont=str;
	this.fixLayer();
}
function setVisibilityMethod(visible){
	this.vis=visible;
	if(visible == 2)eval(this.ref).visibility = "inherit";
	else if(visible== 1)eval(this.ref).visibility = "visible";
	else eval(this.ref).visibility = "hidden";
}
function setStyleMethod(){
	var visTemp = "hidden";
	if(this.vis == 1)visTemp = "visibile";
	else if(this.vis == 2)visTemp = "inherit";
	if(is.Nav){
		this.style = "<layer id='" + this.id + "' name='" + this.id + "' left='" + this.x + "' top='" + this.y + "' width='" + this.w + "' height='" + this.h + "' z-index='" + this.zIndex + "' visibility='" + visTemp + "'";
		this.style += (this.clipped) ? " clip='" + this.cL + "," + this.cT + "," + this.cR + "," + this.cB + "'" : "";
		this.style += (this.BGC) ? " bgcolor='" + this.BGC + "'" : "";
		this.style += (this.BGI) ? " background='" + this.BGI + "'" : "";
		this.style += ">";
	}
	else{
		this.style = "<div id='" + this.id + "' style='position:absolute;left:" + this.x + ";top:" + this.y + ";width:" + this.w + ";height:" + this.h + ";z-index:" + this.zIndex + ";visibility:" + visTemp;
		this.style += (this.clipped) ? ";clip:rect(" + this.cT + " " + this.cR + " " + this.cB + " " + this.cL + ")" : "";
		this.style += (this.BGC) ? ";background-color:" + this.BGC : "";
		this.style += (this.BGI) ? ";background-image:url(" + this.BGI + ")" : "";
		this.style += (this.cursor) ? ";cursor:" + this.cursor : "";
		this.style += "'>";
	}
	this.ref = (is.Nav) ? this.nID + this.nID2 + "document.layers." + this.id : (is.IE) ? "document.all." + this.id + ".style" : "document.getElementById('" + this.id +"').style";
}
function fixLayerMethod(){
	this.setStyle();
	this.HTML=this.style+this.cont+this.cTag;
}
function placeMethod(x, y){
	this.x=x;
	this.y=y;
	if(is.Nav)eval(this.ref).moveTo(x, y);
	else{
		eval(this.ref).left=x;
		eval(this.ref).top=y;
	}
}
function moveMethod(dX, dY){
	this.place(this.x+dX, this.y+dY);
}
function writeHTMLMethod(str){
	this.cont=str;
	if(is.Nav){
		eval(this.ref).document.open();
		eval(this.ref).document.write(str);
		eval(this.ref).document.close();
	}
	else eval(this.ref2).innerHTML=str;
}
function clipMethod(top, right, bottom, left){
	this.clipped=true;
	this.cT=top;
	this.cR=right;
	this.cB=bottom;
	this.cL=left;
	if(is.Nav){
		temp=eval(this.ref);
		temp.clip.bottom=bottom;
		temp.clip.right=right;
		temp.clip.left=left;
		temp.clip.top=top;
	}
	else eval(this.ref).clip = "rect(" + top + " " + right + " " + bottom + " " + left + ")";
}
function clipByMethod(dT, dR, dB, dL){
	this.clip(this.cT+dT, this.cR+dR, this.cB+dB, this.cL+dL);
}
function opacityMethod(opacity){
	if(is.IE){
		this.opac=opacity;
		eval(this.ref).filter = "alpha(opacity=" + opacity + ", style=0)";
	}
}