/***************************************************************************** === DHTML [ JavaScript ] Library ( Master Edition ) === * peace-js-lib-JSME.js / 26 KB * version 2.33 * updated 2001/05/28 * Class list Arith [ peace.js.lang.Arith ] Dimension [ peace.js.geom.Dimension ] Point3 [ peace.js.geom.Point3 ] Client [ peace.js.sys.Client ] Gradation [ peace.js.util.Gradation ] ElementME [ peace.js.lib.ElementME ] EdgingMover [ peace.js.anim.EdgingMover ] Action [ peace.js.lib.Action ] * Reference - JavaScript 3rd Edition / David Flanagan - Mozilla's blues / ShinSoft All scripts copyright (C)2000-2001 by UNOS , All rights reserved. mail : peace@skipup.com home : http://www.skipup.com/~peace/ ******************************************************************************/ function Arith(){var A=Arith;A.ROOT2=Math.SQRT2;A.ROOT3=Math.pow(3,0.5); A.square=function(p){return p*p;}; A.random=function(){var a=arguments;var n=a.length;switch(n){case 0:return Math.round(Math.random());case 1:return a[0][Math.floor(Math.random()*a[0].length)];default:return a[Math.floor(Math.random()*n)];}}; A.ffrandom=function(s,e){return s+(e-s)*Math.random();}; A.total=function(){var s=0;var a=arguments;switch(a.length){case 1:for(var i=0;iMath.floor(n/2))r=n-r;return Math.floor(this.P(n,r)/this.P(r));}; A.toString=function(){return "Arith";}; }new Arith(); function Dimension(){var a=arguments;switch(a.length){case 0:default:this.x=this.y=0;break;case 1:{var o=a[0];if(typeof o=="object"){if(o.constructor==Dimension){this.x=o.x;this.y=o.y;}else if(o.constructor==Array){this.x=o[0];this.y=o[1];}}else this.x=this.y=o;break;}case 2:{this.x=a[0];this.y=a[1];break;}}} function setBasicMember__Dimension__(){var D=Dimension;var DP=D.prototype; DP.set=function(){var a=arguments;var p;switch(a.length){case 0:default:p=new D();break;case 1:p=new D(a[0]);break;case 2:p=new D(a[0],a[1]);break;}this.x=p.x;this.y=p.y;}; DP.setX=function(x){this.x=x;}; DP.setY=function(y){this.y=y;}; DP.getX=function(){return this.x;}; DP.getY=function(){return this.y;}; DP.toArray=function(){return new Array(this.x,this.y);}; DP.toInteger=function(){return new D(Math.floor(this.x),Math.floor(this.y));}; DP.equals=function(p){return(this.x==p.x&&this.y==p.y);}; DP.intEquals=function(p){return(this.toInteger().equals(p.toInteger()));}; DP.isNaN=function(){return(isNaN(this.x)||isNaN(this.y)||this.x==""||this.y=="");}; DP.distance=function(p){if(p){var q=new D(this);q.sub(p);return q.distance();}else return Math.sqrt(Math.pow(this.x,2)+Math.pow(this.y,2));}; DP.mulin=function(p){return this.x*p.x+this.y*p.y;}; DP.max=function(){return Math.max(this.x,this.y);}; DP.min=function(){return Math.min(this.x,this.y);}; DP.angle=function(p){return p?Math.abs(this.angle()-p.angle()):Math.acos(this.x/this.distance());}; DP.absolute=function(){this.x=Math.abs(this.x);this.y=Math.abs(this.y);}; DP.scale=function(v){this.x*=v;this.y*=v;}; DP.add=function(p){var d=new D(p);this.x+=d.x;this.y+=d.y;}; DP.sub=function(p){var d=new D(p);this.x-=d.x;this.y-=d.y;}; DP.toString=function(){return "Dimension:("+this.x+","+this.y+")";}; }setBasicMember__Dimension__(); function Point3(){var a=arguments;switch(a.length){case 0:default:this.x=this.y=this.z=0;break;case 1:{switch(typeof a[0]){case "object":{var o=a[0];if(o.constructor==Point3){this.x=o.x;this.y=o.y;this.z=o.z;}else if(o.constructor==Array){this.x=o[0];this.y=o[1];this.z=o[2];}break;}case "string":{var p;if(a[0].length==6){p=parseInt("0x"+a[0]);}else if(a[0].charAt(0)=='#'){p=parseInt("0x"+a[0].substr(1,6));}else p=Math.floor(a[0]);this.x=(p&0xFF0000)>>>0x10;this.y=(p&0x00FF00)>>>0x08;this.z=(p&0x0000FF)>>>0x00;break;}default:this.x=this.y=this.z=a[0];}break;}case 3:{this.x=a[0];this.y=a[1];this.z=a[2];break;}}} function setBasicMember__Point3__(){var P=Point3;var PP=P.prototype; function digitHex2(p){if(p<0x00){return "00";}else if(p<0x10){return "0"+p.toString(16);}else if(p>0xff){return "ff";}else return p.toString(16);} P.RGBtoHSB=function(){var c=new P(arguments[0]);var cmax=c.max();var cmin=c.min();var h=0.0;var s=(cmax!=0.0)?(cmax-cmin)/cmax:0.0;var b=cmax/0xFF;if(s!=0.0){var cc=new P(c);cc.scale(-1);cc.add(cmax);cc.scale(1/(cmax-cmin));if(c.x==cmax){h=0.0+cc.z-cc.y;}else if(c.y==cmax){h=2.0+cc.x-cc.z;}else h=4.0+cc.y-cc.x;h/=6.0;if(h<0.0){h+=1.0;}else if(h>1.0)h-=1.0;}return new P(h,s,b);}; P.HSBtoRGB=function(){var v=new P(arguments[0]);var h=v.x;var s=v.y;var b=v.z;var c=new P();if(s==0.0){c.add(b);}else{var e=(h-Math.floor(h))*6.0;var f=Math.floor(e);var g=e-f;var n=b*(1.0-s);var m=((f&1)==0)?b*(1.0-s*(1.0-g)):b*(1.0-s*g);switch(f){case 0:c.set(b,m,n);break;case 1:c.set(m,b,n);break;case 2:c.set(n,b,m);break;case 3:c.set(n,m,b);break;case 4:c.set(m,n,b);break;case 5:c.set(b,n,m);break;}}c.scale(255.0);c.add(0.5);return c.toInteger();}; PP.set=function(){var a=arguments;var p;switch(a.length){case 0:default:p=new P();break;case 1:p=new P(a[0]);break;case 3:p=new P(a[0],a[1],a[2]);break;}this.x=p.x;this.y=p.y;this.z=p.z;}; PP.setX=function(x){this.x=x;}; PP.setY=function(y){this.y=y;}; PP.setZ=function(z){this.z=z;}; PP.getX=function(){return this.x;}; PP.getY=function(){return this.y;}; PP.getZ=function(){return this.z;}; PP.toArray=function(){return new Array(this.x,this.y,this.z);}; PP.toInteger=function(){return new P(Math.floor(this.x),Math.floor(this.y),Math.floor(this.z));}; PP.toColor=PP.getColor=function(){return digitHex2(Math.round(this.x))+digitHex2(Math.round(this.y))+digitHex2(Math.round(this.z));}; PP.equals=function(p){return(this.x==p.x&&this.y==p.y&&this.z==p.z);}; PP.intEquals=function(p){return(this.toInteger().equals(p.toInteger()));}; PP.isNaN=function(){return(isNaN(this.x)||isNaN(this.y)||isNaN(this.z)||this.x==""||this.y==""||this.z=="");}; PP.distance=function(p){if(p){var q=new P(this);q.sub(p);return q.distance();}else return Math.sqrt(Math.pow(this.x,2)+Math.pow(this.y,2)+Math.pow(this.z,2));}; PP.mulin=function(p){return this.x*p.x+this.y*p.y+this.z*p.z;}; PP.mulout=function(p){return new P(this.y*p.z-p.y*this.z,this.z*p.x-p.z*this.x,this.x*p.y-p.x*this.y);}; PP.max=function(){return Math.max(Math.max(this.x,this.y),this.z);}; PP.min=function(){return Math.min(Math.min(this.x,this.y),this.z);}; PP.angle=function(p){var result=this.mulin(p)/(this.distance()*p.distance());if(Math.abs(result)>1.0)result /=Math.abs(result);return Math.acos(result);}; PP.absolute=function(){this.x=Math.abs(this.x);this.y=Math.abs(this.y);this.z=Math.abs(this.z);}; PP.scale=function(v){this.x*=v;this.y*=v;this.z*=v;}; PP.add=function(p){var d=new P(p);this.x+=d.x;this.y+=d.y;this.z+=d.z;}; PP.sub=function(p){var d=new P(p);this.x-=d.x;this.y-=d.y;this.z-=d.z;}; PP.toString=function(){return "Point3:("+this.x+","+this.y+","+this.z+")";}; }setBasicMember__Point3__(); function Client(){var C=Client;var D=document;var N=navigator;C.PLATFORM=N.platform;C.UA=N.userAgent;C.NAME=N.appName;C.VERSION=parseInt(N.appVersion);C.IE=(D.all!==void 0);C.NN=(D.layers!==void 0);C.MZ=(C.UA.match(/gecko/i)!=null);C.WIN=(C.UA.match(/Win/)!=null);C.MAC=(C.UA.match(/Mac/)!=null);C.IE4=(C.IE&&D.getElementById===void 0);C.IE5=(C.IE&&D.getElementById!==void 0);C.NS4=(C.NN&&C.VERSION==4);C.NS6=(C.NAME.match(/Netscape/)!=null&&C.VERSION==5); C.setBackgroundColor=function(){var a=arguments;var c=(a.length==1)?((typeof a[0]=="string")?a[0]:a[0].toColor()):'';if(c==''&&!C.IE)c=C.NN?null:"transparent";if(!C.NN){D.body.style.backgroundColor=c;}else D.bgColor=c;}; C.getBackgroundColor=function(){var c=!C.NN?D.body.style.backgroundColor:D.bgColor;if(C.MZ&&c.match(/rgb/i)!=null){var k=c.substring(4,c.length-1).split(',');for(var i=0;i<3;i++){k[i]=parseInt(k[i]);k[i]=(k[i]<0x10)?"0"+k[i].toString(16):k[i].toString(16);}return k[0]+k[1]+k[2];}if(!C.NN&&!(c))c=D.bgColor;return c.substring(1,7);}; C.getInnerSize=C.getSize=function(){return!C.IE?new Dimension(parseInt(innerWidth),parseInt(innerHeight)):new Dimension(D.body.clientWidth,D.body.clientHeight);}; C.getScroll=C.getPageOffset=C.getOffset=function(){return C.IE?new Dimension(D.body.scrollLeft,D.body.scrollTop):(C.NN?new Dimension(pageXOffset,pageYOffset):(C.MZ?new Dimension(parseInt(scrollX),parseInt(scrollY)):new Dimension()));}; C.toString=function(){return "Client:"+C.PLATFORM+" \/ "+C.NAME+" "+C.VERSION;}; }new Client(); function Gradation(){var G=Gradation;var P=Point3; G.getText=G.getHTML=function(){var a=arguments;var k=a.length;var loop=(k==5||k==6);var text=a[0];var c0=a[1];var c1=(k==4||k==6)?a[2]:"";var c2=loop?a[k-3]:a[k-1];var xLoop=loop?a[k-2]:1;var yLoop=loop?a[k-1]:1;var colors=G.getColor(c0,c1,c2,text.length*xLoop);var result=(document.layers!==void 0)?"<\/span>":"";var tempt=text;for(var i=0;i"+text.charAt(i)+"<\/span>";var tempr="
"+result;for(var i=0;i<\/div>"+(Client.MAC?' ':''));this.layer=D.all[this.name];}this.style=this.layer.style;}else{this.layer=new Layer(0);this.style=this.layer;}break;}case 1:{var o=arguments[0];if(typeof o=="string"){this.name=o;this.layer=getLayer(this.name);if(exist)this.style=!Client.NN?this.layer.style:this.layer;}else if(typeof o=="object"){if(o.constructor==Element){this.name=o.name;this.layer=o.layer;this.style=o.style;}else{this.layer=eval(o);this.name=!Client.NN?this.layer.id:this.layer.name;this.style=!Client.NN?this.layer.style:this.layer;}}else Exception(o);break;}}if(Client.NN){function searchLayer_Netscape(l,id){for(var i=0;i<\/iframe>";}else this.layer.src=p;}; EP.toString=function(){return "Element:"+this.name;}; EP.setPositionUR=function(){var a=arguments;var p;switch(a.length){case 0:default:p=new Dimension();case 1:p=new Dimension(a[0]);break;case 2:p=new Dimension(a[0],a[1]);break;}p.x-=this.getWidth();this.setPosition(p);}; EP.setPositionBR=function(){var a=arguments;var p;switch(a.length){case 0:default:p=new Dimension();case 1:p=new Dimension(a[0]);break;case 2:p=new Dimension(a[0],a[1]);break;}p.sub(this.getSize());this.setPosition(p);}; EP.setPositionBL=function(){var a=arguments;var p;switch(a.length){case 0:default:p=new Dimension();case 1:p=new Dimension(a[0]);break;case 2:p=new Dimension(a[0],a[1]);break;}p.y-=this.getHeight();this.setPosition(p);}; EP.setPositionC=function(){var a=arguments;var p;switch(a.length){case 0:default:p=new Dimension();case 1:p=new Dimension(a[0]);break;case 2:p=new Dimension(a[0],a[1]);break;}var s=this.getSize();s.scale(0.5);p.sub(s);this.setPosition(p);}; EP.getPositionUR=function(){var p=this.getPosition();p.x+=this.getWidth();return p;}; EP.getPositionBR=function(){var p=this.getPosition();p.add(this.getSize());return p;}; EP.getPositionBL=function(){var p=this.getPosition();p.y+=this.getHeight();return p;}; EP.getPositionC=function(){var p=this.getPosition();var s=this.getSize();s.scale(0.5);p.add(s);return p;}; EP.setTrimX=function(){var a=arguments;var h=this.getHeight();switch(a.length){case 1:this.setTrim(a[0].x,0,a[0].y,h);break;case 2:this.setTrim(a[0],0,a[1],h);break;}}; EP.setTrimY=function(){var a=arguments;var w=this.getWidth();switch(a.length){case 1:this.setTrim(0,a[0].x,w,a[0].y);break;case 2:this.setTrim(0,a[0],w,a[1]);break;}}; }setBasicMember__Element__(); function EdgingMover(){var a=arguments;if(a.length!=0)this.element=a[0];this.tmpCount=0;this.edging=0;switch(a.length){case 0:default:break;case 3:{this.sPosition=this.element.getPosition();this.ePosition=a[1];this.divCount=a[2];break;}case 4:{if(typeof a[2]=="object"){this.sPosition=a[1];this.ePosition=a[2];this.divCount=a[3];}else{this.sPosition=this.element.getPosition();this.ePosition=a[1];this.divCount=a[2];this.edging=EdgingMover.$_e_(a[3]);}break;}case 5:{this.sPosition=a[1];this.ePosition=a[2];this.divCount=a[3];this.edging=EdgingMover.$_e_(a[4]);break;}}} function setBasicMember__EdgingMover__(){var E=EdgingMover;var EP=E.prototype; E.auto=function(m,t){E.$m=m;E.$t=(t)?t:50;E.$_m_();}; E.$_m_=function(){if(E.$m.step())setTimeout("EdgingMover.$_m_();",E.$t);}; E.$_e_=function(v){return((Math.abs(v)>100)?v/Math.abs(v):v/100)/Math.PI;}; EP.setElement=function(e){this.element=e;}; EP.setPosition=function(){var a=arguments;switch(a.length){case 1:{this.sPosition=(this.element)?this.element.getPosition():new Dimension();this.ePosition=a[0];break;}case 2:{this.sPosition=a[0];this.ePosition=a[1];break;}default:return;}}; EP.setDivCount=function(c){this.divCount=c;}; EP.setEdging=function(v){this.edging=(v)?E.$_e_(v):0;}; EP.step=function(){if(this.tmpCount++