//-- javascript domcross.jvs //-- objects to work with DOM cross browser IE4, NN4 and higher var bName = navigator.appName; var bAgent = navigator.userAgent; var bPlatform = navigator.platform; var bVersion = parseInt(navigator.appVersion); var bNN4 = (bName == "Netscape" && bVersion >= 4); var bIE4 = (bName == "Microsoft Internet Explorer" && bVersion >= 4); var bIE5 = (bAgent.indexOf( "MSIE 5")>= 0); //-- return bIE5 true in case of MSIE 5 function DOMbie( ) { return bIE5 } //-- return true in case browser NN4 or IE4 or higher version function DOMb4( ) { if (bNN4 || bIE4 ) { return true } else { return false } } //-- set DIV object ready for DOM cross NN4 & IE4 function DOMdiv( elementID) { if (bIE4) { this.dom = document.all[elementID]; this.dos = this.dom.style; this.left= this.dos.pixelLeft; this.top = this.dos.pixelTop; this.visibility= this.dos.visibility; } else if (bNN4) { this.dom = document.layers[elementID]; this.dos = document.layers[elementID]; this.left= this.dos.left; this.top = this.dos.top; this.visibility= this.dos.visibility; } this.setPos= setDOMdivPosition; this.setVis= setDOMdivVisibility; this.setCon= setDOMdivContent; } //-- method set position for DOMdiv function setDOMdivPosition( newleft, newtop) { this.dos.left= newleft this.dos.top= newtop } //-- method set visibility for DOMdiv function setDOMdivVisibility( newvis) { this.dos.visibility= newvis } //-- method set content for DOMdiv function setDOMdivContent( newcon) { if (bIE4) { this.dom.innerHTML = newcon } else if (bNN4) { this.dom.document.open() this.dom.document.write( newcon) this.dom.document.close() } } //-- set IMG object ready for DOM cross NN4 & IE4 function DOMimg( divID, elementID) { if (bIE4) { this.dom = document.all[elementID]; this.src = this.dom.src; this.width = this.dom.width this.height= this.dom.height } else if (bNN4) { this.dom = document[divID].document.images[elementID]; this.src = this.dom.scr; this.width = this.dom.width this.height= this.dom.height } this.setSrc= setDOMimgSrc; this.setFor= setDOMimgFormat; } //-- method set src for DOMimg function setDOMimgSrc( newsrc) { this.dom.src= newsrc } //-- method set witdth and heigth for DOMimg function setDOMimgFormat( newwidth, newheight) { this.dom.width = newwidth this.dom.height= newheight }