

// each browser gets its own object, with the same interfaces but differing implementations



// create IE DHTML object

function ie_object(obj) {

	this.obj = obj.style;

	this.name = obj.id;

	this.objHide = objHide_dom;

	this.objShow = objShow_dom;

	this.objGetLeft = objGetLeft_ie;

	this.objGetTop = objGetTop_ie;

	this.objSetTop = objSetTop_ie;

	this.objSetLeft = objSetLeft_ie;

	this.objBackgrndColor= objBackgrndColor_dom

	this.objSetWidth =objSetWidth_ie

	this.objSetHeight= objSetHeight_ie

	this.objGetWidth= objGetWidth_ie

	this.objGetHeight= objGetHeight_ie

	this.objSetColor=objSetColor_dom

	this.objGetColor=objGetColor_dom

	this.objGetVisible=objGetVisible_dom

	this.objSetZ=objSetZ_dom

	this.objGetZ=objGetZ_dom

	this.objMoveHorz=objHorz_ie

	this.objMoveVert=objVert_ie
	
	this.objSetClip=objSetClip_ie
}





function objType_ie() {

	return this.obj.type

	}

 



function objGetHeight_ie() {

	return this.obj.height

	}



function objGetWidth_ie() {

	return this.obj.width 

	}





function objSetHeight_ie(height) {

	this.obj.height=height+"px"

	}





function objSetWidth_ie(width) {

	this.obj.width= width+"px"

	}



function objGetLeft_ie() {

	return this.obj.pixelLeft;

}



function objGetTop_ie() {

	return this.obj.pixelTop;

}



function objSetTop_ie(top) {

	this.obj.pixelTop = top;

}



function objSetLeft_ie(left) {

	this.obj.pixelLeft = left;

}



function objVert_ie(i) {

	this.obj.pixelTop+=i;
	return 	this.obj.pixelTop;

}



function objHorz_ie(i) {

	this.obj.pixelLeft+=i;

	return this.obj.pixelLeft;

}

function objSetClip_ie(a,b,c,d) {

	this.obj.clip="rect("+a+"px,"+b+"px,"+c+"px,"+d+"px)"

	}

function changestyle_ie(stylesht,rle,which,value) {

	eval("document.styleSheets[stylesht].rules[rle].style."+which+"=value")

	}



// create DOM object

function dom_object(obj) {

	this.obj = obj.style;

	this.name = obj.id

	this.objHide = objHide_dom;

	this.objShow = objShow_dom;

	this.objGetLeft = objGetLeft_dom;

	this.objGetTop = objGetTop_dom;

	this.objSetTop = objSetTop_dom;

	this.objSetLeft = objSetLeft_dom;

	this.objBackgrndColor= objBackgrndColor_dom

	this.objSetWidth = objSetWidth_dom

	this.objSetHeight= objSetHeight_dom

	this.objGetWidth= objGetWidth_dom

	this.objGetHeight= objGetHeight_dom

	this.objSetColor=objSetColor_dom

	this.objGetColor=objGetColor_dom

	this.objGetVisible=objGetVisible_dom

	this.objSetZ=objSetZ_dom

	this.objGetZ=objGetZ_dom

	this.objMoveHorz=objHorz_dom

	this.objMoveVert=objVert_dom
	
	this.objSetClip=objSetClip_dom
}

function objSetZ_dom(z) {

	this.obj.zIndex=z

	}



function objGetZ_dom() {

	return this.obj.zIndex

	}



function objGetVisible_dom() {

	return this.obj.visibility 

}  



function objGetColor_dom() {

	return this.obj.color

	}



function objGetHeight_dom() {

	return this.obj.height

	}



function objGetWidth_dom() {

	return this.obj.width 

	}



function objSetColor_dom(color) {

	this.obj.color=color

}



function objSetHeight_dom(height) {

	this.obj.height=height+"px"

	}





function objSetWidth_dom(width) {

	this.obj.width= width+"px"

	}



function objBackgrndColor_dom(color) {

	this.obj.backgroundColor=color

}



function objHide_dom() {

	this.obj.visibility = "hidden";

}





function objShow_dom() {

	this.obj.visibility = "inherit";

}





function objGetLeft_dom() {

	return parseInt(this.obj.left);

}





function objGetTop_dom() {

	return parseInt(this.obj.top)

	}



