var atalaWebImageViewerLoaded=true;var atalaWebImageViewerChildVersion="9.0";var atalaShowErrors=window.parent.atalaShowErrors;var _child=new atalaWebImageViewerChild(atalaId);var _clipper=null;var initTries=0;atalaInitChild();function atalaInitChild(){if((window.parent[atalaId]==null)&&initTries<10){initTries++;window.setTimeout("atalaInitChild();",100)}else{if(!_child.isInitialized()){if(window.parent[atalaId]&&window.parent[atalaId].AtlasReload){window.parent[atalaId].AtlasReload()}}}}window.onbeforeunload=function(){if(Atalasoft.Utils.getBrowserType()==1&&_child!=null){_child.FF3BeforeDispose()}};window.onunload=atalaWebImageViewerChildDispose;function atalaWebImageViewerChildDispose(){if(_child!=null){_child.Dispose();_child=null}}function atalaWebImageViewerChild(aQ){var Q=aQ;var ah;var aR;var ar=false;var S=false;var aH=this;var B=null;var A=document.body;var y=0;var x=0;var j=0;var n=0;var aK=0;var aJ=0;var C;var aY;var aM;var aA=0;var ap=0;var az="";var aP="";var aO=0;var aT=1; var au=0;var ai=0;var aG=0;var k;var I=new atalaSize(0,0);var af=false;var Y=0;var z=null;var s=null;var V=Atalasoft.Utils.getBrowserType();var W;function X(aZ){if(W==null){W=window.open("","atalaTraceLog")}W.document.writeln(Q+": "+aZ+"
")}var H=X;this.Changed=function(){};this.Clicked=function(){};this.DoubleClicked=function(){};this.MouseDown=function(){};this.MouseDownLeft=function(){};this.MouseDownRight=function(){};this.MouseMove=function(){};this.MouseOut=function(){};this.MouseOver=function(){};this.MouseUp=function(){};this.RightClicked=function(){};this.OnLoad=function(){};this.ScrollPositionChanged=function(){};this.ZoomChanged=function(){};function c(a4,a0,a3,a2,aZ){var a1=Atalasoft.Event.Throw(a4,a0,a3,a2,aZ);P("OnError",a1)}this.FireEvent=P;function P(aZ,a0){if(a0==null){a0=new Object()}a0.name=aZ;return Atalasoft.Event.Fire(window.parent[Q],aZ,a0)}function u(aZ,a0){return Atalasoft.Event.Fire(aH,aZ,a0)}function e(aZ){return Atalasoft.Forms.getValue(s,aZ)}function T(aZ){return Atalasoft.Forms.getValueInt(s,aZ) }function r(aZ){return Atalasoft.Forms.getValueFloat(s,aZ)}function aF(a0,aZ){Atalasoft.Forms.setValue(s,a0,aZ)}this.BubbleParent=aD;function aD(a1){var aZ=new Array();for(var a0=1;a0a4.Width)?a7:a4.Width)+"px";_clipper.style.height=((a2>a4.Height)?a2:a4.Height)+"px";L(-a0.X,-a0.Y)}f();if(az!=a1||a1==""||aO!=a8||aZ==true||a6){az=a1; aP=a6;aO=a8;if(C!=null){if(C.HasTiles()==true){C.Dispose()}C=null}if(aY!=null){if(aY.HasTiles()==true){aY.Dispose()}aY=null}if(aM!=null){if(aM.HasTiles()==true){aM.Dispose()}aM=null}C=new N(false);aM=new N(true);g();m()}a();aH.Changed()}function aV(){if(aG==0){if(aD("getIsClientDirty")==true){aD("Update")}else{g();p()}}}function p(){if(aG==0){q();M();aS();if(ai==2||au!=0){K()}z.Synchronize()}}function M(){var aZ=aB();var a1=al();B.style.left=aK+"px";B.style.top=aJ+"px";B.style.width=aZ+"px";B.style.height=a1+"px";_clipper.style.width=aZ+"px";_clipper.style.height=a1+"px";var a0=w();_clipper.style.width=((aZ>a0.Width)?aZ:a0.Width)+"px";_clipper.style.height=((a1>a0.Height)?a1:a0.Height)+"px";if(-y!=document.body.scrollLeft||-x!=document.body.scrollTop){E()}}function E(){y=-document.body.scrollLeft;x=-document.body.scrollTop}function O(aZ,a1){var a0=document.createElement("img");var a2=aR;if(a2==""){a2="?atalaimg="}a0.src=a2+"spacer.gif";a0.style.width=aZ+"px";a0.style.height=a1+"px";return a0 }function b(){var aZ=document.createElement("div");Atalasoft.DOM.DisableEvents(aZ);aZ.style.position="absolute";aZ.style.left="0px";aZ.style.top="0px";aZ.style.visibility="visible";aZ.style.overflow="hidden";return aZ}function aN(aZ){if(aZ>aK+aB()-1){aZ=aK+aB()-1}if(aZaJ+al()-1){aZ=aJ+al()-1}if(aZaZ){if(a0.Height>=a1){aK=Math.round((a0.Width-aZ)/2)}else{aK=Math.max(Math.round((a0.Width-I.Width-aZ)/2),0)}}else{aK=0}if(a0.Height>a1){if(a0.Width>=aZ){aJ=Math.round((a0.Height-a1)/2)}else{aJ=Math.max(Math.round((a0.Height-I.Height-a1)/2),0)}}else{aJ=0}}else{aK=0;aJ=0}if(a2==true){p()}}function g(){var aZ=aD("getAutoZoom");aI(aZ)}this.setZoomMode=aI;function aI(aZ){var a1=aT;var a3=G();var a0=a3.Width;var a2=a3.Height;switch(aZ){case 1:case 2:if(j/a0==n/a2){a1=Math.min(a0/j,a2/n)}else{if(j/a0>n/a2){a1=a0/j}else{a1=a2/n}}if(a1>1&&aZ==2){a1=1}break;case 3:a1=a0/j;if(a2=n*a1){a1=a2/n}}break;case 4:a1=a2/n;if(a0=j*a1){a1=a0/j}}break}if(aT!=a1){aT=a1;aF(Q+"_z",aT);p();u("ZoomChanged",null);P("ZoomChanged",null);ae()}}this.PauseRefresh=f;function f(){aG++}this.ResumeRefresh=a;function a(){if(aG==0){c("ResumeRefresh","","refresh has already resumed.","PauseRefresh() must be called before ResumeRefresh().") }else{aG--}aV()}this.Invalidate=F;function F(){ad();i()}function N(bi){var bk=null;var a9=0;var bh=0;var a4=bi;var a5=(bi)?aT:1;var be;var bf=false;if(a4==true){be=3}else{be=1}this.HasTiles=aZ;function aZ(){if(bk==null){return false}else{return true}}this.getZoom=a8;function a8(){return a5}this.Hide=a3;function a3(){if(bk!=null){for(var bl=0;blaK+bv){bq=aK+bv-bt;if(bq<1){bq=1;if(bk[bn].v==true){bk[bn].style.visibility="hidden";bk[bn].v=false}}}if(bs+bo>aJ+bp){bm=aJ+bp-bs;if(bm<1){bm=1;if(bk[bn].v==true){bk[bn].style.visibility="hidden";bk[bn].v=false}}}bk[bn].style.width=bq+"px";bk[bn].style.height=bm+"px";bk[bn].style.left=bt+"px";bk[bn].style.top=bs+"px";bt+=bu;bn++}bt=aK;bs+=bo}}this.Show=ba;function ba(){if(bk==null){return}switch(ai){case 0:for(var bl=0;bl1){aM.Create()}else{C.Create()}}}function aS(){if((au!=0&&aT<1)||(au==3&&aT>1)){if(aM.getZoom!=aT){if(aY!=null){aY.Dispose();aY=null}aY=aM;aY.Hybridize();aM=new N(true);aM.Create()}aM.Reposition()}else{if(!C.HasTiles()){C.Create()}if(aY!=null){aY.Hide()}aM.Hide()}C.Reposition()}function K(){if(au!=0&&aT<1){aM.Show()}else{if(au==3&&aT>1){aM.Show() }else{C.Show()}}}this.ScrollTo=L;function L(aZ,a0){self.scrollTo(aZ,a0)}this.ScrollBy=am;function am(aZ,a0){self.scrollBy(aZ,a0)}function ae(){var a0;var aZ;if(document.compatMode=="CSS1Compat"){a0=-document.documentElement.scrollLeft;aZ=-document.documentElement.scrollTop}else{a0=-A.scrollLeft;aZ=-A.scrollTop}if(a0!=y||aZ!=x){y=a0;x=aZ;aF(Q+"_ipx",-y);aF(Q+"_ipy",-x);u("ScrollPositionChanged",null);P("ScrollPositionChanged",null)}if(ai==2){K()}}function ad(aZ){ae()}function i(aZ){if(af==false){if(!k){G()}var a0=w();a0.Width+=(document.body.scrollHeight>k.Height)?I.Width:0;a0.Height+=(document.body.scrollWidth>k.Width)?I.Height:0;if(a0.Width!=k.Width||a0.Height!=k.Height){af=true;window.setTimeout("_child.Resize();",500)}}}this.Resize=ab;function ab(){k=null;aw();af=false}function h(aZ){if(aZ==null){aZ=event}return P("KeyDown",aZ)}function Z(aZ){if(aZ==null){aZ=event}return P("KeyUp",aZ)}function aC(aZ){if(aZ==null){aZ=event}return P("KeyPress",aZ)}this.isInitialized=aX;function aX(){return ar }this.isLoaded=aj;function aj(){return S}this.getViewPortSize=w;function w(){var aZ=new atalaSize(0,0);aZ.Width=A.clientWidth;aZ.Height=A.clientHeight;return aZ}this.getCenterOffset=U;function U(){return new atalaPoint(aK,aJ)}this.getScrollPosition=t;function t(){return new atalaPoint(y,x)}this.getScrollSize=aU;function aU(){return new atalaSize(aB(),al())}this.getScrollRectangle=ay;function ay(){return new atalaRectangle(aK,aJ,aB(),al())}this.getViewPortRectangle=ag;function ag(){var aZ=new atalaRectangle(0,0,0,0);aZ.X=Math.round(Math.abs(y)/aT);aZ.Y=Math.round(Math.abs(x)/aT);aZ.Width=Math.round(A.clientWidth/aT);aZ.Height=Math.round(A.clientHeight/aT);return aZ}this.getWindowSize=G;function G(){if(I.Width==0&&I.Height==0){o()}if(k==null||V==2){if(V!=2){var a0=A.style.overflow;A.style.overflow="hidden";k=w();A.style.overflow=a0;L(-y,-x)}else{var aZ=aD("getScrollBarVisibility");k=w();if(aZ==0){if(document.body.scrollWidth>k.Width){k.Height+=I.Height}if(document.body.scrollHeight>k.Height){k.Width+=I.Width }}}}return k}this.getViewPort=ak;function ak(){return B}this.ZoomToRectangle=l;function l(aZ,a6,a0,a4){if(aZ.typeOf=="atalaRectangle"){a6=aZ.Y;a0=aZ.Width;a4=aZ.Height;aZ=aZ.X}var a3;var a5=w();var a2=0;var a1=0;if(a5.Width/a0==a5.Height/a4){a3=Math.min(a5.Width/a0,a5.Height/a4);a2=-Math.round(aZ/aT*a3);a1=-Math.round(a6/aT*a3)}else{if(a5.Width/a00){bd=true}document.ondragstart=__rf;document.onselectstart=__rf;document.onfocus=__rf;B.ondragstart=__rf;B.onselectstart=__rf;B.onfocus=__rf;a3=__rf;aZ=__rf;bj=__rf;B.onclick=bl;B.oncontextmenu=bb;B.ondblclick=a9; B.onmousedown=a0;B.onmousemove=a5;B.onmouseout=a4;B.onmouseover=bc;B.onmouseup=bo;function bl(br){br=(br==null)?event:br;if(aH.Clicked(br)!=false){P("Clicked",br);return a3(br)}else{return false}}function bb(br){br=(br==null)?event:br;if(aH.RightClicked(br)!=false){P("RightClicked",br);return aZ(br)}else{return false}}function a9(br){br=(br==null)?event:br;if(aH.DoubleClicked(br)!=false){P("DoubleClicked",br);return}else{return false}}function a0(br){br=(br==null)?event:br;if(br.button==2){if(aH.MouseDownRight(br)!=false){P("MouseDownRight",br);bp(br)}else{return false}}else{if(aH.MouseDownLeft(br)!=false){P("MouseDownLeft",br);bg(br)}else{return false}}if(aH.MouseDown(br)!=false){P("MouseDown",br);return bj(br)}else{return false}}function a3(br){}function aZ(br){}function bj(br){}function bg(br){}function bp(br){}function a5(br){br=(br==null)?event:br;if(aH.MouseMove(br)!=false){P("MouseMove",br);return}else{return false}}function a4(br){br=(br==null)?event:br;P("MouseOut",br)}function bc(br){br=(br==null)?event:br; P("MouseOver",br)}function bo(br){br=(br==null)?event:br;if(aH.MouseUp(br)!=false){P("MouseUp",br);return}else{return false}}var a1=aR;if(a1==""){a1="?atalacsr="}switch(T(Q+"_mtl")){case 0:a3=__rf;a2(MouseToolCursor.Arrow);break;case 1:a3=ba;a2(MouseToolCursor.Hand);break;case 2:bg=z.startSelect;a2(MouseToolCursor.Crosshair);break;case 3:a3=a6;a2(MouseToolCursor.ZoomIn);break;case 4:a3=bq;a2(MouseToolCursor.ZoomOut);break;case 5:bg=z.startSelect;a2(MouseToolCursor.Crosshair);break;case 6:bg=bm;a2(MouseToolCursor.Move);break;case 7:a3=__rt;a2(MouseToolCursor.Hand);break}switch(T(Q+"_mtr")){case 0:break;case 1:aZ=ba;break;case 2:bp=z.startSelect;break;case 3:aZ=a6;break;case 4:aZ=bq;break;case 5:bp=z.startSelect;break;case 6:bp=bm;break;case 7:aZ=__rt;break}a2(T(Q+"_mtc"));function a2(br){switch(br){case MouseToolCursor.Auto:break;case MouseToolCursor.Arrow:B.style.cursor="default";break;case MouseToolCursor.Crosshair:B.style.cursor="crosshair";break;case MouseToolCursor.Grab:B.style.cursor=(V==1)?"-moz-grab":"hand"; break;case MouseToolCursor.Hand:B.style.cursor=(bd)?"hand":"pointer";break;case MouseToolCursor.Move:B.style.cursor="move";break;case MouseToolCursor.ZoomIn:if(V==1){B.style.cursor="-moz-zoom-in"}else{B.style.cursor=(bd)?"hand":'url("'+a1+'ZoomIn.cur")'}break;case MouseToolCursor.ZoomOut:if(V==1){B.style.cursor="-moz-zoom-out"}else{B.style.cursor=(bd)?"hand":'url("'+a1+'ZoomOut.cur")'}break;case MouseToolCursor.Custom:var bs=e(Q+"_mtcc");if(bs!=""){B.style.cursor=bs}break}}function ba(bs){var br=v(bs);bh(br.X,br.Y);return false}function bh(br,bt){var bs=w();L((br-Math.round(bs.Width/2)),(bt-Math.round(bs.Height/2)));return false}function a6(br){bn(br,false);return false}function bq(br){bn(br,true);return false}function bn(bu,br){if(T(Q+"_az")==0||T(Q+"_az")==5){var bt=v(bu);var bs=T(Q+"_zp");var bv;if(br){bv=aT-aT*(bs/100)}else{bv=aT+aT*(bs/100)}bt.X=Math.round(bt.X/aT*bv);bt.Y=Math.round(bt.Y/aT*bv);aT=bv;aF(Q+"_z",aT);p();bh(bt.X,bt.Y);u("ZoomChanged",null);P("ZoomChanged",null)}else{ba(bu) }return false}function bm(br){a8=new atalaPoint(0,0);a7=new atalaPoint(0,0);if(V==0){a8.X=event.screenX;a8.Y=event.screenY}else{a8.X=br.screenX;a8.Y=br.screenY}a7.X=a8.X;a7.Y=a8.Y;document.onmousemove=be;document.onmouseup=bf;return false}function be(br){if(V==0){window.scrollBy(a8.X-event.screenX,a8.Y-event.screenY);a8.X=event.screenX;a8.Y=event.screenY}else{window.scrollBy(a8.X-br.screenX,a8.Y-br.screenY);a8.X=br.screenX;a8.Y=br.screenY}return false}function bf(br){document.onmousemove=function(){};document.onmouseup=function(){};return false}}this.getSelection=J;function J(){return z}function ao(){this.typeOf="atalaRubberBand";var cn=this;var bP;var ce=false;var bZ=false;var b6=false;var be=0;var bp=new atalaPoint(0,0);var bx;var b2;var bq;var bK;var ci;var bv;var bD;var bt;var b3;var bL;var b1;var bS;var bI;var bl;var a6;var a2;var bs;var cm=false;this.Changing=function(){};this.Changed=function(){};bc();function bc(){a8();bx=cf();b2=cf();bx.insertRow(0);bx.rows[0].insertCell(0);b2.insertRow(0); b2.rows[0].insertCell(0);ci=br();bv=br();bD=br();bt=br();bK=document.createElement("div");bK.style.fontFamily="Arial, helvetica, san-serif";bK.style.fontSize="8pt";bK.style.padding="1px";bK.style.backgroundColor="#FFFFE1";bK.style.border="1px solid #000000";bK.style.position="absolute";bK.style.visibility="hidden";bK.style.zIndex="100001";_clipper.appendChild(b2);_clipper.appendChild(bx);_clipper.appendChild(bK);_clipper.appendChild(ci);_clipper.appendChild(bv);_clipper.appendChild(bD);_clipper.appendChild(bt);bq=new bT();by();if(b9()){bQ()}else{bf()}if(bC()==true&&a0()==true){bz()}}this.Dispose=a7;function a7(){if(bq!=null){bq.Dispose();bq=null}cn=null;bP=null;bp=null;bx=null;b2=null;b3=null;bL=null;bK=null;ci=null;bv=null;bD=null;bt=null}function a8(){bP=Atalasoft.DOM.getBoundsRect(B);bL=new atalaSize(aB(),al());bZ=b9();bS=ba();b3=bU();b1=a1();ce=bC();bI=a9();a6=b4();bl=bO()}function bT(){var cy=new Array("move","nw","n","ne","w","e","sw","s","se");var cw=new Array();var cC=false;var ct=new Array(); var cu=0;var cq=0;for(var cv=0;cv<9;cv++){cw[cv]=new cz(cv);_clipper.appendChild(cw[cv].grip)}this.Dispose=cs;function cs(){for(var cF=0;cF<9;cF++){cw[cF].Dispose();cw[cF]=null}cy=null;cw=null;cC=null;ct=null}cD();this.setRectangle=cx;function cx(cF,cI,cG,cH){cu=cG;cq=cH;cw[0].setPos(cF,cI);cw[1].setPos(cF-4,cI-4);cw[3].setPos(cF+cG-4,cI-4);cw[6].setPos(cF-4,cI+cH-4);cw[8].setPos(cF+cG-4,cI+cH-4);cw[0].setSize(cG,cH);if(bS){cw[2].setPos(cF+Math.round(cG/2)-4,cI-4);cw[4].setPos(cF-4,cI+Math.round(cH/2)-4);cw[5].setPos(cF+cG-4,cI+Math.round(cH/2)-4);cw[7].setPos(cF+Math.round(cG/2)-4,cI+cH-4)}else{cw[2].setPos(cF+4,cI-4);cw[4].setPos(cF-4,cI+4);cw[5].setPos(cF+cG-4,cI+4);cw[7].setPos(cF+4,cI+cH-4);cw[2].setSize(cG-8,8);cw[4].setSize(8,cH-8);cw[5].setSize(8,cH-8);cw[7].setSize(cG-8,8)}cp()}this.resetColors=cB;function cB(){for(var cF=0;cF<9;cF++){cw[cF].resetColors()}}this.resetGrips=cA;function cA(){for(var cF=0;cF<9;cF++){cw[cF].resetGripSize();cw[cF].resetColors()}}this.hide=cE;function cE(){for(var cF=0; cF<9;cF++){cw[cF].hide()}}this.show=cr;function cr(){for(var cF=0;cF<9;cF++){if(ct[cF]==true){cw[cF].show()}else{cw[cF].hide()}}}this.showGrips=cp;function cp(){for(var cF=0;cF<9;cF++){ct[cF]=true}ct[0]=true;if(cu<8&&cq<8){ct[1]=false}if(cu<12||cq<12){ct[3]=false;ct[6]=false}if(cu<16||cq<8){ct[2]=false;ct[7]=false}if(cq<16||cu<8){ct[4]=false;ct[5]=false}cr()}this.resetEvents=cD;function cD(){if(bF()==true){if(bl){cw[0].grip.onclick=bh}else{cw[0].grip.onmousedown=bh}cw[0].grip.style.cursor="move"}else{cw[0].grip.onmousedown=__rf;cw[0].grip.style.cursor="default"}for(var cF=1;cF<9;cF++){if(bg()==true){if(bl){cw[cF].grip.onclick=cw[cF].onResize}else{cw[cF].grip.onmousedown=cw[cF].onResize}cw[cF].grip.style.cursor=cy[cF]+"-resize"}else{cw[cF].grip.onmousedown=__rf;cw[cF].grip.style.cursor="default"}}}function cz(cK){var cR=this;var cP;var cN;var cJ=cy[cK];var cM=false;if(V==0){cP=O(1,1)}else{cP=document.createElement("div")}cN=cP.style;cG();cF();this.grip=cP;cN.display="block";cN.position="absolute"; cN.visibility="hidden";cN.zIndex="100012";cP.onclick=__rf;cP.onselectstart=__rf;cP.onselect=__rf;cP.oncontextmenu=__rf;this.Dispose=cI;function cI(){cR=null;cP=null;cN=null;cJ=null}this.setPos=cL;function cL(cT,cU){cN.left=cT+"px";cN.top=cU+"px"}this.setSize=cQ;function cQ(cT,cU){if(ba()==true&&cJ!="move"){cT-=2;cU-=2}if(cT<=0){cT=1}if(cU<=0){cU=1}cN.width=cT+"px";cN.height=cU+"px"}this.hide=cS;function cS(){if(cM){cN.visibility="hidden";cM=false}}this.show=cH;function cH(){if(!cM){cN.visibility="visible";cM=true}}this.resetColors=cG;function cG(){if(cJ!="move"){if(bS==true){if(a0()==true){cN.backgroundColor="#"+cd();cN.border="1px solid #"+bR()}else{cN.backgroundColor="#"+bR();cN.border="1px solid #"+bR()}}else{cN.backgroundColor="";cN.border=""}}}this.resetGripSize=cF;function cF(){if(bS==true){cN.width="6px";cN.height="6px"}else{cN.width="8px";cN.height="8px"}}this.onResize=cO;function cO(cT){return bw(cT,cJ)}}}function cf(){var cp=document.createElement("table");cp.border="0";cp.cellPadding="0"; cp.cellSpacing="0";cp.style.position="absolute";cp.style.visibility="hidden";cp.style.zIndex="100001";return cp}function br(){var cq=aR;if(cq==""){cq="?atalaimg="}var cp=Atalasoft.DOM.CreateMask(cq+"mask.png");cp.style.left="0px";cp.style.top="0px";cp.style.width="1px";cp.style.height="1px";cp.style.position="absolute";cp.style.visibility="hidden";cp.style.zIndex="100000";cp.appendChild(O(1,1));return cp}this.getAnimated=bC;function bC(){if(e(Q+"_rsa").toLowerCase()=="true"){return true}else{return false}}this.getAspectRatio=a9;function a9(){return r(Q+"_rsar")}this.getAutoPostBack=ca;function ca(){if(e(Q+"_rsp").toLowerCase()=="true"){return true}else{return false}}this.getBackColor=cd;function cd(){return e(Q+"_rsbc")}this.getClickLock=bO;function bO(){if(e(Q+"_rscl").toLowerCase()=="true"){return true}else{return false}}this.getDrawMask=b4;function b4(){if(e(Q+"_rsdm").toLowerCase()=="true"){return true}else{return false}}this.getForeColor=bR;function bR(){return e(Q+"_rsfc")}this.getHeight=bn; function bn(){return T(Q+"_rsh")}this.getMovable=bF;function bF(){if(e(Q+"_rsm").toLowerCase()=="true"){return true}else{return false}}this.getMultiColor=a0;function a0(){if(e(Q+"_rsmc").toLowerCase()=="true"){return true}else{return false}}this.getPosition=bX;function bX(){return new atalaPoint(T(Q+"_rsx"),T(Q+"_rsy"))}this.getResizable=bg;function bg(){if(e(Q+"_rsr").toLowerCase()=="true"){return true}else{return false}}this.getSize=ck;function ck(){return new atalaSize(T(Q+"_rsw"),T(Q+"_rsh"))}this.getShowGrips=ba;function ba(){if(e(Q+"_rsg").toLowerCase()=="true"){return true}else{return false}}this.getShowTooltip=a1;function a1(){if(e(Q+"_rst").toLowerCase()=="true"){return true}else{return false}}this.getVisible=b9;function b9(){if(e(Q+"_rsv").toLowerCase()=="true"){return true}else{return false}}this.getVisibility=bj;function bj(){if(b9()){return"visible"}else{return"hidden"}}this.getWidth=bE;function bE(){return T(Q+"_rsw")}this.getRectangle=b0;function b0(){return new atalaRectangle(T(Q+"_rsx"),T(Q+"_rsy"),T(Q+"_rsw"),T(Q+"_rsh")) }function bU(){var cs=bX();var cp=bE();var cq=bn();var cr=new atalaRectangle(cs.X,cs.Y,cp,cq);cr.X=Math.round(cr.X*aT);cr.Y=Math.round(cr.Y*aT);cr.Width=Math.round(cr.Width*aT);cr.Height=Math.round(cr.Height*aT);return cr}this.setAnimated=bd;function bd(cp){if(Atalasoft.Utils.CheckBool(cp)==true){if(bC()!=cp){aF(Q+"_rsa",cp);if(cp==true){ce=true;bz()}else{ce=false}}}else{c("Selection.setAnimated",5,cp,"")}}this.setAspectRatio=co;function co(cp){if(cp>=0){aF(Q+"_rsar",cp)}}this.setAutoPostBack=aZ;function aZ(cp){if(Atalasoft.Utils.CheckBool(cp)==true){if(ca()!=cp){aF(Q+"_rsp",cp);bH()}}else{c("Selection.setAutoPostBack",5,cp,"")}}this.setBackColor=b7;function b7(cp){aF(Q+"_rsbc",cp);by()}this.setClickLock=bA;function bA(cp){if(Atalasoft.Utils.CheckBool(cp)==true){if(bO()!=cp){aF(Q+"_rscl",cp)}}else{c("Selection.setClickLock",5,cp,"")}}this.setDrawMask=bG;function bG(cp){if(Atalasoft.Utils.CheckBool(cp)==true){if(b4()!=cp){aF(Q+"_rsdm",cp);bN()}}else{c("Selection.setDrawMask",5,cp,"")}}this.setForeColor=bM; function bM(cp){aF(Q+"_rsfc",cp);by()}this.setHeight=ch;function ch(cq){if(cq>=0){var cr=bn();if(cq>n){cq=n}if(cq!=cr){aF(Q+"_rsh",cq);if(cm){try{cn.Changing()}catch(cp){c(Q+".getSelection().Changing",-1,"\n"+cn.Changing,cp.message,cp)}}else{try{cn.Changed()}catch(cp){c(Q+".getSelection().Changed",-1,"\n"+cn.Changed,cp.message,cp)}if(ca()){aq("RubberBand")}}bN()}}else{c("Selection.setHeight",3,cq,"Valid values are greater than or equal to 0.")}}this.setMovable=cc;function cc(cp){if(Atalasoft.Utils.CheckBool(cp)==true){if(bF()!=cp){aF(Q+"_rsm",cp);bH()}}else{c("Selection.setMovable",5,cp,"")}}this.setMultiColor=cj;function cj(cp){if(Atalasoft.Utils.CheckBool(cp)==true){aF(Q+"_rsmc",cp);by()}else{c("Selection.setMultiColor",5,cp,"")}}this.setPosition=bB;function bB(cp){if(cp.typeOf=="atalaPoint"){a4(cp.X,cp.Y)}else{c("Selection.setPosition",4,cp.typeOf,"atalaPoint expected.")}}function a4(cp,cr){if(cp>=0&&cr>=0){aF(Q+"_rsx",cp);aF(Q+"_rsy",cr);b3.X=Math.round(cp*aT);b3.Y=Math.round(cr*aT); if(cm){try{cn.Changing()}catch(cq){c(Q+".getSelection().Changing",-1,"\n"+cn.Changing,cq.message,cq)}}else{bu();try{cn.Changed()}catch(cq){c(Q+".getSelection().Changed",-1,"\n"+cn.Changed,cq.message,cq)}if(ca()){aq("RubberBand")}}}else{c("Selection.setSize",3,cp+"x"+cr,"Position must be at least 0x0.")}}this.setResizable=a3;function a3(cp){if(Atalasoft.Utils.CheckBool(cp)==true){if(bg()!=cp){aF(Q+"_rsr",cp);bH()}}else{c("Selection.setResizable",5,cp,"")}}this.setSize=b5;function b5(cp){if(cp.typeOf=="atalaSize"){bV(cp.Width,cp.Height)}else{c("Selection.setSize",4,cp.typeOf,"atalaSize expected.")}}function bV(cp,cs){if(cp>=0&&cs>=0){var cq=T(Q+"_rsw");var ct=T(Q+"_rsh");if(cp>j){cp=j}if(cs>n){cs=n}if(cp!=cq||cs!=ct){aF(Q+"_rsw",cp);aF(Q+"_rsh",cs);if(cm){try{cn.Changing()}catch(cr){c(Q+".getSelection().Changing",-1,"\n"+cn.Changing,cr.message,cr)}}else{bN();try{cn.Changed()}catch(cr){c(Q+".getSelection().Changed",-1,"\n"+cn.Changed,cr.message,cr)}if(ca()){aq("RubberBand")}}}}else{c("Selection.setSize",3,cp+"x"+cs,"Size must be at least 0x0.") }}this.setShowGrips=cl;function cl(cp){if(Atalasoft.Utils.CheckBool(cp)==true){if(ba()!=cp){aF(Q+"_rsg",cp);a8();bq.resetGrips();if(cp){bq.show()}else{bq.hide()}bN()}}else{c("Selection.setShowGrips",5,cp,"")}}this.setShowTooltip=cb;function cb(cp){if(Atalasoft.Utils.CheckBool(cp)==true){if(a1()!=cp){aF(Q+"_rst",cp)}}else{c("Selection.setShowTooltip",5,cp,"")}}this.setVisibility=bk;function bk(cp){if(bj()!=cp){if(cp=="visible"){aF(Q+"_rsv",true);bN()}else{if(cp=="hidden"){aF(Q+"_rsv",false);bN()}else{c("Selection.setVisibility",3,cp,'Valid values are "hidden" or "visible".')}}}}this.setWidth=a5;function a5(cr){if(cr>=0){var cp=bE();if(cr>j){cr=j}if(cr!=cp){aF(Q+"_rsw",cr);if(cm){try{cn.Changing()}catch(cq){c(Q+".getSelection().Changing",-1,"\n"+cn.Changing,cq.message,cq)}}else{try{cn.Changed()}catch(cq){c(Q+".getSelection().Changed",-1,"\n"+cn.Changed,cq.message,cq)}if(ca()){aq("RubberBand")}}bN()}}else{c("Selection.setWidth",3,cr,"Valid values are greater than or equal to 0.")}}function bo(){if(!a6){bD.style.visibility="hidden"; bt.style.visibility="hidden";ci.style.visibility="hidden";bv.style.visibility="hidden";return}if(b3.Y>0){ci.style.left=aK+"px";ci.style.top=aJ+"px";ci.style.width=bP.Width+"px";ci.style.height=b3.Y+"px";ci.style.visibility="visible"}else{ci.style.visibility="hidden"}if(b3.Y+b3.Height0){bD.style.left=aK+"px";bD.style.top=aJ+b3.Y+"px";bD.style.width=b3.X+"px";bD.style.height=b3.Height+"px";bD.style.visibility="visible"}else{bD.style.visibility="hidden"}if(b3.X+b3.Width=cr||cp+b3.Width>cr){cp=cr-b3.Width;if(cp<0){cp=0}}if(cw>=cs||cw+b3.Height>cs){cw=cs-b3.Height;if(cw<0){cw=0}}if(cp!=b3.X||cw!=b3.Y){aF(Q+"_rsx",Math.round(cp/aT));aF(Q+"_rsy",Math.round(cw/aT));b3.X=Math.round(cp*aT);b3.Y=Math.round(cw*aT)}var cu=aK+b3.X;var ct=aJ+b3.Y;var cv=b3.Width;var cq=b3.Height;bi(cu,ct);cg(cv,cq);bq.setRectangle(cu,ct,cv,cq);if(bZ){bQ();bo()}else{bf()}}function bi(cp,cq){b2.style.left=cp+"px";bx.style.left=cp+"px";b2.style.top=cq+"px"; bx.style.top=cq+"px"}function cg(cp,cq){if(cp==0){cp=1}b2.style.width=cp+"px";bx.style.width=cp+"px";b2.style.height=cq+"px";bx.style.height=cq+"px"}this.startSelect=b8;function b8(cq){if(bl){if(b6){b6=false;return false}else{b6=true}}var cp=v(cq);a8();bk("visible");bp=new atalaPoint(cp.X,cp.Y);b3.X=cp.X-bP.X;b3.Y=cp.Y-bP.Y;b3.Width=1;b3.Height=1;cm=true;a2=0;bs=0;bu();if(b1==true){bb()}if(T(Q+"_mtl")==5||T(Q+"_mtr")==5){document.onmouseup=bm;if(V==1){window.parent.document.onmouseup=bm}}else{document.onmouseup=bY;if(V==1){window.parent.document.onmouseup=bY}}document.onmousemove=bJ;if(V==1){window.parent.document.onmousemove=bJ}return false}function bJ(cu){var cr=v(cu);D(cr);var cp=bp.X;var cv=bp.Y;var cq=Math.abs(cr.X-bp.X);var cs=Math.abs(cr.Y-bp.Y);if(bI>0){var ct=Math.abs((cr.Y-bp.Y)/(cr.X-bp.X));if(ct>1/bI&&bs==0||a2==1){cq=Math.round(cs*bI)}else{cs=Math.round(cq/bI)}}if(cr.X0){cs=Math.round(cq/bI)}cp=bp.X-cq}}else{if(cp+cq>bL.Width+bP.X){cq=bL.Width-cp+bP.X; if(bI>0){cs=Math.round(cq/bI)}}}if(cr.Y0){cq=Math.round(cs*bI)}cv=bp.Y-cs;if(cr.XbL.Height+bP.Y){cs=bL.Height-cv+bP.Y;if(bI>0){cq=Math.round(cs*bI)}if(cr.X0){b3.X=cp-bP.X;b3.Width=cq}if(bs==0||bI>0){b3.Y=cv-bP.Y;b3.Height=cs}bu();a4(Math.round(b3.X/aT),Math.round(b3.Y/aT));bV(Math.round(b3.Width/aT),Math.round(b3.Height/aT));if(b1==true){bb()}return false}function bw(cq,cr){if(bl){if(b6){b6=false;return false}else{b6=true}}var cp=v(cq);a8();a2=0;bs=0;cm=true;switch(cr){case"nw":bp.X=b3.X+b3.Width;bp.Y=b3.Y+b3.Height;break;case"n":bp.X=b3.X;bp.Y=b3.Y+b3.Height;a2=1;break;case"ne":bp.X=b3.X;bp.Y=b3.Y+b3.Height;break;case"w":bp.X=b3.X+b3.Width;bp.Y=b3.Y+b3.Height;bs=1;break;case"e":bp.X=b3.X;bp.Y=b3.Y+b3.Height;bs=1;break;case"sw":bp.X=b3.X+b3.Width;bp.Y=b3.Y;break;case"s":bp.X=b3.X;bp.Y=b3.Y;a2=1;break;case"se":bp.X=b3.X;bp.Y=b3.Y;break}bp.X+=aK;bp.Y+=aJ;bu();if(b1==true){bb() }document.onmouseup=bY;document.onmousemove=bJ;if(V==1){window.parent.document.onmouseup=bY;window.parent.document.onmousemove=bJ}return false}function bh(cq){if(bl){if(b6){b6=false;return false}else{b6=true}}var cp=v(cq);a8();cm=true;bp=new atalaPoint(cp.X-b3.X,cp.Y-b3.Y);document.onmouseup=bY;document.onmousemove=bW;if(V==1){window.parent.document.onmouseup=bY;window.parent.document.onmousemove=bW}return false}function bW(cr){var cp=v(cr);var cq=new atalaPoint(0,0);cq.X=Math.round((cp.X-bp.X)/aT);cq.Y=Math.round((cp.Y-bp.Y)/aT);if(cq.X>j-Math.round(b3.Width/aT)){cq.X=j-Math.round(b3.Width/aT)}if(cq.X<0){cq.X=0}if(cq.Y>n-Math.round(b3.Height/aT)){cq.Y=n-Math.round(b3.Height/aT)}if(cq.Y<0){cq.Y=0}bB(cq);bu();return false}function bY(cs){if(bl&&b6){return false}var cr=new atalaPoint(0,0);var cq=new atalaSize(0,0);cr.X=Math.round(b3.X/aT);cr.Y=Math.round(b3.Y/aT);cq.Width=Math.round(b3.Width/aT);cq.Height=Math.round(b3.Height/aT);if(b3.Width>1&&b3.Height>1){bB(cr);b5(cq)}else{cm=false}if(b1==true){bK.style.visibility="hidden" }if(cm){cm=false;try{cn.Changed()}catch(cp){c(Q+".getSelection().Changed",-1,"\n"+cn.Changed,cp.message,cp)}if(ca()&&T(Q+"_mtl")!=5&&T(Q+"_mtr")!=5){aq("RubberBand")}}document.onmousemove=null;document.onmouseup=null;if(V==1){window.parent.document.onmousemove=null;window.parent.document.onmouseup=null}return false}function bm(cq){if(bl&&b6){return false}bY(cq);bf();bk("hidden");if(b3.Width>1&&b3.Height>1){l(b3)}if(cm){cm=false;try{cn.Changed()}catch(cp){c(Q+".getSelection().Changed",-1,"\n"+cn.Changed,cp.message,cp)}if(ca()){aq("RubberBand")}}return false}function bz(){if(be==0){bx.style.border="1px dashed #"+cd();b2.style.border="1px solid #"+bR();be=1}else{bx.style.border="1px dashed #"+bR();b2.style.border="1px solid #"+cd();be=0}if(ce==true){setTimeout(bz,75)}else{bx.style.border="1px dashed #"+bR();b2.style.border="1px solid #"+cd()}}}};