function checkBrowser(){

	this.win=(navigator.platform=="Win32")?1:0;
	this.mac=(navigator.platform=="MacPPC")?1:0;
	this.ns4 = (document.layers) ? true : false;
	this.ie4 = (document.all && !document.getElementById) ? true : false;
	this.ieDOM = (document.all && document.getElementById) ? true : false;
	this.ns6 = (navigator.product=='Gecko' && !window.GeckoActiveXObject) ? true : false;//Netscape 6 up - not 7.1
	this.ns7_1 = (window.GeckoActiveXObject) ? true : false;//Netscape 7.1 only
	return this
}

function objWrapper(id) {
	/* object pointer */ 
	try {
		/*
		 * Try and get reference to object by it's name first.
		 */
		this.obj=document.getElementsByName(id)[0];

		/* style reference */
		this.css = document.getElementsByName(id)[0].style;
	}
	catch (e) {
		/*
		 * If object name reference failed then attempt an id lookup.
		 */
		this.obj=document.getElementById(id);

		/* style reference */
		this.css = document.getElementById(id).style;
	}
	
	if (typeof(window['bw']) != "undefined" )
	{
		if (bw.ieDOM) {this.x=this.css.pixelLeft; this.y=this.css.pixelTop; this.h=this.obj.scrollHeight; this.w=this.obj.scrollWidth}
		if (bw.ns6 || bw.ns7) {this.x=this.css.left; this.y=this.css.top; this.w=this.css.width; this.h=this.css.height;}
		/* mac variant */
		if (bw.mac && (bw.ie4 || bw.ieDOM)) {this.h=this.obj.clientHeight; this.w=this.obj.clientWidth}
	}

	return this;
}

function obj_moveTo(x,y){
	this.x=x
	this.y=y
	this.css.left=this.x+"px";
	this.css.top=this.y+"px";
}

function obj_moveBy(x,y){
	this.x+=x
	this.y+=y
	this.css.left=this.x+"px";
	this.css.top=this.y+"px";
}

function obj_setSize(w,h) {
	this.css.width=w;
	this.css.height=h;
	this.w=w;
	this.h=h;
}

function obj_hide(){
	this.css.display='none';
}

function obj_show(){
	this.css.display='block';
}

function obj_setZIndex(z){
	this.css.zIndex = z
}

function obj_changeBackColor(c) {
	this.css.backgroundColor = c;
	this.css.bgColor = c;
}

function obj_clipTo(t,r,b,l){
	if(!bw.ieDOM){
		this.css.clip.top = t
		this.css.clip.right = r
		this.css.clip.bottom = b
		this.css.clip.left = l
	} else {
		this.css.clip="rect("+t+","+r+","+b+","+l+")"
	}
}

function obj_writeIt(t) {
	this.obj.innerHTML=t;
}



objWrapper.prototype.moveTo=obj_moveTo
objWrapper.prototype.moveBy=obj_moveBy
objWrapper.prototype.hide=obj_hide
objWrapper.prototype.show=obj_show
objWrapper.prototype.setSize=obj_setSize
objWrapper.prototype.setZIndex=obj_setZIndex
objWrapper.prototype.changeBack=obj_changeBackColor
objWrapper.prototype.clipTo=obj_clipTo
objWrapper.prototype.writeIt=obj_writeIt

