// JSWINDOW written by Ronmi. // function RmiWINDOW(target,opt) { this.self=null; this.option=opt; this.target=target; this.setURL=function(url) { if(this.self==null || this.self.closed) this.self=window.open('about:blank', this.target, this.option); this.self.location.href=url; } this.getDocument=function() { return this.self.document; } this.createDIV=function(id) { var d=new RmiDIV(); d.document=this.self.document; d.self=d.document.createElement('div'); if(id) d.self.id=id; return d; } this.getDIVById=function(id) { var d=new RmiDIV(); d.document=this.self.document; d.win=this.self; d.self=d.document.getElementById(id); return d; } this.appendElement=function(e) { this.self.document.body.appendChild(e.self); } } function RmiWINDOWInfo(w) { this.window=w.self; this.W=function() { if(this.window.document.all) { if(this.window.document.body.scrollWidth>this.window.document.body.clientWidth) return this.window.document.body.scrollWidth; else return this.window.document.body.clientWidth; } return this.window.innerWidth; } this.H=function() { if(this.window.document.all) { if(this.window.document.body.scrollHeight>this.window.document.body.clientHeight) return this.window.document.body.scrollHeight; else return this.window.document.body.clientHeight; } return this.window.innerHeight; } this.screenW=function() { if(this.window.document.all) return this.window.document.body.clientWidth; return this.window.innerWidth; } this.screenH=function() { if(this.window.document.all) return this.window.document.body.clientHeight; return this.window.innerHeight; } this.X=function() { if(this.window.document.all) return this.window.document.body.scrollLeft; return this.window.pageXOffset; } this.Y=function() { if(document.all) return this.window.document.body.scrollTop; return this.window.pageYOffset; } this.LTX=function() { return this.X(); } this.LTY=function() { return this.Y(); } this.RBX=function() { var a,b,c,d; a=this.X(); b=this.screenW(); c=a+b; d=this.window.document.body.scrollWidth; if(c>d) return d; else return c; } this.RBY=function() { var a,b,c,d; a=this.Y(); b=this.screenH(); c=a+b; d=this.window.document.body.scrollHeight; if(c>d) return d; else return c; } this.getWindow=function() { var d=new RmiWINDOW(); d.self=this.window; return d; } this.Maximize=function(obj) { var o=obj; if(obj.self) o=obj.self; o.style.top='0px'; o.style.left='0px'; //o.style.width=this.W()+'px'; //o.style.height=this.H()+'px'; var w=parseInt(this.W()); var h=parseInt(this.H()); if(this.window.document.body.offsetWidth>w) w=this.window.document.body.offsetWidth; if(this.window.document.body.offsetHeight>h) h=this.window.document.body.offsetHeight; o.style.width=w+'px'; o.style.height=h+'px'; } this.XCenter=function(obj) { var o=obj; if(obj.self) o=obj.self; var x; var y; y=this.LTY()+(this.RBY()-0-this.LTY()-o.offsetHeight)*0.384; x=this.LTX()+(this.RBX()-0-this.LTX()-o.offsetWidth)/2; if(x<0)x=0; if(y<0)y=0; //o.style.top=y+'px'; o.style.left=x+'px'; } this.YCenter=function(obj) { var o=obj; if(obj.self) o=obj.self; var x; var y; y=this.LTY()+(this.RBY()-0-this.LTY()-o.offsetHeight)*0.384; x=this.LTX()+(this.RBX()-0-this.LTX()-o.offsetWidth)/2; if(x<0)x=0; if(y<0)y=0; o.style.top=y+'px'; //o.style.left=x+'px'; } this.Center=function(obj) { this.XCenter(obj); this.YCenter(obj); } } // // JSEVENT written by Ronmi. // function RmiEVENT(a,c,s,m,b,src,tar,x,y,type,key) { if(typeof(a)!='undefined') this.akey=a; // alt if(typeof(a)!='undefined') this.ckey=c; // ctrl if(typeof(a)!='undefined') this.skey=s; // shift if(typeof(a)!='undefined') this.mkey=m; // meta if(typeof(a)!='undefined') this.button=b; // mouse button 1:left 2:right 4:middle if(typeof(a)!='undefined') this.x=x; // if(typeof(a)!='undefined') this.y=y; // if(typeof(a)!='undefined') this.type=type; // event type if(typeof(a)!='undefined') this.key=key; // keyCode in IE or charCode in NS if(typeof(a)!='undefined') this.source=src; // fromElement/toElement in IE or relatedTarget in NS if(typeof(a)!='undefined') this.target=tar; // srcElement in IE or target in NS this.getEvent=function(e) { if(document.all) { //ie var ele; if(type=='mouseout') ele=e.fromElement; else ele=e.toElement; return new RmiEVENT( e.altKey, e.ctrlKey, e.shiftKey, 0, e.button, ele, e.srcElement, e.clientX, e.clientY, String(e.type).toLowerCase(), e.keyCode ); } else { var btn; if(e.button==0) btn=1; else if(e.button==2) btn=2; else if(e.button==1) btn=4; return new RmiEVENT( e.altKey, e.ctrlKey, e.shiftKey, e.metaKey, btn, e.relatedTarget, e.target, e.clientX, e.clientY, String(e.type).toLowerCase(), e.charCode ); } } } // // JSEVENT written by Ronmi. // function __RmiEVENTHANDLER() { this.handlers=new Array(); this.objs=new Array(); this.objIndex=function(o) { var i; if(!this.objs || this.objs.length<1) return -1; for(i=0;i0 && d>e) d=e; else if(s<0 && d