// The W3C DOM Object
function dom_object(obj) {
	this.css2 = obj;
	this.name = obj.id;
	this.objHide = domHide;
	this.objShow = domShow;
}

// The Navigator DOM Object
function ns_object(obj) {
	this.css2 = obj;
	this.name = obj.name;
	this.objHide = nsobjHide;
	this.objShow = nsobjShow;
}

// The DOM Object Implementations
// hide element
function domHide() {
   this.css2.style.visibility = "hidden";
}

// show element
function domShow() {
   this.css2.style.visibility = "visible";
}

// The Navigator 4.x Objects
// hide element
function nsobjHide() {
	this.css2.visibility = "hidden";
}
// show element
function nsobjShow() {
	this.css2.visibility = "inherit";
}

// Create the objects
// menu will not function until all objects are created and the turnOn function is called
function create_objects() {
    // if IE
    if (navigator.appName == "Microsoft Internet Explorer")
	   create_ie_objects();
    else // Navigator or Mozilla
        if (navigator.appName == "Mozilla" || navigator.appName == "Netscape")
           if (navigator.appVersion.indexOf("4.") == -1)
	      create_dom_objects();
           else 
  	      create_ns_objects();
}

// For IE, pull all DIV blocks into object array
function create_ie_objects() {
   theelements = document.all.tags("DIV");
   theobjs = new Array();
   for (i = 0; i < theelements.length; i++){
      if (theelements[i].id != "") {
	   theobjs[theelements[i].id] = new dom_object(theelements[i]);
	   }
      }
	turnOn();
}

// For Navigator 4.x, pull all DIV blocks into object array
function create_ns_objects(newarray) {
	theobjs = new Array();
	for (i = 0; i < document.layers.length; i++) {
		if (document.layers[i].name != "") {
			theobjs[document.layers[i].name] = new ns_object(document.layers[i]);
		}
	}
	turnOn();
}

// For W3C DOM (Navigator 6.x, Mozilla, IE), pull all named DIV blocks into an array
function create_dom_objects() {
	theelements = document.getElementsByTagName("DIV");
	theobjs = new Array();
	for (i = 0; i < theelements.length; i++) {
		var obj = theelements[i];
		if (obj.id != "") {
			theobjs[obj.id] = new dom_object(obj);
		}
	}
	turnOn();
}

