UNPKG

processmaker-builder

Version:

The gulp task runner for ProcessMaker building

612 lines (611 loc) 212 kB
var jg_ok,jg_ie,jg_fast,jg_dom,jg_moz;function _chkDHTM(wnd,x,i) {x=wnd.document.body||null;jg_ie=x&&typeof x.insertAdjacentHTML!="undefined"&&wnd.document.createElement;jg_dom=(x&&!jg_ie&&typeof x.appendChild!="undefined"&&typeof wnd.document.createRange!="undefined"&&typeof(i=wnd.document.createRange()).setStartBefore!="undefined"&&typeof i.createContextualFragment!="undefined");jg_fast=jg_ie&&wnd.document.all&&!wnd.opera;jg_moz=jg_dom&&typeof x.style.MozOpacity!="undefined";jg_ok=!!(jg_ie||jg_dom);} function _pntCnvDom() {var x=this.wnd.document.createRange();x.setStartBefore(this.cnv);x=x.createContextualFragment(jg_fast?this._htmRpc():this.htm);if(this.cnv)this.cnv.appendChild(x);this.htm="";} function _pntCnvIe() {if(this.cnv)this.cnv.insertAdjacentHTML("BeforeEnd",jg_fast?this._htmRpc():this.htm);this.htm="";} function _pntDoc() {this.wnd.document.write(jg_fast?this._htmRpc():this.htm);this.htm='';} function _pntN() {;} function _mkDiv(x,y,w,h) {this.htm+='<div style="position:absolute;'+'left:'+x+'px;'+'top:'+y+'px;'+'width:'+w+'px;'+'height:'+h+'px;'+'clip:rect(0,'+w+'px,'+h+'px,0);'+'background-color:'+this.color+ (!jg_moz?';overflow:hidden':'')+';"><\/div>';} function _mkDivIe(x,y,w,h) {this.htm+='%%'+this.color+';'+x+';'+y+';'+w+';'+h+';';} function _mkDivPrt(x,y,w,h) {this.htm+='<div style="position:absolute;'+'border-left:'+w+'px solid '+this.color+';'+'left:'+x+'px;'+'top:'+y+'px;'+'width:0px;'+'height:'+h+'px;'+'clip:rect(0,'+w+'px,'+h+'px,0);'+'background-color:'+this.color+ (!jg_moz?';overflow:hidden':'')+';"><\/div>';} var _regex=/%%([^;]+);([^;]+);([^;]+);([^;]+);([^;]+);/g;function _htmRpc() {return this.htm.replace(_regex,'<div style="overflow:hidden;position:absolute;background-color:'+'$1;left:$2px;top:$3px;width:$4px;height:$5px"></div>\n');} function _htmPrtRpc() {return this.htm.replace(_regex,'<div style="overflow:hidden;position:absolute;background-color:'+'$1;left:$2px;top:$3px;width:$4px;height:$5px;border-left:$4px solid $1"></div>\n');} function _mkLin(x1,y1,x2,y2) {if(x1>x2) {var _x2=x2;var _y2=y2;x2=x1;y2=y1;x1=_x2;y1=_y2;} var dx=x2-x1,dy=Math.abs(y2-y1),x=x1,y=y1,yIncr=(y1>y2)?-1:1;if(dx>=dy) {var pr=dy<<1,pru=pr-(dx<<1),p=pr-dx,ox=x;while(dx>0) {--dx;++x;if(p>0) {this._mkDiv(ox,y,x-ox,1);y+=yIncr;p+=pru;ox=x;} else p+=pr;} this._mkDiv(ox,y,x2-ox+1,1);} else {var pr=dx<<1,pru=pr-(dy<<1),p=pr-dy,oy=y;if(y2<=y1) {while(dy>0) {--dy;if(p>0) {this._mkDiv(x++,y,1,oy-y+1);y+=yIncr;p+=pru;oy=y;} else {y+=yIncr;p+=pr;}} this._mkDiv(x2,y2,1,oy-y2+1);} else {while(dy>0) {--dy;y+=yIncr;if(p>0) {this._mkDiv(x++,oy,1,y-oy);p+=pru;oy=y;} else p+=pr;} this._mkDiv(x2,oy,1,y2-oy+1);}}} function _mkLin2D(x1,y1,x2,y2) {if(x1>x2) {var _x2=x2;var _y2=y2;x2=x1;y2=y1;x1=_x2;y1=_y2;} var dx=x2-x1,dy=Math.abs(y2-y1),x=x1,y=y1,yIncr=(y1>y2)?-1:1;var s=this.stroke;if(dx>=dy) {if(dx>0&&s-3>0) {var _s=(s*dx*Math.sqrt(1+dy*dy/(dx*dx))-dx-(s>>1)*dy)/dx;_s=(!(s-4)?Math.ceil(_s):Math.round(_s))+1;} else var _s=s;var ad=Math.ceil(s/2);var pr=dy<<1,pru=pr-(dx<<1),p=pr-dx,ox=x;while(dx>0) {--dx;++x;if(p>0) {this._mkDiv(ox,y,x-ox+ad,_s);y+=yIncr;p+=pru;ox=x;} else p+=pr;} this._mkDiv(ox,y,x2-ox+ad+1,_s);} else {if(s-3>0) {var _s=(s*dy*Math.sqrt(1+dx*dx/(dy*dy))-(s>>1)*dx-dy)/dy;_s=(!(s-4)?Math.ceil(_s):Math.round(_s))+1;} else var _s=s;var ad=Math.round(s/2);var pr=dx<<1,pru=pr-(dy<<1),p=pr-dy,oy=y;if(y2<=y1) {++ad;while(dy>0) {--dy;if(p>0) {this._mkDiv(x++,y,_s,oy-y+ad);y+=yIncr;p+=pru;oy=y;} else {y+=yIncr;p+=pr;}} this._mkDiv(x2,y2,_s,oy-y2+ad);} else {while(dy>0) {--dy;y+=yIncr;if(p>0) {this._mkDiv(x++,oy,_s,y-oy+ad);p+=pru;oy=y;} else p+=pr;} this._mkDiv(x2,oy,_s,y2-oy+ad+1);}}} function _mkLinDott(x1,y1,x2,y2) {if(x1>x2) {var _x2=x2;var _y2=y2;x2=x1;y2=y1;x1=_x2;y1=_y2;} var dx=x2-x1,dy=Math.abs(y2-y1),x=x1,y=y1,yIncr=(y1>y2)?-1:1,drw=true;if(dx>=dy) {var pr=dy<<1,pru=pr-(dx<<1),p=pr-dx;while(dx>0) {--dx;if(drw)this._mkDiv(x,y,1,1);drw=!drw;if(p>0) {y+=yIncr;p+=pru;} else p+=pr;++x;}} else {var pr=dx<<1,pru=pr-(dy<<1),p=pr-dy;while(dy>0) {--dy;if(drw)this._mkDiv(x,y,1,1);drw=!drw;y+=yIncr;if(p>0) {++x;p+=pru;} else p+=pr;}} if(drw)this._mkDiv(x,y,1,1);} function _mkOv(left,top,width,height) {var a=(++width)>>1,b=(++height)>>1,wod=width&1,hod=height&1,cx=left+a,cy=top+b,x=0,y=b,ox=0,oy=b,aa2=(a*a)<<1,aa4=aa2<<1,bb2=(b*b)<<1,bb4=bb2<<1,st=(aa2>>1)*(1-(b<<1))+bb2,tt=(bb2>>1)-aa2*((b<<1)-1),w,h;while(y>0) {if(st<0) {st+=bb2*((x<<1)+3);tt+=bb4*(++x);} else if(tt<0) {st+=bb2*((x<<1)+3)-aa4*(y-1);tt+=bb4*(++x)-aa2*(((y--)<<1)-3);w=x-ox;h=oy-y;if((w&2)&&(h&2)) {this._mkOvQds(cx,cy,x-2,y+2,1,1,wod,hod);this._mkOvQds(cx,cy,x-1,y+1,1,1,wod,hod);} else this._mkOvQds(cx,cy,x-1,oy,w,h,wod,hod);ox=x;oy=y;} else {tt-=aa2*((y<<1)-3);st-=aa4*(--y);}} w=a-ox+1;h=(oy<<1)+hod;y=cy-oy;this._mkDiv(cx-a,y,w,h);this._mkDiv(cx+ox+wod-1,y,w,h);} function _mkOv2D(left,top,width,height) {var s=this.stroke;width+=s+1;height+=s+1;var a=width>>1,b=height>>1,wod=width&1,hod=height&1,cx=left+a,cy=top+b,x=0,y=b,aa2=(a*a)<<1,aa4=aa2<<1,bb2=(b*b)<<1,bb4=bb2<<1,st=(aa2>>1)*(1-(b<<1))+bb2,tt=(bb2>>1)-aa2*((b<<1)-1);if(s-4<0&&(!(s-2)||width-51>0&&height-51>0)) {var ox=0,oy=b,w,h,pxw;while(y>0) {if(st<0) {st+=bb2*((x<<1)+3);tt+=bb4*(++x);} else if(tt<0) {st+=bb2*((x<<1)+3)-aa4*(y-1);tt+=bb4*(++x)-aa2*(((y--)<<1)-3);w=x-ox;h=oy-y;if(w-1) {pxw=w+1+(s&1);h=s;} else if(h-1) {pxw=s;h+=1+(s&1);} else pxw=h=s;this._mkOvQds(cx,cy,x-1,oy,pxw,h,wod,hod);ox=x;oy=y;} else {tt-=aa2*((y<<1)-3);st-=aa4*(--y);}} this._mkDiv(cx-a,cy-oy,s,(oy<<1)+hod);this._mkDiv(cx+a+wod-s,cy-oy,s,(oy<<1)+hod);} else {var _a=(width-(s<<1))>>1,_b=(height-(s<<1))>>1,_x=0,_y=_b,_aa2=(_a*_a)<<1,_aa4=_aa2<<1,_bb2=(_b*_b)<<1,_bb4=_bb2<<1,_st=(_aa2>>1)*(1-(_b<<1))+_bb2,_tt=(_bb2>>1)-_aa2*((_b<<1)-1),pxl=new Array(),pxt=new Array(),_pxb=new Array();pxl[0]=0;pxt[0]=b;_pxb[0]=_b-1;while(y>0) {if(st<0) {pxl[pxl.length]=x;pxt[pxt.length]=y;st+=bb2*((x<<1)+3);tt+=bb4*(++x);} else if(tt<0) {pxl[pxl.length]=x;st+=bb2*((x<<1)+3)-aa4*(y-1);tt+=bb4*(++x)-aa2*(((y--)<<1)-3);pxt[pxt.length]=y;} else {tt-=aa2*((y<<1)-3);st-=aa4*(--y);} if(_y>0) {if(_st<0) {_st+=_bb2*((_x<<1)+3);_tt+=_bb4*(++_x);_pxb[_pxb.length]=_y-1;} else if(_tt<0) {_st+=_bb2*((_x<<1)+3)-_aa4*(_y-1);_tt+=_bb4*(++_x)-_aa2*(((_y--)<<1)-3);_pxb[_pxb.length]=_y-1;} else {_tt-=_aa2*((_y<<1)-3);_st-=_aa4*(--_y);_pxb[_pxb.length-1]--;}}} var ox=-wod,oy=b,_oy=_pxb[0],l=pxl.length,w,h;for(var i=0;i<l;i++) {if(typeof _pxb[i]!="undefined") {if(_pxb[i]<_oy||pxt[i]<oy) {x=pxl[i];this._mkOvQds(cx,cy,x,oy,x-ox,oy-_oy,wod,hod);ox=x;oy=pxt[i];_oy=_pxb[i];}} else {x=pxl[i];this._mkDiv(cx-x,cy-oy,1,(oy<<1)+hod);this._mkDiv(cx+ox+wod,cy-oy,1,(oy<<1)+hod);ox=x;oy=pxt[i];}} this._mkDiv(cx-a,cy-oy,1,(oy<<1)+hod);this._mkDiv(cx+ox+wod,cy-oy,1,(oy<<1)+hod);}} function _mkOvDott(left,top,width,height) {var a=(++width)>>1,b=(++height)>>1,wod=width&1,hod=height&1,hodu=hod^1,cx=left+a,cy=top+b,x=0,y=b,aa2=(a*a)<<1,aa4=aa2<<1,bb2=(b*b)<<1,bb4=bb2<<1,st=(aa2>>1)*(1-(b<<1))+bb2,tt=(bb2>>1)-aa2*((b<<1)-1),drw=true;while(y>0) {if(st<0) {st+=bb2*((x<<1)+3);tt+=bb4*(++x);} else if(tt<0) {st+=bb2*((x<<1)+3)-aa4*(y-1);tt+=bb4*(++x)-aa2*(((y--)<<1)-3);} else {tt-=aa2*((y<<1)-3);st-=aa4*(--y);} if(drw&&y>=hodu)this._mkOvQds(cx,cy,x,y,1,1,wod,hod);drw=!drw;}} function _mkRect(x,y,w,h) {var s=this.stroke;this._mkDiv(x,y,w,s);this._mkDiv(x+w,y,s,h);this._mkDiv(x,y+h,w+s,s);this._mkDiv(x,y+s,s,h-s);} function _mkRectDott(x,y,w,h) {this.drawLine(x,y,x+w,y);this.drawLine(x+w,y,x+w,y+h);this.drawLine(x,y+h,x+w,y+h);this.drawLine(x,y,x,y+h);} function jsgFont() {this.PLAIN='font-weight:normal;';this.BOLD='font-weight:bold;';this.ITALIC='font-style:italic;';this.ITALIC_BOLD=this.ITALIC+this.BOLD;this.BOLD_ITALIC=this.ITALIC_BOLD;} var Font=new jsgFont();function jsgStroke() {this.DOTTED=-1;} var Stroke=new jsgStroke();function jsGraphics(cnv,wnd) {this.setColor=function(x) {this.color=x.toLowerCase();};this.setStroke=function(x) {this.stroke=x;if(!(x+1)) {this.drawLine=_mkLinDott;this._mkOv=_mkOvDott;this.drawRect=_mkRectDott;} else if(x-1>0) {this.drawLine=_mkLin2D;this._mkOv=_mkOv2D;this.drawRect=_mkRect;} else {this.drawLine=_mkLin;this._mkOv=_mkOv;this.drawRect=_mkRect;}};this.setPrintable=function(arg) {this.printable=arg;if(jg_fast) {this._mkDiv=_mkDivIe;this._htmRpc=arg?_htmPrtRpc:_htmRpc;} else this._mkDiv=arg?_mkDivPrt:_mkDiv;};this.setFont=function(fam,sz,sty) {this.ftFam=fam;this.ftSz=sz;this.ftSty=sty||Font.PLAIN;};this.drawPolyline=this.drawPolyLine=function(x,y) {for(var i=x.length-1;i;) {--i;this.drawLine(x[i],y[i],x[i+1],y[i+1]);}};this.fillRect=function(x,y,w,h) {this._mkDiv(x,y,w,h);};this.drawPolygon=function(x,y) {this.drawPolyline(x,y);this.drawLine(x[x.length-1],y[x.length-1],x[0],y[0]);};this.drawEllipse=this.drawOval=function(x,y,w,h) {this._mkOv(x,y,w,h);};this.fillEllipse=this.fillOval=function(left,top,w,h) {var a=w>>1,b=h>>1,wod=w&1,hod=h&1,cx=left+a,cy=top+b,x=0,y=b,oy=b,aa2=(a*a)<<1,aa4=aa2<<1,bb2=(b*b)<<1,bb4=bb2<<1,st=(aa2>>1)*(1-(b<<1))+bb2,tt=(bb2>>1)-aa2*((b<<1)-1),xl,dw,dh;if(w)while(y>0) {if(st<0) {st+=bb2*((x<<1)+3);tt+=bb4*(++x);} else if(tt<0) {st+=bb2*((x<<1)+3)-aa4*(y-1);xl=cx-x;dw=(x<<1)+wod;tt+=bb4*(++x)-aa2*(((y--)<<1)-3);dh=oy-y;this._mkDiv(xl,cy-oy,dw,dh);this._mkDiv(xl,cy+y+hod,dw,dh);oy=y;} else {tt-=aa2*((y<<1)-3);st-=aa4*(--y);}} this._mkDiv(cx-a,cy-oy,w,(oy<<1)+hod);};this.fillArc=function(iL,iT,iW,iH,fAngA,fAngZ) {var a=iW>>1,b=iH>>1,iOdds=(iW&1)|((iH&1)<<16),cx=iL+a,cy=iT+b,x=0,y=b,ox=x,oy=y,aa2=(a*a)<<1,aa4=aa2<<1,bb2=(b*b)<<1,bb4=bb2<<1,st=(aa2>>1)*(1-(b<<1))+bb2,tt=(bb2>>1)-aa2*((b<<1)-1),xEndA,yEndA,xEndZ,yEndZ,iSects=(1<<(Math.floor((fAngA%=360.0)/180.0)<<3))|(2<<(Math.floor((fAngZ%=360.0)/180.0)<<3))|((fAngA>=fAngZ)<<16),aBndA=new Array(b+1),aBndZ=new Array(b+1);fAngA*=Math.PI/180.0;fAngZ*=Math.PI/180.0;xEndA=cx+Math.round(a*Math.cos(fAngA));yEndA=cy+Math.round(-b*Math.sin(fAngA));_mkLinVirt(aBndA,cx,cy,xEndA,yEndA);xEndZ=cx+Math.round(a*Math.cos(fAngZ));yEndZ=cy+Math.round(-b*Math.sin(fAngZ));_mkLinVirt(aBndZ,cx,cy,xEndZ,yEndZ);while(y>0) {if(st<0) {st+=bb2*((x<<1)+3);tt+=bb4*(++x);} else if(tt<0) {st+=bb2*((x<<1)+3)-aa4*(y-1);ox=x;tt+=bb4*(++x)-aa2*(((y--)<<1)-3);this._mkArcDiv(ox,y,oy,cx,cy,iOdds,aBndA,aBndZ,iSects);oy=y;} else {tt-=aa2*((y<<1)-3);st-=aa4*(--y);if(y&&(aBndA[y]!=aBndA[y-1]||aBndZ[y]!=aBndZ[y-1])) {this._mkArcDiv(x,y,oy,cx,cy,iOdds,aBndA,aBndZ,iSects);ox=x;oy=y;}}} this._mkArcDiv(x,0,oy,cx,cy,iOdds,aBndA,aBndZ,iSects);if(iOdds>>16) {if(iSects>>16) {var xl=(yEndA<=cy||yEndZ>cy)?(cx-x):cx;this._mkDiv(xl,cy,x+cx-xl+(iOdds&0xffff),1);} else if((iSects&0x01)&&yEndZ>cy) this._mkDiv(cx-x,cy,x,1);}};this.fillPolygon=function(array_x,array_y) {var i;var y;var miny,maxy;var x1,y1;var x2,y2;var ind1,ind2;var ints;var n=array_x.length;if(!n)return;miny=array_y[0];maxy=array_y[0];for(i=1;i<n;i++) {if(array_y[i]<miny) miny=array_y[i];if(array_y[i]>maxy) maxy=array_y[i];} for(y=miny;y<=maxy;y++) {var polyInts=new Array();ints=0;for(i=0;i<n;i++) {if(!i) {ind1=n-1;ind2=0;} else {ind1=i-1;ind2=i;} y1=array_y[ind1];y2=array_y[ind2];if(y1<y2) {x1=array_x[ind1];x2=array_x[ind2];} else if(y1>y2) {y2=array_y[ind1];y1=array_y[ind2];x2=array_x[ind1];x1=array_x[ind2];} else continue;if((y>=y1)&&(y<y2)) polyInts[ints++]=Math.round((y-y1)*(x2-x1)/(y2-y1)+x1);else if((y==maxy)&&(y>y1)&&(y<=y2)) polyInts[ints++]=Math.round((y-y1)*(x2-x1)/(y2-y1)+x1);} polyInts.sort(_CompInt);for(i=0;i<ints;i+=2) this._mkDiv(polyInts[i],y,polyInts[i+1]-polyInts[i]+1,1);}};this.drawString=function(txt,x,y) {this.htm+='<div style="position:absolute;white-space:nowrap;'+'left:'+x+'px;'+'top:'+y+'px;'+'font-family:'+this.ftFam+';'+'font-size:'+this.ftSz+';'+'color:'+this.color+';'+this.ftSty+'">'+ txt+'<\/div>';};this.drawStringRect=function(txt,x,y,width,height,halign,cls) {var classBk=typeof(cls)!='undefined'?'class="'+cls+'" ':'';this.htm+='<div '+classBk+' style="position:absolute;overflow:hidden;'+'left:'+x+'px;'+'top:'+y+'px;'+'width:'+width+'px;'+'height:'+height+'px;'+'text-align:'+halign+';'+'font-family:'+this.ftFam+';'+'font-size:'+this.ftSz+';'+'line-height: 100%;'+'color:#000000;'+this.ftSty+'">'+'<span style="display:inline-block; vertical-align:middle">'+txt+'<\/span>'+'<\/div>';};this.drawImage=function(imgSrc,x,y,w,h,a) {this.htm+='<div style="position:absolute;'+'left:'+x+'px;'+'top:'+y+'px;'+ (w?('width:'+w+'px;'):'')+ (h?('height:'+h+'px;'):'')+'">'+'<img src="'+imgSrc+'"'+(w?(' width="'+w+'"'):'')+(h?(' height="'+h+'"'):'')+(a?(' '+a):'')+'>'+'<\/div>';};this.clear=function() {this.htm="";if(this.cnv)this.cnv.innerHTML="";};this._mkOvQds=function(cx,cy,x,y,w,h,wod,hod) {var xl=cx-x,xr=cx+x+wod-w,yt=cy-y,yb=cy+y+hod-h;if(xr>xl+w) {this._mkDiv(xr,yt,w,h);this._mkDiv(xr,yb,w,h);} else w=xr-xl+w;this._mkDiv(xl,yt,w,h);this._mkDiv(xl,yb,w,h);};this._mkArcDiv=function(x,y,oy,cx,cy,iOdds,aBndA,aBndZ,iSects) {var xrDef=cx+x+(iOdds&0xffff),y2,h=oy-y,xl,xr,w;if(!h)h=1;x=cx-x;if(iSects&0xff0000) {y2=cy-y-h;if(iSects&0x00ff) {if(iSects&0x02) {xl=Math.max(x,aBndZ[y]);w=xrDef-xl;if(w>0)this._mkDiv(xl,y2,w,h);} if(iSects&0x01) {xr=Math.min(xrDef,aBndA[y]);w=xr-x;if(w>0)this._mkDiv(x,y2,w,h);}} else this._mkDiv(x,y2,xrDef-x,h);y2=cy+y+(iOdds>>16);if(iSects&0xff00) {if(iSects&0x0100) {xl=Math.max(x,aBndA[y]);w=xrDef-xl;if(w>0)this._mkDiv(xl,y2,w,h);} if(iSects&0x0200) {xr=Math.min(xrDef,aBndZ[y]);w=xr-x;if(w>0)this._mkDiv(x,y2,w,h);}} else this._mkDiv(x,y2,xrDef-x,h);} else {if(iSects&0x00ff) {if(iSects&0x02) xl=Math.max(x,aBndZ[y]);else xl=x;if(iSects&0x01) xr=Math.min(xrDef,aBndA[y]);else xr=xrDef;y2=cy-y-h;w=xr-xl;if(w>0)this._mkDiv(xl,y2,w,h);} if(iSects&0xff00) {if(iSects&0x0100) xl=Math.max(x,aBndA[y]);else xl=x;if(iSects&0x0200) xr=Math.min(xrDef,aBndZ[y]);else xr=xrDef;y2=cy+y+(iOdds>>16);w=xr-xl;if(w>0)this._mkDiv(xl,y2,w,h);}}};this.setStroke(1);this.setFont("verdana,geneva,helvetica,sans-serif","12px",Font.PLAIN);this.color="#000000";this.htm="";this.wnd=wnd||window;if(!jg_ok)_chkDHTM(this.wnd);if(jg_ok) {if(cnv) {if(typeof(cnv)=="string") this.cont=document.all?(this.wnd.document.all[cnv]||null):document.getElementById?(this.wnd.document.getElementById(cnv)||null):null;else if(cnv==window.document) this.cont=document.getElementsByTagName("body")[0];else this.cont=cnv;this.cnv=this.wnd.document.createElement("div");this.cnv.style.fontSize=0;this.cont.appendChild(this.cnv);this.paint=jg_dom?_pntCnvDom:_pntCnvIe;} else this.paint=_pntDoc;} else this.paint=_pntN;this.setPrintable(false);} function _mkLinVirt(aLin,x1,y1,x2,y2) {var dx=Math.abs(x2-x1),dy=Math.abs(y2-y1),x=x1,y=y1,xIncr=(x1>x2)?-1:1,yIncr=(y1>y2)?-1:1,p,i=0;if(dx>=dy) {var pr=dy<<1,pru=pr-(dx<<1);p=pr-dx;while(dx>0) {--dx;if(p>0) {aLin[i++]=x;y+=yIncr;p+=pru;} else p+=pr;x+=xIncr;}} else {var pr=dx<<1,pru=pr-(dy<<1);p=pr-dy;while(dy>0) {--dy;y+=yIncr;aLin[i++]=x;if(p>0) {x+=xIncr;p+=pru;} else p+=pr;}} for(var len=aLin.length,i=len-i;i;) aLin[len-(i--)]=x;};function _CompInt(x,y) {return(x-y);} var MooTools={version:'1.11'};function $defined(obj){return(obj!=undefined);};function $type(obj){if(!$defined(obj))return false;if(obj.htmlElement)return'element';var type=typeof obj;if(type=='object'&&obj.nodeName){switch(obj.nodeType){case 1:return'element';case 3:return(/\S/).test(obj.nodeValue)?'textnode':'whitespace';}} if(type=='object'||type=='function'){switch(obj.constructor){case Array:return'array';case RegExp:return'regexp';case Class:return'class';} if(typeof obj.length=='number'){if(obj.item)return'collection';if(obj.callee)return'arguments';}} return type;};function $merge(){var mix={};for(var i=0;i<arguments.length;i++){for(var property in arguments[i]){var ap=arguments[i][property];var mp=mix[property];if(mp&&$type(ap)=='object'&&$type(mp)=='object')mix[property]=$merge(mp,ap);else mix[property]=ap;}} return mix;};var $extend=function(){var args=arguments;if(!args[1])args=[this,args[0]];for(var property in args[1])args[0][property]=args[1][property];return args[0];};var $native=function(){for(var i=0,l=arguments.length;i<l;i++){arguments[i].extend=function(props){for(var prop in props){if(!this.prototype[prop])this.prototype[prop]=props[prop];if(!this[prop])this[prop]=$native.generic(prop);}};}};$native.generic=function(prop){return function(bind){return this.prototype[prop].apply(bind,Array.prototype.slice.call(arguments,1));};};$native(Function,Array,String,Number);function $chk(obj){return!!(obj||obj===0);};function $pick(obj,picked){return $defined(obj)?obj:picked;};function $random(min,max){return Math.floor(Math.random()*(max-min+1)+min);};function $time(){return new Date().getTime();};function $clear(timer){clearTimeout(timer);clearInterval(timer);return null;};var Abstract=function(obj){obj=obj||{};obj.extend=$extend;return obj;};var Window=new Abstract(window);var Document=new Abstract(document);document.head=document.getElementsByTagName('head')[0];window.xpath=!!(document.evaluate);if(window.ActiveXObject)window.ie=window[window.XMLHttpRequest?'ie7':'ie6']=true;else if(document.childNodes&&!document.all&&!navigator.taintEnabled)window.webkit=window[window.xpath?'webkit420':'webkit419']=true;else if(document.getBoxObjectFor!=null)window.gecko=true;window.khtml=window.webkit;Object.extend=$extend;if(typeof HTMLElement=='undefined'){var HTMLElement=function(){};if(window.webkit)document.createElement("iframe");HTMLElement.prototype=(window.webkit)?window["[[DOMElement.prototype]]"]:{};} HTMLElement.prototype.htmlElement=function(){};if(window.ie6)try{document.execCommand("BackgroundImageCache",false,true);}catch(e){};var Class=function(properties){var klass=function(){return(arguments[0]!==null&&this.initialize&&$type(this.initialize)=='function')?this.initialize.apply(this,arguments):this;};$extend(klass,this);klass.prototype=properties;klass.constructor=Class;return klass;};Class.empty=function(){};Class.prototype={extend:function(properties){var proto=new this(null);for(var property in properties){var pp=proto[property];proto[property]=Class.Merge(pp,properties[property]);} return new Class(proto);},implement:function(){for(var i=0,l=arguments.length;i<l;i++)$extend(this.prototype,arguments[i]);}};Class.Merge=function(previous,current){if(previous&&previous!=current){var type=$type(current);if(type!=$type(previous))return current;switch(type){case'function':var merged=function(){this.parent=arguments.callee.parent;return current.apply(this,arguments);};merged.parent=previous;return merged;case'object':return $merge(previous,current);}} return current;};Array.extend({forEach:function(fn,bind){for(var i=0,j=this.length;i<j;i++)fn.call(bind,this[i],i,this);},filter:function(fn,bind){var results=[];for(var i=0,j=this.length;i<j;i++){if(fn.call(bind,this[i],i,this))results.push(this[i]);} return results;},map:function(fn,bind){var results=[];for(var i=0,j=this.length;i<j;i++)results[i]=fn.call(bind,this[i],i,this);return results;},every:function(fn,bind){for(var i=0,j=this.length;i<j;i++){if(!fn.call(bind,this[i],i,this))return false;} return true;},some:function(fn,bind){for(var i=0,j=this.length;i<j;i++){if(fn.call(bind,this[i],i,this))return true;} return false;},indexOf:function(item,from){var len=this.length;for(var i=(from<0)?Math.max(0,len+from):from||0;i<len;i++){if(this[i]===item)return i;} return-1;},copy:function(start,length){start=start||0;if(start<0)start=this.length+start;length=length||(this.length-start);var newArray=[];for(var i=0;i<length;i++)newArray[i]=this[start++];return newArray;},remove:function(item){var i=0;var len=this.length;while(i<len){if(this[i]===item){this.splice(i,1);len--;}else{i++;}} return this;},contains:function(item,from){return this.indexOf(item,from)!=-1;},associate:function(keys){var obj={},length=Math.min(this.length,keys.length);for(var i=0;i<length;i++)obj[keys[i]]=this[i];return obj;},extend:function(array){for(var i=0,j=array.length;i<j;i++)this.push(array[i]);return this;},merge:function(array){for(var i=0,l=array.length;i<l;i++)this.include(array[i]);return this;},include:function(item){if(!this.contains(item))this.push(item);return this;},getRandom:function(){return this[$random(0,this.length-1)]||null;},getLast:function(){return this[this.length-1]||null;}});Array.prototype.each=Array.prototype.forEach;Array.each=Array.forEach;function $A(array){return Array.copy(array);};function $each(iterable,fn,bind){if(iterable&&typeof iterable.length=='number'&&$type(iterable)!='object'){Array.forEach(iterable,fn,bind);}else{for(var name in iterable)fn.call(bind||iterable,iterable[name],name);}};Array.prototype.test=Array.prototype.contains;String.extend({test:function(regex,params){return(($type(regex)=='string')?new RegExp(regex,params):regex).test(this);},toInt:function(){return parseInt(this,10);},toFloat:function(){return parseFloat(this);},camelCase:function(){return this.replace(/-\D/g,function(match){return match.charAt(1).toUpperCase();});},hyphenate:function(){return this.replace(/\w[A-Z]/g,function(match){return(match.charAt(0)+'-'+match.charAt(1).toLowerCase());});},capitalize:function(){return this.replace(/\b[a-z]/g,function(match){return match.toUpperCase();});},trim:function(){return this.replace(/^\s+|\s+$/g,'');},clean:function(){return this.replace(/\s{2,}/g,' ').trim();},rgbToHex:function(array){var rgb=this.match(/\d{1,3}/g);return(rgb)?rgb.rgbToHex(array):false;},hexToRgb:function(array){var hex=this.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);return(hex)?hex.slice(1).hexToRgb(array):false;},contains:function(string,s){return(s)?(s+this+s).indexOf(s+string+s)>-1:this.indexOf(string)>-1;},escapeRegExp:function(){return this.replace(/([.*+?^${}()|[\]\/\\])/g,'\\$1');}});Array.extend({rgbToHex:function(array){if(this.length<3)return false;if(this.length==4&&this[3]==0&&!array)return'transparent';var hex=[];for(var i=0;i<3;i++){var bit=(this[i]-0).toString(16);hex.push((bit.length==1)?'0'+bit:bit);} return array?hex:'#'+hex.join('');},hexToRgb:function(array){if(this.length!=3)return false;var rgb=[];for(var i=0;i<3;i++){rgb.push(parseInt((this[i].length==1)?this[i]+this[i]:this[i],16));} return array?rgb:'rgb('+rgb.join(',')+')';}});Function.extend({create:function(options){var fn=this;options=$merge({'bind':fn,'event':false,'arguments':null,'delay':false,'periodical':false,'attempt':false},options);if($chk(options.arguments)&&$type(options.arguments)!='array')options.arguments=[options.arguments];return function(event){var args;if(options.event){event=event||window.event;args=[(options.event===true)?event:new options.event(event)];if(options.arguments)args.extend(options.arguments);} else args=options.arguments||arguments;var returns=function(){return fn.apply($pick(options.bind,fn),args);};if(options.delay)return setTimeout(returns,options.delay);if(options.periodical)return setInterval(returns,options.periodical);if(options.attempt)try{return returns();}catch(err){return false;};return returns();};},pass:function(args,bind){return this.create({'arguments':args,'bind':bind});},attempt:function(args,bind){return this.create({'arguments':args,'bind':bind,'attempt':true})();},bind:function(bind,args){return this.create({'bind':bind,'arguments':args});},bindAsEventListener:function(bind,args){return this.create({'bind':bind,'event':true,'arguments':args});},delay:function(delay,bind,args){return this.create({'delay':delay,'bind':bind,'arguments':args})();},periodical:function(interval,bind,args){return this.create({'periodical':interval,'bind':bind,'arguments':args})();}});Number.extend({toInt:function(){return parseInt(this);},toFloat:function(){return parseFloat(this);},limit:function(min,max){return Math.min(max,Math.max(min,this));},round:function(precision){precision=Math.pow(10,precision||0);return Math.round(this*precision)/precision;},times:function(fn){for(var i=0;i<this;i++)fn(i);}});var Element=new Class({initialize:function(el,props){if($type(el)=='string'){if(window.ie&&props&&(props.name||props.type)){var name=(props.name)?' name="'+props.name+'"':'';var type=(props.type)?' type="'+props.type+'"':'';delete props.name;delete props.type;el='<'+el+name+type+'>';} el=document.createElement(el);} el=$(el);return(!props||!el)?el:el.set(props);}});var Elements=new Class({initialize:function(elements){return(elements)?$extend(elements,this):this;}});Elements.extend=function(props){for(var prop in props){this.prototype[prop]=props[prop];this[prop]=$native.generic(prop);}};function $(el){if(!el)return null;if(el.htmlElement)return Garbage.collect(el);if([window,document].contains(el))return el;var type=$type(el);if(type=='string'){el=document.getElementById(el);type=(el)?'element':false;} if(type!='element')return null;if(el.htmlElement)return Garbage.collect(el);if(['object','embed'].contains(el.tagName.toLowerCase()))return el;$extend(el,Element.prototype);el.htmlElement=function(){};return Garbage.collect(el);};document.getElementsBySelector=document.getElementsByTagName;function $$(){var elements=[];for(var i=0,j=arguments.length;i<j;i++){var selector=arguments[i];switch($type(selector)){case'element':elements.push(selector);case'boolean':break;case false:break;case'string':selector=document.getElementsBySelector(selector,true);default:elements.extend(selector);}} return $$.unique(elements);};$$.unique=function(array){var elements=[];for(var i=0,l=array.length;i<l;i++){if(array[i].$included)continue;var element=$(array[i]);if(element&&!element.$included){element.$included=true;elements.push(element);}} for(var n=0,d=elements.length;n<d;n++)elements[n].$included=null;return new Elements(elements);};Elements.Multi=function(property){return function(){var args=arguments;var items=[];var elements=true;for(var i=0,j=this.length,returns;i<j;i++){returns=this[i][property].apply(this[i],args);if($type(returns)!='element')elements=false;items.push(returns);};return(elements)?$$.unique(items):items;};};Element.extend=function(properties){for(var property in properties){HTMLElement.prototype[property]=properties[property];Element.prototype[property]=properties[property];Element[property]=$native.generic(property);var elementsProperty=(Array.prototype[property])?property+'Elements':property;Elements.prototype[elementsProperty]=Elements.Multi(property);}};Element.extend({set:function(props){for(var prop in props){var val=props[prop];switch(prop){case'styles':this.setStyles(val);break;case'events':if(this.addEvents)this.addEvents(val);break;case'properties':this.setProperties(val);break;default:this.setProperty(prop,val);}} return this;},inject:function(el,where){el=$(el);switch(where){case'before':el.parentNode.insertBefore(this,el);break;case'after':var next=el.getNext();if(!next)el.parentNode.appendChild(this);else el.parentNode.insertBefore(this,next);break;case'top':var first=el.firstChild;if(first){el.insertBefore(this,first);break;} default:el.appendChild(this);} return this;},injectBefore:function(el){return this.inject(el,'before');},injectAfter:function(el){return this.inject(el,'after');},injectInside:function(el){return this.inject(el,'bottom');},injectTop:function(el){return this.inject(el,'top');},adopt:function(){var elements=[];$each(arguments,function(argument){elements=elements.concat(argument);});$$(elements).inject(this);return this;},remove:function(){return this.parentNode.removeChild(this);},clone:function(contents){var el=$(this.cloneNode(contents!==false));if(!el.$events)return el;el.$events={};for(var type in this.$events)el.$events[type]={'keys':$A(this.$events[type].keys),'values':$A(this.$events[type].values)};return el.removeEvents();},replaceWith:function(el){el=$(el);this.parentNode.replaceChild(el,this);return el;},appendText:function(text){this.appendChild(document.createTextNode(text));return this;},hasClass:function(className){return this.className.contains(className,' ');},addClass:function(className){if(!this.hasClass(className))this.className=(this.className+' '+className).clean();return this;},removeClass:function(className){this.className=this.className.replace(new RegExp('(^|\\s)'+className+'(?:\\s|$)'),'$1').clean();return this;},toggleClass:function(className){return this.hasClass(className)?this.removeClass(className):this.addClass(className);},setStyle:function(property,value){switch(property){case'opacity':return this.setOpacity(parseFloat(value));case'float':property=(window.ie)?'styleFloat':'cssFloat';} property=property.camelCase();switch($type(value)){case'number':if(!['zIndex','zoom'].contains(property))value+='px';break;case'array':value='rgb('+value.join(',')+')';} this.style[property]=value;return this;},setStyles:function(source){switch($type(source)){case'object':Element.setMany(this,'setStyle',source);break;case'string':this.style.cssText=source;} return this;},setOpacity:function(opacity){if(opacity==0){if(this.style.visibility!="hidden")this.style.visibility="hidden";}else{if(this.style.visibility!="visible")this.style.visibility="visible";} if(!this.currentStyle||!this.currentStyle.hasLayout)this.style.zoom=1;if(window.ie)this.style.filter=(opacity==1)?'':"alpha(opacity="+opacity*100+")";this.style.opacity=this.$tmp.opacity=opacity;return this;},getStyle:function(property){property=property.camelCase();var result=this.style[property];if(!$chk(result)){if(property=='opacity')return this.$tmp.opacity;result=[];for(var style in Element.Styles){if(property==style){Element.Styles[style].each(function(s){var style=this.getStyle(s);result.push(parseInt(style)?style:'0px');},this);if(property=='border'){var every=result.every(function(bit){return(bit==result[0]);});return(every)?result[0]:false;} return result.join(' ');}} if(property.contains('border')){if(Element.Styles.border.contains(property)){return['Width','Style','Color'].map(function(p){return this.getStyle(property+p);},this).join(' ');}else if(Element.borderShort.contains(property)){return['Top','Right','Bottom','Left'].map(function(p){return this.getStyle('border'+p+property.replace('border',''));},this).join(' ');}} if(document.defaultView)result=document.defaultView.getComputedStyle(this,null).getPropertyValue(property.hyphenate());else if(this.currentStyle)result=this.currentStyle[property];} if(window.ie)result=Element.fixStyle(property,result,this);if(result&&property.test(/color/i)&&result.contains('rgb')){return result.split('rgb').splice(1,4).map(function(color){return color.rgbToHex();}).join(' ');} return result;},getStyles:function(){return Element.getMany(this,'getStyle',arguments);},walk:function(brother,start){brother+='Sibling';var el=(start)?this[start]:this[brother];while(el&&$type(el)!='element')el=el[brother];return $(el);},getPrevious:function(){return this.walk('previous');},getNext:function(){return this.walk('next');},getFirst:function(){return this.walk('next','firstChild');},getLast:function(){return this.walk('previous','lastChild');},getParent:function(){return $(this.parentNode);},getChildren:function(){return $$(this.childNodes);},hasChild:function(el){return!!$A(this.getElementsByTagName('*')).contains(el);},getProperty:function(property){var index=Element.Properties[property];if(index)return this[index];var flag=Element.PropertiesIFlag[property]||0;if(!window.ie||flag)return this.getAttribute(property,flag);var node=this.attributes[property];return(node)?node.nodeValue:null;},removeProperty:function(property){var index=Element.Properties[property];if(index)this[index]='';else this.removeAttribute(property);return this;},getProperties:function(){return Element.getMany(this,'getProperty',arguments);},setProperty:function(property,value){var index=Element.Properties[property];if(index)this[index]=value;else this.setAttribute(property,value);return this;},setProperties:function(source){return Element.setMany(this,'setProperty',source);},setHTML:function(){this.innerHTML=$A(arguments).join('');return this;},setText:function(text){var tag=this.getTag();if(['style','script'].contains(tag)){if(window.ie){if(tag=='style')this.styleSheet.cssText=text;else if(tag=='script')this.setProperty('text',text);return this;}else{this.removeChild(this.firstChild);return this.appendText(text);}} this[$defined(this.innerText)?'innerText':'textContent']=text;return this;},getText:function(){var tag=this.getTag();if(['style','script'].contains(tag)){if(window.ie){if(tag=='style')return this.styleSheet.cssText;else if(tag=='script')return this.getProperty('text');}else{return this.innerHTML;}} return($pick(this.innerText,this.textContent));},getTag:function(){return this.tagName.toLowerCase();},empty:function(){Garbage.trash(this.getElementsByTagName('*'));return this.setHTML('');}});Element.fixStyle=function(property,result,element){if($chk(parseInt(result)))return result;if(['height','width'].contains(property)){var values=(property=='width')?['left','right']:['top','bottom'];var size=0;values.each(function(value){size+=element.getStyle('border-'+value+'-width').toInt()+element.getStyle('padding-'+value).toInt();});return element['offset'+property.capitalize()]-size+'px';}else if(property.test(/border(.+)Width|margin|padding/)){return'0px';} return result;};Element.Styles={'border':[],'padding':[],'margin':[]};['Top','Right','Bottom','Left'].each(function(direction){for(var style in Element.Styles)Element.Styles[style].push(style+direction);});Element.borderShort=['borderWidth','borderStyle','borderColor'];Element.getMany=function(el,method,keys){var result={};$each(keys,function(key){result[key]=el[method](key);});return result;};Element.setMany=function(el,method,pairs){for(var key in pairs)el[method](key,pairs[key]);return el;};Element.Properties=new Abstract({'class':'className','for':'htmlFor','colspan':'colSpan','rowspan':'rowSpan','accesskey':'accessKey','tabindex':'tabIndex','maxlength':'maxLength','readonly':'readOnly','frameborder':'frameBorder','value':'value','disabled':'disabled','checked':'checked','multiple':'multiple','selected':'selected'});Element.PropertiesIFlag={'href':2,'src':2};Element.Methods={Listeners:{addListener:function(type,fn){if(this.addEventListener)this.addEventListener(type,fn,false);else this.attachEvent('on'+type,fn);return this;},removeListener:function(type,fn){if(this.removeEventListener)this.removeEventListener(type,fn,false);else this.detachEvent('on'+type,fn);return this;}}};window.extend(Element.Methods.Listeners);document.extend(Element.Methods.Listeners);Element.extend(Element.Methods.Listeners);var Garbage={elements:[],collect:function(el){if(!el.$tmp){Garbage.elements.push(el);el.$tmp={'opacity':1};} return el;},trash:function(elements){for(var i=0,j=elements.length,el;i<j;i++){if(!(el=elements[i])||!el.$tmp)continue;if(el.$events)el.fireEvent('trash').removeEvents();for(var p in el.$tmp)el.$tmp[p]=null;for(var d in Element.prototype)el[d]=null;Garbage.elements[Garbage.elements.indexOf(el)]=null;el.htmlElement=el.$tmp=el=null;} Garbage.elements.remove(null);},empty:function(){Garbage.collect(window);Garbage.collect(document);Garbage.trash(Garbage.elements);}};window.addListener('beforeunload',function(){window.addListener('unload',Garbage.empty);if(window.ie)window.addListener('unload',CollectGarbage);}); var MooCanvas=new Class({initialize:function(id,props){var el;if($type(id)=='string'){props=$merge({width:300,height:150},props,{'id':id});el=new Element('canvas',props);if(!el.getContext){if(!CanvasRenderingContext2D.cssFixed){document.createStyleSheet().cssText='canvas{display:inline-block;overflow:hidden;text-align:left;cursor:default;}'+'v\\:*{behavior:url(#default#VML)}'+'o\\:*{behavior:url(#default#VML)}';CanvasRenderingContext2D.cssFixed=true;} el.set({styles:{width:props.width,height:props.height,display:'inline-block',overflow:'hidden'},getContext:function(){this.context=this.context||new CanvasRenderingContext2D(el);return this.context;}});}} return el;}});var CanvasRenderingContext2D=new Class({initialize:function(el){this.parent=el;this.fragment=document.createDocumentFragment();this.element=new Element('div',{styles:{width:el.clientWidth||el.width,height:el.clientHeight||el.height,overflow:'hidden',position:'absolute'}});this.fragment.appendChild(this.element);this.m=[[1,0,0],[0,1,0],[0,0,1]];this.rot=0;this.state=[];this.path=[];this.delay=30;this.max=10;this.i=0;this.Z=10;this.Z2=this.Z/2;this.arcScaleX=1;this.arcScaleY=1;this.currentX=0;this.currentY=0;this.miterLimit=this.Z*1;},lineWidth:1,strokeStyle:'#000',fillStyle:'#fff',globalAlpha:1,globalCompositeOperation:'source-over',lineCap:'butt',lineJoin:'miter',shadowBlur:0,shadowColor:'#000',shadowOffsetX:0,shadowOffsetY:0});CanvasRenderingContext2D.implement({beginPath:function(){this.path=[];this.moved=false;},moveTo:function(x,y){this.path.push('m',this.coord(x,y));this.currentX=x;this.currentY=y;this.moved=true;},closePath:function(){this.path.push('x');},lineTo:function(x,y){this.path.push((this.moved?'l':','),this.coord(x,y));this.currentX=x;this.currentY=y;this.moved=false;},quadraticCurveTo:function(cpx,cpy,x,y){var cx=2*cpx,cy=2*cpy;this.bezierCurveTo((cx+this.currentX)/3,(cy+this.currentY)/3,(cx+x)/3,(cy+y)/3,x,y);},bezierCurveTo:function(cp0x,cp0y,cp1x,cp1y,x,y){this.path.push(' c ',this.coord(cp0x,cp0y),",",this.coord(cp1x,cp1y),",",this.coord(x,y));this.currentX=x;this.currentY=y;},arcTo:function(x,y,w,h){},arc:function(x,y,rad,a0,a1,cw){if(this.rot===0)rad*=this.Z;var x0=Math.cos(a0)*rad,y0=Math.sin(a0)*rad,x1=Math.cos(a1)*rad,y1=Math.sin(a1)*rad;if(this.rot!==0){var da=Math.PI/24;this.lineTo(x0+x,y0+y);if(cw){if(a0<a1)a0+=2*Math.PI;while(a0-da>a1)this.lineTo(x+Math.cos(a0-=da)*rad,y+Math.sin(a0)*rad);}else{if(a1<a0)a1+=2*Math.PI;while(a0+da<a1)this.lineTo(x+Math.cos(a0+=da)*rad,y+Math.sin(a0)*rad);} this.lineTo(x1+x,y1+y);return;} if(x0==x1&&!cw)x0+=0.125;var c=this.getCoords(x,y);this.path.push(cw?'at ':'wa ',Math.round(c.x-this.arcScaleX*rad)+','+Math.round(c.y-this.arcScaleY*rad),' ',Math.round(c.x+this.arcScaleX*rad)+','+Math.round(c.y+this.arcScaleY*rad),' ',this.coord(x0+x-this.Z2,y0+y-this.Z2),' ',this.coord(x1+x-this.Z2,y1+y-this.Z2));},rect:function(x,y,w,h){this.moveTo(x,y);this.lineTo(x+w,y);this.lineTo(x+w,y+h);this.lineTo(x,y+h);this.closePath();},fill:function(){this.stroke(true);},stroke:function(fill){if(!this.path.length)return;var a,color;if(fill){a=[1000,'<v:fill '+this.processColorObject(this.fillStyle)+'></v:fill>'];}else{color=this.processColor(this.strokeStyle);a=[10,'<v:stroke '+'endcap="'+((this.lineCap=='butt')?'flat':this.lineCap)+'" '+'joinstyle="'+this.lineJoin+'" '+'color="'+color.color+'" '+'opacity="'+color.opacity+'"'+'/>'];} this.element.insertAdjacentHTML('beforeEnd','<v:shape '+'path="'+this.path.join('')+'e" '+'stroked="'+!fill+'" '+ (!fill?('strokeweight="'+0.8*this.lineWidth*this.m[0][0]+'" '):'')+'filled="'+!!fill+'" '+'coordsize="'+this.Z*a[0]+','+this.Z*a[0]+'" '+'style="width:'+a[0]+'px; height:'+a[0]+'px; position: absolute;">'+ a[1]+'</v:shape>');this.parent.appendChild(this.fragment);if(fill&&this.fillStyle.img)this.element.getLast().fill.alignshape=false;this.path=[];},clip:function(){},isPointInPath:function(x,y){},processColor:function(col){var a=this.globalAlpha;if(col.substr(0,3)=='rgb'){if(col.charAt(3)=="a"){a*=col.match(/([\d.]*)\)$/)[1];} col=col.rgbToHex();} return{color:col,opacity:a};},processColorObject:function(obj){var ret='',col;if(obj.addColorStop){ret+=((obj.r0)?('type="gradientradial" '+'focusposition="0.2, 0.2" '+'focussize="0.2, 0.2" '):('type="gradient" '+'focus="0" '+'angle="'+(180+(180*obj.angle(obj.x0,obj.y0,obj.x1,obj.y1)/Math.PI))+'" '))+'color="'+obj.col0.color+'" '+'opacity="'+obj.col0.opacity*100+'%" '+'color2="'+obj.col1.color+'" '+'o:opacity2="'+obj.col1.opacity*100+'%" '+'colors="';if(obj.stops){for(var i=0,l=obj.stops.length;i<l;i++){ret+=Math.round(100*obj.stops[i][0])+'% '+obj.stops[i][1];}} ret+='" ';}else if(obj.img){ret+='type="tile" '+'src="'+obj.img.src+'" ';}else{col=this.processColor(obj);ret+='color="'+col.color+'" '+'opacity="'+col.opacity+'" ';} return ret;},getCoords:function(x,y){var m=this.m;return{x:this.Z*(x*m[0][0]+y*m[1][0]+m[2][0])-this.Z2,y:this.Z*(x*m[0][1]+y*m[1][1]+m[2][1])-this.Z2};},coord:function(x,y){var m=this.m;return[Math.round(this.Z*(x*m[0][0]+y*m[1][0]+m[2][0])-this.Z2),',',Math.round(this.Z*(x*m[0][1]+y*m[1][1]+m[2][1])-this.Z2)].join('');}});CanvasRenderingContext2D.implement({clearRect:function(x,y,w,h){this.element.innerHTML='';},fillRect:function(x,y,w,h){this.rect(x,y,w,h);this.fill();},strokeRect:function(x,y,w,h){this.rect(x,y,w,h);this.stroke();}});CanvasRenderingContext2D.implement({scale:function(x,y){this.arcScaleX*=x;this.arcScaleY*=y;this.matMult([[x,0,0],[0,y,0],[0,0,1]]);},rotate:function(ang){this.rot+=ang;var c=Math.cos(ang),s=Math.sin(ang);this.matMult([[c,s,0],[-s,c,0],[0,0,1]]);},translate:function(x,y){this.matMult([[1,0,0],[0,1,0],[x,y,1]]);},transform:function(m11,m12,m21,m22,dx,dy){this.matMult([[m11,m21,dx],[m12,m22,dy],[0,0,1]]);},setTransform:function(m11,m12,m21,m22,dx,dy){this.m=[[1,0,0],[0,1,0],[0,0,1]];this.transform(m11,m12,m21,m22,dx,dy);},matMult:function(b){var m=this.m,o=[[0,0,0],[0,0,0],[0,0,0]];for(var i=0;i<3;i++){if(b[0][i]!==0)this.sum(o[0],this.mult(b[0][i],m[i]));if(b[1][i]!==0)this.sum(o[1],this.mult(b[1][i],m[i]));if(b[2][i]!==0)this.sum(o[2],this.mult(b[2][i],m[i]));} this.m=[o[0],o[1],o[2]];},mult:function(x,y){return[x*y[0],x*y[1],x*y[2]];},sum:function(o,v){o[0]+=v[0];o[1]+=v[1];o[2]+=v[2];}});CanvasRenderingContext2D.implement({drawImage:function(image,var_args){var args=arguments,length=args.length,off=(length==9)?4:0;if(!((length+'').test(/3|5|9/)))throw'Wrong number of arguments';var w0=image.runtimeStyle.width,h0=image.runtimeStyle.height;image.runtimeStyle.width='auto';image.runtimeStyle.height='auto';var w=image.width,h=image.height;image.runtimeStyle.width=w0;image.runtimeStyle.height=h0;var sx=0,sy=0,sw=w,sh=h,dx=args[1+off],dy=args[2+off],dw=args[3+off]||w,dh=args[4+off]||h;if(length==9){sx=args[1];sy=args[2];sw=args[3];sh=args[4];} var d=this.getCoords(dx,dy),vmlStr='<v:group coordsize="'+this.Z*10+','+this.Z*10+'" '+'coordorigin="0,0" '+'style="width:10;height:10;position:absolute;';if(this.m[0][0]!=1||this.m[0][1]){var max=Math.max(this.getCoords(dx+dw,dy),this.getCoords(dx,dy+dh),this.getCoords(dx+dw,dy+dh));vmlStr+='padding:0;'+'padding-right:'+Math.round(Math.max(d.x,max)/this.Z)+'px;'+'padding-bottom:'+Math.round(Math.max(d.y,max)/this.Z)+'px;'+'filter:progid:DXImageTransform.Microsoft.Matrix('+"M11='"+this.m[0][0]+"', M12='"+this.m[1][0]+"', "+"M21='"+this.m[0][1]+"', M22='"+this.m[1][1]+"', "+"Dx='"+Math.round(d.x/this.Z)+"', Dy='"+Math.round(d.y/this.Z)+"', "+"sizingmethod='clip'"+');';}else{vmlStr+='top:'+Math.round(d.y/this.Z)+'px;'+'left:'+Math.round(d.x/this.Z)+'px;';} this.element.insertAdjacentHTML('BeforeEnd',vmlStr+'"><v:image src="'+image.src+'" '+'style="width:'+this.Z*dw+';height:'+this.Z*dh+';" '+'cropleft="'+sx/w+'" '+'croptop="'+sy/h+'" '+'cropright="'+(w-sx-sw)/w+'" '+'cropbottom="'+(h-sy-sh)/h+'" '+'/></v:group>');this.parent.appendChild(this.fragment);},drawImageFromRect:Function.empty,getImageData:function(sx,sy,sw,sh){},putImageData:function(image,dx,dy){},getCoords:function(x,y){var m=this.m;return{x:this.Z*(x*m[0][0]+y*m[1][0]+m[2][0])-this.Z2,y:this.Z*(x*m[0][1]+y*m[1][1]+m[2][1])-this.Z2};}}); /**This notice must be untouched at all times. This is the COMPRESSED version of the Draw2D Library WebSite: http://www.draw2d.org Copyright: 2006 Andreas Herz. All rights reserved. Created: 5.11.2006 by Andreas Herz (Web: http://www.freegroup.de ) LICENSE: LGPL **/ Event=function(){ this.type=null; this.target=null; this.relatedTarget=null; this.cancelable=false; this.timeStamp=null; this.returnValue=true; }; Event.prototype.initEvent=function(sType,_3a0c){ this.type=sType; this.cancelable=_3a0c; this.timeStamp=(new Date()).getTime(); }; Event.prototype.preventDefault=function(){ if(this.cancelable){ this.returnValue=false; } }; Event.fireDOMEvent=function(_3a0d,_3a0e){ if(document.createEvent){ var evt=document.createEvent("Events"); evt.initEvent(_3a0d,true,true); _3a0e.dispatchEvent(evt); }else{ if(document.createEventObject){ var evt=document.createEventObject(); _3a0e.fireEvent("on"+_3a0d,evt); } } }; EventTarget=function(){ this.eventhandlers=new Object(); }; EventTarget.prototype.addEventListener=function(sType,_3a11){ if(typeof this.eventhandlers[sType]=="undefined"){ this.eventhandlers[sType]=new Array; } this.eventhandlers[sType][this.eventhandlers[sType].length]=_3a11; }; EventTarget.prototype.dispatchEvent=function(_3a12){ _3a12.target=this; if(typeof this.eventhandlers[_3a12.type]!="undefined"){ for(var i=0;i<this.eventhandlers[_3a12.type].length;i++){ this.eventhandlers[_3a12.type][i](_3a12); } } return _3a12.returnValue; }; EventTarget.prototype.removeEventListener=function(sType,_3a15){ if(typeof this.eventhandlers[sType]!="undefined"){ var _3a16=new Array; for(var i=0;i<this.eventhandlers[sType].length;i++){ if(this.eventhandlers[sType][i]!=_3a15){ _3a16[_3a16.length]=this.eventhandlers[sType][i]; } } this.eventhandlers[sType]=_3a16; } }; ArrayList=function(){ this.increment=10; this.size=0; this.data=new Array(this.increment); }; ArrayList.EMPTY_LIST=new ArrayList(); ArrayList.prototype.reverse=function(){ var _3dc7=new Array(this.size); for(var i=0;i<this.size;i++){ _3dc7[i]=this.data[this.size-i-1]; } this.data=_3dc7; }; ArrayList.prototype.getCapacity=function(){ return this.data.length; }; ArrayList.prototype.getSize=function(){ return this.size; }; ArrayList.prototype.isEmpty=function(){ return this.getSize()==0; }; ArrayList.prototype.getLastElement=function(){ if(this.data[this.getSize()-1]!=null){ return this.data[this.getSize()-1]; } }; ArrayList.prototype.getFirstElement=function(){ if(this.data[0]!=null){ return this.data[0]; } }; ArrayList.prototype.get=function(i){ return this.data[i]; }; ArrayList.prototype.add=function(obj){ if(this.getSize()==this.data.length){ this.resize(); } this.data[this.size++]=obj; }; ArrayList.prototype.addAll=function(obj){ for(var i=0;i<obj.getSize();i++){ this.add(obj.get(i)); } }; ArrayList.prototype.remove=function(obj){ var index=this.indexOf(obj); if(index>=0){ return this.removeElementAt(index); } return null; }; ArrayList.prototype.insertElementAt=function(obj,index){ if(this.size==this.capacity){ this.resize(); } for(var i=this.getSize();i>index;i--){ this.data[i]=this.data[i-1]; } this.data[index]=obj; this.size++; }; ArrayList.prototype.removeElementAt=function(index){ var _3dd3=this.data[index]; for(var i=index;i<(this.getSize()-1);i++){ this.data[i]=this.data[i+1]; } this.data[this.getSize()-1]=null; this.size--; return _3dd3; }; ArrayList.prototype.removeAllElements=function(){ this.size=0; for(var i=0;i<this.data.length;i++){ this.data[i]=null; } }; ArrayList.prototype.indexOf=function(obj){ for(var i=0;i<this.getSize();i++){ if(this.data[i]==obj){ return i; } } return -1; }; ArrayList.prototype.contains=function(obj){ for(var i=0;i<this.getSize();i++){ if(this.data[i]==obj){ return true; } } return false; }; ArrayList.prototype.resize=function(){ newData=new Array(this.data.length+this.increment); for(var i=0;i<this.data.length;i++){ newData[i]=this.data[i]; } this.data=newData; }; ArrayList.prototype.trimToSize=function(){ var temp=new Array(this.getSize()); for(var i=0;i<this.getSize();i++){ temp[i]=this.data[i]; } this.size=temp.length-1; this.data=temp; }; ArrayList.prototype.sort=function(f){ var i,j; var _3ddf; var _3de0; var _3de1; var _3de2; for(i=1;i<this.getSize();i++){ _3de0=this.data[i]; _3ddf=_3de0[f]; j=i-1; _3de1=this.data[j]; _3de2=_3de1[f]; while(j>=0&&_3de2>_3ddf){ this.data[j+1]=this.data[j]; j--; if(j>=0){ _3de1=this.data[j]; _3de2=_3de1[f]; } } this.data[j+1]=_3de0; } }; ArrayList.prototype.clone=function(){ var _3de3=new ArrayList(this.size); for(var i=0;i<this.size;i++){ _3de3.add(this.data[i]); } return _3de3; }; ArrayList.prototype.overwriteElementAt=function(obj,index){ this.data[index]=obj; }; function trace(_3dbe){ var _3dbf=openwindow("about:blank",700,400); _3dbf.document.writeln("<pre>"+_3dbe+"</pre>"); } function openwindow(url,width,_3dc2){ var left=(screen.width-width)/2; var top=(screen.height-_3dc2)/2; property="left="+left+", top="+top+", toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,alwaysRaised,width="+width+",height="+_3dc2; return window.open(url,"_blank",property); } function dumpObject(obj){ trace("----------------------------------------------------------------------------"); trace("- Object dump"); trace("----------------------------------------------------------------------------"); for(var i in obj){ try{ if(typeof obj[i]!="function"){ trace(i+" --&gt; "+obj[i]); } } catch(e){ } } for(var i in obj){ try{ if(typeof obj[i]=="function"){ trace(i+" --&gt; "+obj[i]); } } catch(e){ } } trace("----------------------------------------------------------------------------"); } Drag=function(){ }; Drag.current=null; Drag.currentTarget=null; Drag.dragging=false; Drag.isDragging=function(){ return this.dragging; }; Drag.setCurrent=function(_326a){ this.current=_326a; this.dragging=true; }; Drag.getCurrent=function(){ return this.current; }; Drag.clearCurrent=function(){ this.current=null; this.dragging=false; }; Draggable=function(_326b,_326c){ EventTarget.call(this); this.construct(_326b,_326c); this.diffX=0; this.diffY=0; this.targets=new ArrayList(); }; Draggable.prototype=new EventTarget; Draggable.prototype.construct=function(_326d,_326e){ this.element=_326d; this.constraints=_326e; var oThis=this; var _3270=function(){ var _3271=new DragDropEvent(); _3271.initDragDropEvent("dblclick",true); oThis.dispatchEvent(_3271); var _3272=arguments[0]||window.event; _3272.cancelBubble=true; _3272.returnValue=false; }; var _3273=function(){ var _3274=arguments[0]||window.event; var _3275=new DragDropEvent(); var _3276=oThis.node.workflow.getAbsoluteX(); var _3277=oThis.node.workflow.getAbsoluteY(); var _3278=oThis.node.workflow.getScrollLeft(); var _3279=oThis.node.workflow.getScrollTop(); _3275.x=_3274.clientX-oThis.element.offsetLeft+_3278-_3276; _3275.y=_3274.cl