var ie = document.all?1:0;
var ns = document.layers?1:0;
var gecko = document.getElementById?1:0;
function closeIt(){
window.close()
}
//class                                  
function swing(name){
//propeties(variabler)
	if(ie){eval('this.layer='+name+'.style');
		   eval('this.cool=document.all.'+name)
		   eval('this.id=document.all.'+name+'.id');
		   visible="visible";hidden="hidden";
		   }
	if(ns){eval('this.layer=document.layers.'+name);
		   eval('this.cool=document.'+name)
		   eval('this.id=document.layers.'+name+'.id');
	       visible="show";hidden="hide";
		   }

	if(gecko){	
			eval('this.layer=document.getElementById("'+name+'").style');
			eval('this.cool=document.getElementById("'+name+'")');
			eval('this.id=document.getElementById("'+name+'").id');
			visible="visible";hidden="hidden";
			}

	this.x = parseInt(this.layer.left)
	this.y = parseInt(this.layer.top)
//Methods
	this.show=show;
	this.hide=hide;
	this.moveTo=moveTo;
	this.scrollR=scrollR;
	this.scrollL=scrollL;
	this.clipWith=clipWith;	
	this.place=place;
	this.writeToDiv=writeToDiv;
}

//class
function clipwindow(x, y, width, height) {
	this.x = x
	this.y = y
	this.width = width
	this.height = height
	this.cliptype = "rectangle"
}

function show(){this.layer.visibility=visible}
function hide(){this.layer.visibility=hidden}
function moveTo(x,y){this.layer.left=x;this.x=x;this.layer.top=x;this.layer.top=y;this.y=y;}
function scrollR(name,speed){var left=parseInt(this.layer.left)+1;this.layer.left=left;}
function scrollL(name,speed){var left=parseInt(this.layer.left)-1;this.layer.left=left;}
function place(top,left,width,height){this.layer.width=width;this.layer.height=height;this.layer.top=this.y=top;this.layer.left=this.x=left;}
function writeToDiv() {



}


function clipWith(obj){
	var right, top, bottom, left, str
	this.clipwidthobj = obj
	if (obj.cliptype == "rectangle") {
		left = obj.x - this.x
		right = obj.x + obj.width - this.x
		top = obj.y - this.y
		bottom = obj.y+obj.height - this.y
		if(ns) {
			eval("document." + this.id + ".clip.right=" + right)
			eval("document." + this.id + ".clip.left=" + left)
			eval("document." + this.id + ".clip.top=" + top)
			eval("document." + this.id + ".clip.bottom=" + bottom)
		}			
		if (ie) {
			str = "rect(" + top + "," + right + "," + bottom + "," + left + ")"
			eval(this.id + ".style.clip=\"" + str + "\"")
		} 
		if (gecko) {
			str = "rect(" + top + "px " + right + "px " + bottom + "px " + left + "px)"
			this.layer.clip=str
		} 
	}
}

function height(divname) {
	
	if(ns) {
		this.ref = document.layers[divname].document
		layer_height = this.ref.height
		return(layer_height)
	}			
	if (ie) {
		return(document.all[divname].offsetHeight)
	} 
	if (gecko) {		
		return(document.getElementById(divname).offsetHeight)		
	} 
	
}