// Figure out which browser is being used var ie4 = false; var ns4 = false; var ns6 = false; if (navigator.appVersion.charAt(0) == "4") if (navigator.appName.indexOf("Explorer") >= 0) ie4 = true; else ns4 = true; else if (navigator.appVersion.charAt(0) > "4") ns6 = true; var isDHTML = 0; var isLayers = 0; var isAll = 0; var isID = 0; if (document.getElementById) {isID = 1; isDHTML = 1;} else { if (document.all) {isAll = 1; isDHTML = 1;} else { browserVersion = parseInt(navigator.appVersion); if ((navigator.appName.indexOf('Netscape') != -1) && (browserVersion == 4)) {isLayers = 1; isDHTML = 1;} }} //***************** DHTML Routines // Constructor for cross-platform / cross-browser layer object function Layer(layerName, outerLayer) { this.layer = ""; this.html = ""; this.xCoor=0; this.yCoor=0; this.children = new Array(); outerLayerName = new String(outerLayer); if(outerLayerName == 'undefined') { outerLayerName = ''; } this.layer = findDOM('', layerName, 0); if (ie4 || ns6) { this.move = LayerMoveDOM; this.moveBy = LayerMoveByDOM; this.show = LayerShowDOM; this.hide = LayerHideDOM; this.resize = LayerResizeDOM; this.getHtml = LayerGetHtmlDOM; this.setHtml = LayerSetHtmlDOM; this.addChild = LayerAddChildDOM; } else { this.move = LayerMoveNS; this.moveBy = LayerMoveByNS; this.show = LayerShowNS; this.hide = LayerHideNS; this.resize = LayerResizeNS; this.getHtml = LayerGetHtmlNS; this.setHtml = LayerSetHtmlNS; this.addChild = LayerAddChildDOM; // This will not work in netscape 4 } } // Get the inner HTML (for netscape 4, will only work if setHtml was used first...) function LayerGetHtmlDOM() {return this.layer.innerHTML;} function LayerGetHtmlNS() {return this.html;} // Replace the contents of the layer function LayerSetHtmlDOM(data) { this.html=data; // save inner layers - fixes IE5 bug with child layers var innerDivs = new Array(this.children.length); // Stick into a real array so reference is not lost for (var loop=0; loop < innerDivs.length; loop++) { innerDivs[loop]=this.children[loop].layer; } for (var loop=0; loop < innerDivs.length; loop++) { document.body.appendChild(innerDivs[loop]); } this.layer.innerHTML=data; // restore inner layers for (var loop=0; loop < innerDivs.length; loop++) { this.layer.appendChild(innerDivs[loop]); } } function LayerSetHtmlNS(data) { this.layer.document.open(); this.layer.document.write(data); this.layer.document.close(); this.html=data; } // Move layer to new x/y coordinates function LayerMoveDOM(xCoor, yCoor) { this.xCoor=xCoor; this.yCoor=yCoor; this.layer.style.left = this.xCoor; this.layer.style.top = this.yCoor; } function LayerMoveNS(xCoor, yCoor) { this.xCoor=xCoor; this.yCoor=yCoor; this.layer.left = this.xCoor; this.layer.top = this.yCoor; } // Move layer to new x/y coordinates function LayerMoveByDOM(xCoor, yCoor) { this.xCoor += xCoor; this.yCoor += yCoor; this.move(this.xCoor,this.yCoor); } function LayerMoveByNS(xCoor, yCoor) { this.xCoor += xCoor; this.yCoor += yCoor; this.move(this.xCoor,this.yCoor); } // Resize layer function LayerResizeDOM(x, y) { this.layer.style.height = y; this.layer.style.width = x; } function LayerResizeNS(x, y) { this.layer.height = y; this.layer.width = x; } // Show a DHTML layer function LayerShowDOM(layerName) { this.layer.style.visibility = "visible"; this.layer.style.display = ""; } function LayerShowNS(layerName) {this.layer.visibility = "show";} // Hide a DHTML layer function LayerHideDOM(layerName) { this.layer.style.visibility = "hidden"; this.layer.style.display = "none"; } function LayerHideNS(layerName) {document.layers[layerName].visibility = "hide";} // Add another layer as a child that appears within this one. Requires a DOM-Capable browser (IE5+/NS6+) function LayerAddChildDOM(childLayer) { this.children[this.children.length] = childLayer; this.layer.appendChild(childLayer.layer); }