function objSetTop_dom(top) {

	this.obj.top = top+"px";

}





function objSetLeft_dom(left) {

	this.obj.left = left+"px";

}



function objVert_dom(i) {

	this.obj.top=parseInt(this.obj.top)+i+"px";

	return parseInt(this.obj.top);

}



function objHorz_dom(i) {

	this.obj.left=parseInt(this.obj.left)+i+"px";

	return parseInt(this.obj.left);

}
function objSetClip_dom(a,b,c,d) {

	this.obj.clip="rect("+a+","+b+","+c+","+d+")"

	}
// Navigator4 object

function ns_object(obj) {

 	this.obj = obj;             

	this.name = obj.name;

	this.objHide = objHide_ns4;

	this.objShow = objShow_ns4;

	this.objGetLeft = objGetLeft_ns4;

	this.objGetTop = objGetTop_ns4;

	this.objSetTop = objSetTop_ns4;

	this.objSetLeft = objSetLeft_ns4;

	this.objBackgrndColor= objBackgrndColor_ns4

	this.objSetWidth =objSetWidth_ns4

	this.objSetHeight= objSetHeight_ns4

	this.objGetWidth= objGetWidth_ns4

	this.objGetHeight= objGetHeight_ns4

	this.objSetColor=objSetColor_ns4

	this.objGetColor=objGetColor_ns4

	this.objSetVisible=objSetVisible_ns4

	this.objGetVisible=objGetVisible_ns4

	this.objSetZ=objSetZ_ns4

	this.objGetZ=objGetZ_ns4

	this.objMoveHorz=objHorz_ns4

	this.objMoveVert=objVert_ns4

	this.objSetClip=objSetClip_ns4
}



function objSetZ_ns4(z) {

	this.obj.zindex=z

	}



function objGetZ_ns4() {

	return this.obj.zindex

	}



function objSetVisible_ns4(which) {

	

}



function objGetVisible_ns4() {

	return this.obj.visibility 

}







function objGetColor_ns4() {

	return this.obj.color

	}



function objGetHeight_ns4() {

	return this.obj.clip.height

	}



function objGetWidth_ns4() {

	return this.obj.clip.width

	}



function objSetColor_ns4(color) {

	

}



function objSetHeight_ns4(height) {



	}



function objSetWidth_ns4(width) {

	

	}



function objBackgrndColor_ns4(color) {

	this.obj.backgroundColor=color

}



function objHide_ns4() {

	this.obj.visibility = "hidden";

}



function objShow_ns4() {

	this.obj.visibility = "visible";

}



function objGetLeft_ns4() {

	return this.obj.left;

}



function objGetTop_ns4() {

	return this.obj.top;

}



function objSetTop_ns4(top) {

	this.obj.top = top;

}



function objSetLeft_ns4(left) {

	this.obj.left = left;

}



function objVert_ns4(i) {

	this.obj.top+=i;

	return 	this.obj.top;

}



function objHorz_ns4(i) {

	this.obj.left+=i;

	return this.obj.left;

}

function objSetClip_ns(a,b,c,d){

	this.obj.clip.right=b

	this.obj.clip.bottom=c

	this.obj.clip.left=0

	this.obj.clip.top=0

}

// Create the objects

//

//****************************************************************************************





// create IE objects

function create_ie_objects() {

   theelements = document.all.tags("DIV");

   objs = new Array();

   for (i = 0; i < theelements.length; i++) 

      objs[theelements[i].id] = new ie_object(theelements[i]); 

}



// create Navigator objects

function create_ns_objects() {

   objs = new Array();

   for (i = 0; i < document.layers.length; i++) 

   	 objs[document.layers[i].name] = new ns_object(document.layers[i]);

}



// create DOM objects

function create_dom_objects() {

   theelements = document.getElementsByTagName("DIV");

   objs = new Array();

  for (i = 0; i < theelements.length; i++) {

      var obj = theelements[i];

      objs[obj.id] = new dom_object(obj);

      }

}

 

// call correct object loading method    

function create_objects() {

    // if 5.0 browser
    if (navigator.appVersion.substr(0,2)=="5.") {

	create_dom_objects(); }

    else 

    	if (navigator.appName == "Microsoft Internet Explorer") 		

	   		create_ie_objects();

        else

  	   create_ns_objects();

}

