var globalzindex = 0; var selectedWindows = new Array(); function makeElement(tag,text,attributes){ var attstr; if(s2381ns||s2381op) var node = document.createElement(tag); for(var att in attributes){ if(s2381ns||s2381op) node.setAttribute(att, attributes[att]); else attstr += " "+att+"=\""+attributes[att]+"\""; } if(!s2381ns && !s2381op) var node = document.createElement("<"+tag+attstr+">"); if(text.length >0){ var ntext = document.createTextNode(text); node.appendChild(ntext); } return node; } function mybody(){ return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body; } function sWindow(id){ this.x = 0; this.y = -1000; this.xoff = 0; this.yoff = 0; this.id = id; this.zindex = id; this.basefontsize = 0.8; this.basewidth = 300; this.zoom = 1; this.selected = false; this.active = false; this.setText = function(text){ var layer = ""; if(s2381ns) layer = "
"; this.handle.innerHTML = layer + text; // this.moveWindow(); }; this.hideWindow = function(){ this.y = -1000; this.moveWindow(); } this.centerWindow = function(){ var r=s2381ie&&!window.opera? mybody().clientWidth : window.innerWidth-20; var o=s2381ie&&!window.opera? mybody().clientHeight : window.innerHeight-20; this.x = (r/2) - (this.handle.offsetWidth/2); this.y = (o/2) - (this.handle.offsetHeight/2); if(s2381ns || s2381op){ this.handle.style["position"] = "fixed"; this.shadows["sul"].style["position"] ="fixed"; this.shadows["sro"].style["position"] ="fixed"; this.shadows["su"].style["position"] ="fixed"; this.shadows["sr"].style["position"] ="fixed"; this.shadows["se"].style["position"] ="fixed"; } else { this.x += mybody().scrollLeft; this.y += mybody().scrollTop; } this.moveWindow(); this.moveShadows(); } this.getMouse = function(e){ var X=(s2381ns)?e.pageX : event.x+mybody().scrollLeft; var Y=(s2381ns)?e.pageY : event.y+mybody().scrollTop; this.xoff = this.x - X; this.yoff = this.y - Y; } this.raise = function(){ if(this.zindex < globalzindex-1){ this.zindex = globalzindex; globalzindex++; this.handle.style.zIndex = this.zindex; this.shadows["sul"].style.zIndex = this.zindex; this.shadows["sro"].style.zIndex = this.zindex; this.shadows["su"].style.zIndex = this.zindex; this.shadows["sr"].style.zIndex = this.zindex; this.shadows["se"].style.zIndex = this.zindex; } this.handle.style.borderStyle = "solid"; } this.drag = function(e){ var X=(s2381ns)?e.pageX : event.x+mybody().scrollLeft; var Y=(s2381ns)?e.pageY : event.y+mybody().scrollTop; this.x = this.xoff +X; this.y = this.yoff +Y; this.moveWindow(); } this.followMouse = function(e){ var X=(s2381ns)?e.pageX : event.x+mybody().scrollLeft; var Y=(s2381ns)?e.pageY : event.y+mybody().scrollTop; var re=s2381ie&&!window.opera? mybody().clientWidth-event.clientX-15 : window.innerWidth-e.clientX-15-20; var be=s2381ie&&!window.opera? mybody().clientHeight-event.clientY-15 : window.innerHeight-e.clientY-15-20; if (re