function Defined_User_Browser() { var navigatorVersion = navigator.appVersion; this.opera = window.opera?true:false; this.ie = document.all?true:false; this.DOM1 = document.getElementById?true:false; this.NS4 = document.layers?true:false; this.Mozilla = this.NS6 = this.DOM1&(navigator.appName=="Netscape"?true:false); this.IE5 = this.ie&this.DOM1; if(this.ie) { var IePos = navigatorVersion.indexOf("MSIE"); var IeVer = parseFloat(navigatorVersion.substring(IePos+5, navigatorVersion.indexOf(';', IePos))); } this.Opera5 = this.opera&this.DOM1; } Is = new Defined_User_Browser(); function setStyleSheet(name, style) { var css = '#'+name+'{\n'; if(style.position != null) css+= 'position:' + style.position + ';\n'; if(style.visibility != null) css+= 'visibility:' + style.visibility + ';\n'; if(style.top != null) css+= 'top:' + style.top + ';\n'; if(style.left != null) css+= 'left:' + style.left + ';\n'; if(style.width) css+= 'width:' + style.width + ';\n'; if(style.height) css+= 'height:' + style.height + ';\n'; if(style.zIndex) css+= 'z-index:' + style.zIndex + ';\n'; if(style.clip) css+= 'clip:' + style.clip + ';\n'; if(style.background) css+= 'background-color:' + style.background + ';\n'; if(style.display) css+= 'display:'+ ((Is.Mozilla||Is.IE5) ? style.display : 'block')+ ';\n'; if(style.filter) css+= 'filter:'+ style.filter+ ';\n'; css += '}'; return css; } function getLayerEmbedTop(id) { var y = 0; if(Is.IE5||Is.Opera5||Is.Mozilla) { var obj = document.getElementById(id); while(obj) { y+= obj.offsetTop; obj = obj.offsetParent; } } return y; } function getLayerEmbedLeft(id) { var x = 0; if(Is.IE5||Is.Opera5||Is.Mozilla) { var obj = document.getElementById(id); while(obj) { x+= obj.offsetLeft; obj = obj.offsetParent; } } return x; } function getLayerHeight(id) { if(Is.IE5||Is.Opera5||Is.Mozilla) h = document.getElementById(id).offsetHeight; return h; } function getLayerWidth(id) { var w; if(Is.IE5||Is.Opera5||Is.Mozilla) w = document.getElementById(id).offsetWidth; return w; } function getWindowWidth() { if(Is.IE5) w = document.body.clientWidth + document.body.scrollLeft; else if(Is.Opera5||Is.Mozilla) w = innerWidth + pageXOffset; return w; } function getWindowHeight() { if(Is.IE5) h = document.body.clientHeight + document.body.scrollTop; else if(Is.Opera5||Is.Mozilla) h = innerHeight + pageYOffset; return h; } function setPosition(id, top, left) { if(Is.IE5||Is.Opera5||Is.Mozilla) { document.getElementById(id).style.top = top; document.getElementById(id).style.left = left; } } function setZindex(id, level) { if(Is.IE5||Is.Opera5||Is.Mozilla) document.getElementById(id).style.zIndex = level; } function setLayerShow(id) { if(Is.IE5||Is.Opera5||Is.Mozilla) document.getElementById(id).style.visibility = "visible"; } function setLayerVisibility(id, state) { document.getElementById(id).style.visibility = state; } function clip(id, top, right, bottom, left) { document.getElementById(id).style.clip='rect('+ top+ ', '+ right+ ', '+ bottom+ ', '+ left+ ')'; } function getMouseX(e) { var x; if(Is.Mozilla||Is.NS4) x = e.pageX; if(Is.IE5||Is.Opera5) x = event.x + document.body.scrollLeft; return x; } function getMouseY(e) { var y; if(Is.Mozilla||Is.NS4) y = e.pageY; if(Is.IE5||Is.Opera5) y = event.y + document.body.scrollTop; return y; } function getMouseButton(e) { var button; if(Is.Mozilla||Is.NS4) button = e.which; if(Is.IE5||Is.Opera5) button = event.button; return button; } function setTextColor(id, color) { var oText = document.getElementById(id); if(!oText) return false; if(Is.IE5||Is.Opera5||Is.Mozilla) document.getElementById(id).style.color = color; return true; }