var atalaWebThumbnailViewerChildLoaded=true;var atalaWebThumbnailViewerChildVersion="9.0";var atalaShowErrors=parent.atalaShowErrors;var _child=new atalaWebThumbnailViewerChild(atalaId);var _clipper=null;var initTries=0;Atalasoft.Controls.MouseToolController=__MTcontroller;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=atalaDispose;function atalaDispose(){if(_child!=null){_child.Dispose();_child=null}}function atalaWebThumbnailViewerChild(B){this.typeOf="atalaWebThumbnailViewerChild";var bq=B;var ah;var r;var aN;var x=false;var a6=this;var bf=null;var M=document.body;var bb=0;var a9=0;var bD=0;var bC=0;var l;var ao=0;var q=0;var e=0; var bH=0;var bF=0;var bz=2;var bw=2;var a8=30;var bB=0;var bE=0;var g="";var bG=1;var al=30;var au=1000;var bA=0;var f=0;var bn;var bt=false;var aa=0;var ac=-1;var aJ=new Array();var a5;var bj=new atalaSize(0,0);var K=null;var N=null;var ad=Atalasoft.Utils.getBrowserType();var b=null;var I="";var V=false;var E=false;var aB=new Array();var R;function at(bI){if(R==null){R=window.open("","atalaTraceLog")}R.document.writeln(bq+": "+bI+"
")}var aY=at;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.ThumbnailClicked=function(){};this.ThumbnailDoubleClicked=function(){};this.ThumbnailMouseDown=function(){};this.ThumbnailMouseDownLeft=function(){};this.ThumbnailMouseDownRight=function(){};this.ThumbnailMouseMove=function(){}; this.ThumbnailMouseOut=function(){};this.ThumbnailMouseOver=function(){};this.ThumbnailMouseUp=function(){};this.ThumbnailRightClicked=function(){};this.OnLoad=function(){};this.ScrollPositionChanged=function(){};this.ZoomChanged=function(){};function bh(bN,bJ,bM,bL,bI){var bK=Atalasoft.Event.Throw(bN,bJ,bM,bL,bI);aG("OnError",bK)}this.FireEvent=aG;function aG(bI,bK,bJ){if(bK==null){bK=new Object()}bK.name=bI;bK.index=bJ;return Atalasoft.Event.Fire(window.parent[bq],bI,bK)}this.FireChildEvent=af;function af(bI,bJ){return Atalasoft.Event.Fire(a6,bI,bJ)}function i(bI){if(!V){V=true;aG("DoServerDragDrop",bI,-1)}else{bh("ServerDropEvent","failed, unable to send the server request at this time","Drag-drop from index "+bI.dragIndex+" to index "+bI.dropIndex,"The server has not responded to the previous drop event.",bI)}}this.ServerDragDropCallback=t;function t(){V=false}this.getFormValue=ba;function ba(bI){return Atalasoft.Forms.getValue(N,bq+bI)}this.getFormValueInt=p;function p(bI){return Atalasoft.Forms.getValueInt(N,bq+bI) }this.getFormValueFloat=a1;function a1(bI){return Atalasoft.Forms.getValueFloat(N,bq+bI)}this.setFormValue=ap;function ap(bJ,bI){Atalasoft.Forms.setValue(N,bq+bJ,bI)}function bx(bK){var bI=new Array();for(var bJ=1;bJ=0&&aN.indexOf("http")<0){var bJ=document.URL.substring(0,document.URL.lastIndexOf("/")+1);var bM=document.location.protocol+"//"; var bK=document.location.hostname;var bI=(document.location.port)?":"+document.location.port:"";var bL=document.location.pathname;if(aN.indexOf("/")==0){aN=bM+bK+bI+aN}else{if(r==""){aN=bM+bK+bI+bL+aN}else{aN=bJ+aN}}}m();if(ad==0){bf=k(1,1)}else{bf=document.createElement("div")}bf.style.position="absolute";bf.style.zIndex="0";bf.style.left="0px";bf.style.top="0px";bf.style.width="1px";bf.style.height="1px";bf.style.visibility="visible";_clipper=ag();M.appendChild(_clipper);_clipper.appendChild(bf);if(bx("getAllowDragDrop")==true){b=d()}document.onkeydown=aw;document.onkeyup=U;document.onkeypress=av;document.onselectstart=__rf;K=new Atalasoft.Controls.MouseToolController(_clipper,a6);x=true;aW();return true}this.Load=ak;function ak(bI){H(bI)}this.Update=H;function H(bM){var bL=bx("getScrollPosition");var bJ=bx("getUrl");var bI=bx("getSelectedIndexes");bA=bx("getImageDisplayOrder");bF=bx("getCount");bz=bx("getThumbPadding");bw=bx("getThumbSpacing");bE=bx("getFlowDirection");bB=bx("getLayout"); I=bx("getThumbCaptionFormat");aa=Math.round(Math.random()*100000000);aS();T();for(var bK=0;bKbD+aA()-1-bw){bI=bD+aA()-1-bw}if(bIbC+a3()-1-bw){bI=bC+a3()-1-bw }if(bI0&&bw>0){bI+=bw*(q+1)}return bI}function a3(){var bI=e*ao;if(ao>0&&bw>0){bI+=bw*(ao+1)}return bI}function aW(){try{C("div.normal",ba("_tsn"));C("div.hover",ba("_tsh"));C("div.selected",ba("_tss"));C("div.selectedhover",ba("_tsc"))}catch(bI){bh("WebThumbnailViewerChild","","Adding thumb styles failed.",bI.message,bI)}}function C(bI,bJ){Atalasoft.Style.AddRule(bI,bJ)}this.resetScrollBars=m;function m(){var bI=bx("getScrollBarVisibility");if((S()==0||z()==0)&&bI!=1){if(ad!=2){M.style.overflow="hidden";var bK=aC();M.style.overflow="scroll";var bJ=aC();D(bK.Width-bJ.Width,bK.Height-bJ.Height);delete bK;delete bJ}else{D(15,15)}}switch(bI){default:case 0:M.style.overflow="auto";break;case 1:M.style.overflow="hidden";break;case 2:M.style.overflow="scroll";break}}this.MouseTool=T;function T(){var bL=bx("getMouseToolLeft");var bJ=bx("getMouseToolRight");var bK=bx("getMouseToolCursor");var bI=bx("getMouseToolCustomCursor"); K.setTool(bL,bJ);K.setCustomCursor(bI);K.setCursor(bK)}this.setBackColor=a4;function a4(bI){if(bI.indexOf("#")==-1){bI="#"+bI}M.style.background=bI}this.Center=c;function c(){if(bx("getCentered")==true){var bJ=P();var bI=aA();var bK=a3();if(bJ.Width>bI&&bB==0){if(bJ.Height>bK){bD=Math.round((bJ.Width-bI)/2)}else{bD=Math.max(Math.round((bJ.Width-bj.Width-bI)/2),0)}}else{bD=0}if(bJ.Height>bK&&bB==1){if(bJ.Width>bI){bC=Math.round((bJ.Height-bK)/2)}else{bC=Math.max(Math.round((bJ.Height-bj.Height-bK)/2),0)}}else{bC=0}}}this.PauseRefresh=X;function X(){f++}this.ResumeRefresh=o;function o(){if(f==0){bh("ResumeRefresh","","refresh has already resumed.","PauseRefresh() must be called before ResumeRefresh().")}else{f--}bc()}this.Invalidate=am;function am(){bs();F()}function O(){window.onscroll=null;window.onresize=null}function J(){window.onscroll=bs;window.onresize=F}function a2(){O();l=new Array();for(var bI=0;bIbF)?bF:(bI+a8);if(bI){setTimeout("_child.createThumbBatch("+bI+", "+bJ+");",10*(bI/a8)) }else{aZ(bI,bJ)}}}this.createThumbBatch=aZ;function aZ(bI,bK){for(var bJ=bI;bJ=0&&l[bK]._caption){l[bK]._caption.innerHTML=I.replace("{0}",(bK+1));l[bK]._caption.title=l[bK]._caption.innerHTML}}}function n(bI){if(bo>0){return }if(!bI){bd()}switch(bA){case 0:for(var bJ=0;bJl.length){bI=l.length }else{if(bI<0){bI=0}}l.splice(bI,0,bJ)}function br(bI,bM){var bJ=0;var bK=Math.floor((bI-bD)/(bH+bw));var bL=Math.floor((bM-bC)/(e+bw));switch(bE){case 0:bJ=bK+bL*q;break;case 1:bJ=bL+bK*ao;break}bJ=Math.min(bJ,bF-1);return bJ}function aS(){var bI=bx("getThumbSize");bH=Math.round(bI.Width*bG)+(bz*2);e=Math.round(bI.Height*bG)+(bz*2)}function be(b1){var bU=document.createElement("div");bU.className="normal";bU.style.position="absolute";bU.style.visibility="visible";bU.style.overflow="hidden";bU.style.backgroundRepeat="no-repeat";bU.style.backgroundPosition="center";bU.style.backgroundImage='url("'+aN+'ajax-loader_drk.gif")';bU.style.zIndex="1";bU.v=false;bU._cp={X:0,Y:0};bU._mp={X:0,Y:0};bU._i=b1;bU._imgInfo=new Object();if(b!=null){bT=bQ}bU.onclick=b3;bU.oncontextmenu=bN;bU.ondblclick=bZ;bU.onmousedown=bR;bU.onmousemove=bW;bU.onmouseout=bX;bU.onmouseover=b0;bU.onmouseup=bL;_clipper.appendChild(bU);function bJ(b7){Atalasoft.Utils.getMousePosition(b7,bU._cp);bU._cp.X=bU._cp.X-parseInt(bU.style.left); bU._cp.Y=bU._cp.Y-parseInt(bU.style.top)}function bK(){var b7=parseInt(bU.style.left)+Math.round(bH/2);var b9=parseInt(bU.style.top)+Math.round(e/2);var b8=br(aX(b7),aU(b9));return b8}function b3(b9){if(b9==null){b9=bU.ownerDocument.parentWindow.event}if(a6.ThumbnailClicked(b9)!=false){if(b9.shiftKey==true){var b7=(aJ.length>0)?aJ[0]:0;aj();if(b7>bU._i){for(var b8=b7;b8>=bU._i;b8--){ar(b8,false,true,false)}}else{if(b7<=b1){for(var b8=b7;b8<=bU._i;b8++){ar(b8,false,true,false)}}}}else{ar(bU._i,false,(b9.ctrlKey==true),true)}}aG("ThumbnailClicked",b9,bU._i)}function bN(b7){if(b7==null){b7=bU.ownerDocument.parentWindow.event}aG("ThumbnailRightClicked",b7,bU._i);return false}function bZ(b7){if(b7==null){b7=event}aG("ThumbnailDoubleClicked",b7,bU._i)}function bR(b7){if(b7==null){b7=bU.ownerDocument.parentWindow.event}if(b7.button==2){aG("ThumbnailMouseDownRight",b7,bU._i);bV(b7)}else{aG("ThumbnailMouseDownLeft",b7,bU._i);bO(b7)}aG("ThumbnailMouseDown",b7,bU._i);bT(b7);return false}function bW(b7){if(b7==null){b7=bU.ownerDocument.parentWindow.event }aG("ThumbnailMouseMove",b7,bU._i);b2(b7)}function b0(b7){if(b7==null){b7=bU.ownerDocument.parentWindow.event}if(a6.ThumbnailMouseOver(b7)!=false){if(a(aJ,bU._i)){bU.className="selectedhover"}else{bU.className="hover"}}aG("ThumbnailMouseOver",b7,bU._i)}function bX(b7){if(b7==null){b7=bU.ownerDocument.parentWindow.event}if(a6.ThumbnailMouseOut(b7)!=false){if(a(aJ,bU._i)){bU.className="selected"}else{bU.className="normal"}}aG("ThumbnailMouseOut",b7,bU._i);b5(b7)}function bL(b7){if(b7==null){b7=bU.ownerDocument.parentWindow.event}aG("ThumbnailMouseUp",b7,bU._i);bY(b7)}function bT(b7){}function bO(b7){}function bV(b7){}function b2(b7){}function b5(b7){}function bY(b7){}function bQ(b7){if(b7==null){b7=bU.ownerDocument.parentWindow.event}bJ(b7);bU.style.zIndex="100";bU.style.opacity=".65";bU.style.filter="alpha(opacity="+((0.65)*100)+")";b2=bS;bY=bM;if(aB.length>0){b5=bI}return false}function bS(b9){if(b9==null){b9=bU.ownerDocument.parentWindow.event}Atalasoft.Utils.getMousePosition(b9,bU._mp); var b8=bU._mp.X-bU._cp.X;var b7=bU._mp.Y-bU._cp.Y;if(bU.ownerDocument==document){bP(b8,b7)}else{b6(b8,b7)}return false}function b6(b8,b7){bU.style.left=(b8)+"px";bU.style.top=(b7)+"px"}function bP(cc,cb){var ca=0;var b8=0;if(cc>=0&&(cc+bH-bb+bD+a5.Width){ca=(cc+bH)-(-bb+bD+a5.Width)}}}if(cb>=0&&(cb+e-a9+bC+a5.Height){b8=(cb+e)-(-a9+bC+a5.Height)}}}if(ca!=0||b8!=0){aF(ca,b8)}if(b!=null){var cd=bK();if(cd>bU._i){cd++}var b9=(cd==bU._i)?cd+1:cd;var b7=(b9-1==bU._i)?b9-2:b9-1;if(b91){b.r.style.left=l[b9].style.left;b.r.style.top=l[b9].style.top;b.r.style.visibility="visible"}else{b.b.style.left=l[b9].style.left;b.b.style.top=l[b9].style.top;b.b.style.visibility="visible"}}else{b.r.style.visibility="hidden";b.b.style.visibility="hidden"}if(b7>=0){if(q>1){b.l.style.left=(parseInt(l[b7].style.left)+parseInt(l[b7].style.width)-parseInt(b.l.style.width))+"px"; b.l.style.top=l[b7].style.top;b.l.style.visibility="visible"}else{b.t.style.left=l[b7].style.left;b.t.style.top=(parseInt(l[b7].style.top)+parseInt(l[b7].style.height)-parseInt(b.t.style.height))+"px";b.t.style.visibility="visible"}}else{b.l.style.visibility="hidden";b.t.style.visibility="hidden"}}}function bM(b7){b2=function(b8){};bY=function(b8){};b5=function(b8){};bU.style.zIndex="1";bU.style.opacity="";bU.style.filter="";if(b!=null){b.l.style.visibility="hidden";b.r.style.visibility="hidden";b.t.style.visibility="hidden";b.b.style.visibility="hidden"}b7.dragIndex=bU._i;b7.dropIndex=bK();if(b7.dragIndex!=b7.dropIndex){aj()}bk(b7.dragIndex,b7.dropIndex);if(b7.dragIndex!=b7.dropIndex){bU.onclick=b4;if(aG("ThumbnailDrop",b7,bU._i)!=false){i(b7)}}return false}function b4(b7){if(b7==null){b7=bU.ownerDocument.parentWindow.event}bU.onclick=b3;return false}function bI(b8){if(b8==null){b8=bU.ownerDocument.parentWindow.event}var b7=window.parent[bq];if(b7.DragObjectToParent){var b9=b7.DragObjectToParent(bU); if(b9!=bU){Atalasoft.DOM.Dispose(bU);bU=b9}}bU.style.position="absolute";if(ad==2||ad==4){if(!bU._cp){bU._cp={X:0,Y:0}}if(!bU._mp){bU._mp={X:0,Y:0}}}Atalasoft.Utils.getMousePosition(b8,bU._cp);b6((bU._cp.X-Math.round(bU.clientWidth/2)),(bU._cp.Y-Math.round(bU.clientHeight/2)));bJ(b8);bS(b8)}return bU}function az(bI){if(l[bI]&&(!l[bI].v||(l[bI].v&&l[bI].z!=bG))){aK(bI);l[bI].v=true;l[bI].z=bG}}this.ScrollToThumb=ab;function ab(bJ){if(bJ>=0&&bJ0){bT=document.createElement("div");bT.style.visibility="hidden";bT.innerHTML=bR;bJ.appendChild(bT);bJ.title=bR;bJ._caption=bT}bP();function bI(bX){if(bN.width>0&&bN.height>0&&bK){var bV;var bW;if(bK.fitW){bV=Math.round(bO.Width*bX);bW=Math.round(bV/bK.ratio)}else{bW=Math.round(bO.Height*bX);bV=Math.round(bK.ratio*bW)}bN.style.width=bV+"px";bN.style.height=bW+"px";bQ()}}function bQ(){bN.style.marginLeft=Math.round(-parseInt(bN.style.width)/2)+"px";bN.style.marginTop=Math.round(-parseInt(bN.style.height)/2)+"px"}function bP(){if(bN.complete){if(bN.style.visibility=="hidden"){bL()}}else{bU+=Math.round(bU/2);if(bU<30000){setTimeout(bP,bU)}else{}}}function bL(){if(bK){bK.width=bN.width;bK.height=bN.height;bK.ratio=bN.width/bN.height;bK.fitW=(bN.width/bO.Width>=bN.height/bO.Height)}bJ.scaleImg=bI;bN.style.position="absolute";bN.style.width=bN.width+"px";bN.style.height=bN.height+"px";bQ();bN.style.top="50%";bN.style.left="50%"; bN.style.visibility="visible";if(bT!=null){var bX=bx("getThumbPadding");bT.style.position="absolute";bT.style.width="94%";bT.style.overflow="hidden";bT.style.left="3%";bT.style.bottom=0;bT.style.textAlign="center";bT.style.visibility="visible"}if(bJ._img==bN&&bJ._caption==bT){bJ.style.backgroundImage='url("'+aN+'spacer.gif")';for(var bV=bJ.childNodes.length-1;bV>=0;bV--){var bW=bJ.childNodes[bV];if(bW!=bN&&bW!=bT){bJ.removeChild(bW)}bW=null}aG("ThumbnailLoaded",null,bM)}else{if(bN&&bN.style){bN.style.visibility="hidden"}if(bT&&bT.style){bT.style.visibility="hidden"}}}}this.SelectThumb=ar;function ar(bK,bL,bJ,bI){if(l==null){bh("SelectThumb",0,bK,"There are no thumbnails to select.");return}if(bK>bF||bK<-1){bh("SelectThumb",3,bK,"Valid values are either -1 (to select none) or between 0 and the number of thumbs - 1.");return}if(bx("getAllowMultiSelect")&&bJ==true){if(bK==-1){aj()}else{if(a(aJ,bK)){if(bI==true){aP(bK)}else{return}}else{aO(bK)}}}else{if(bK!=ac||bL==true){aj();aO(bK);bx("OpenSelected",bK) }else{if(bK==ac&&aJ.length>1){aj();aO(bK)}else{return}}}aM(ac);a7(Atalasoft.JSON.ArrayToJSONString(aJ));aG("SelectedIndexChanged")}function aO(bI){if(bI=0){Q(bI,true);aJ.push(bI)}ac=bI}}function Q(bJ,bI){if(l&&bJ0){aP(aJ[0])}aJ=new Array()}function aP(bI){if(bI>=0){Q(bI,false);h(aJ,bI);if(aJ.length==0){ac=-1}else{ac=aJ[aJ.length-1]}}}function h(bI,bJ){if(bI!=null){for(var bK=0;bKa5.Width){a5.Height+=bj.Height}if(document.body.scrollHeight>a5.Height){a5.Width+=bj.Width}}}}return a5}this.getZoom=A;function A(){return bG}var bo=0;this.setZoom=bv;function bv(bM,bL){if(!bL){var bN=aC();bL=new atalaPoint((-bb+Math.round(bN.Width/2)),(-a9+Math.round(bN.Height/2)))}var bK=null;var bJ=0;var bI=0;if(l&&l.length>0){bK=l[br(bL.X,bL.Y)];bJ=Math.round(((bL.X-parseInt(bK.style.left))/bG)*bM); bI=Math.round(((bL.Y-parseInt(bK.style.top))/bG)*bM)}bG=bM;aS();aq();c();bm();j();if(bK!=null){bL.X=parseInt(bK.style.left)+bJ;bL.Y=parseInt(bK.style.top)+bI;aV(bL.X,bL.Y)}bd()}this.setZoomDelay=aI;function aI(bI){if(bI>=0&&bI<=10000){au=bI}}this.getZoomPercentage=v;function v(){return al}this.getScrollSize=G;function G(){var bI=new atalaSize(aA(),a3());return bI}this.getTraySize=W;function W(){var bI=bx("getThumbSize");bI.Width=(bI.Width+(bz*2))*q;bI.Height=(bI.Height+(bz*2))*ao;if(q>0&&bw>0){bI.Width+=bw*(q+1)}if(ao>0&&bw>0){bI.Height+=bw*(ao+1)}return bI}this.getTrayOffsetPoint=Y;function Y(){return new atalaPoint(bD,bC)}this.ZoomToRectangle=aL;function aL(bJ,bP,bK,bL){if(bJ.typeOf=="atalaRectangle"){bP=bJ.Y;bK=bJ.Width;bL=bJ.Height;bJ=bJ.X}var bM;var bO=aC();var bI=0;var bN=0;if(bO.Width/bK<=bO.Height/bL){bM=bG*(bO.Width/bK);bI=-Math.round(bJ/bG*bM);bN=-Math.round((bP/bG*bM)-(bO.Height-bL/bG*bM)/2)}else{bM=bG*(vps.Height/bL);bI=-Math.round((bJ/bG*bM)-(bO.Width-bK/bG*bM)/2);bN=-Math.round(bP/bG*bM) }bx("setZoom",bM);bx("setScrollPosition",bI,bN)}this.Focus=an;function an(){window.focus()}}function __MTcontroller(z,x){if(!z||!x){Atalasoft.Event.Throw("Atalasoft.Controls.MouseToolController",0,null,"MouseToolController requires a DOM object and a viewer child object passed in as input.");return false}var m=this;var r=z;var S=x;var b=null;var f=null;var s=null;var B=false;var o=false;var w=0;var F="";var N=Atalasoft.Utils.getBrowserType();var e=MouseToolType.None;var T=MouseToolType.None;var u=null;var J="";q();function q(){if(navigator.userAgent.indexOf("MSIE 5.5")>0){B=true}if(S.getResourcePath){F=S.getResourcePath()}document.ondragstart=__rf;document.onselectstart=__rf;document.onfocus=__rf;if(r!=document){r.ondragstart=__rf;r.onselectstart=__rf;r.onfocus=__rf}C();r.onclick=t;r.oncontextmenu=V;r.ondblclick=p;r.onmousedown=H;r.onmousemove=L;r.onmouseout=K;r.onmouseover=k;r.onmouseup=l}this.Dispose=h;function h(){if(r!=null){r.onclick=null;r.oncontextmenu=null;r.ondblclick=null;r.onmousedown=null; r.onmousemove=null;r.onmouseout=null;r.onmouseover=null;r.onmouseup=null;r=null}if(b!=null){b.Dispose();b=null}document.ondragstart=null;document.onselectstart=null;document.onfocus=null;S=null;f=null;s=null;m=null}function C(){g=__rf;v=__rf;j=__rf;X=__rf;U=__rf;if(S.ThumbnailClicked){S.ThumbnailClicked=function(){};S.ThumbnailMouseOver=function(){}}}function c(Y,aa,Z){if(S.FireEvent){return S.FireEvent(Y,aa,Z)}}function t(Y){Y=(Y==null)?event:Y;if(S.Clicked(Y)!=false){c("Clicked",Y);return g(Y)}else{return false}}function V(Y){Y=(Y==null)?event:Y;if(S.RightClicked(Y)!=false){c("RightClicked",Y);return v(Y)}else{return false}}function p(Y){Y=(Y==null)?event:Y;if(S.DoubleClicked(Y)!=false){c("DoubleClicked",Y);return}else{return false}}function H(Y){Y=(Y==null)?event:Y;if(Y.button==2){if(S.MouseDownRight(Y)!=false){c("MouseDownRight",Y);U(Y)}else{return false}}else{if(S.MouseDownLeft(Y)!=false){c("MouseDownLeft",Y);X(Y)}else{return false}}if(S.MouseDown(Y)!=false){c("MouseDown",Y);return j(Y) }else{return false}}function g(Y){}function v(Y){}function j(Y){}function X(Y){}function U(Y){}function L(Y){Y=(Y==null)?event:Y;if(S.MouseMove(Y)!=false){c("MouseMove",Y);return}else{return false}}function K(Y){Y=(Y==null)?event:Y;c("MouseOut",Y)}function k(Y){Y=(Y==null)?event:Y;c("MouseOver",Y)}function l(Y){Y=(Y==null)?event:Y;if(S.MouseUp(Y)!=false){c("MouseUp",Y);return}else{return false}}function P(Z,Y){return Atalasoft.Utils.getMousePosition(Z,Y)}this.setToolLeft=W;function W(Y){O(Y,T)}this.setToolRight=i;function i(Y){O(e,Y)}this.setTool=O;function O(Z,Y){e=Z;T=Y;C();if(b==null&&e==2||e==5||T==2||T==5){b=new y()}switch(e){case 0:g=__rf;a(MouseToolCursor.Arrow);break;case 1:g=I;a(MouseToolCursor.Hand);break;case 2:X=b.startSelect;a(MouseToolCursor.Crosshair);break;case 3:g=n;a(MouseToolCursor.ZoomIn);break;case 4:g=d;a(MouseToolCursor.ZoomOut);break;case 5:X=b.startSelect;a(MouseToolCursor.Crosshair);break;case 6:X=R;a(MouseToolCursor.Move);break;case 7:g=__rt;a(MouseToolCursor.Hand); break}switch(T){case 0:break;case 1:v=I;break;case 2:U=b.startSelect;break;case 3:v=n;break;case 4:v=d;break;case 5:U=b.startSelect;break;case 6:U=R;break;case 7:v=__rt;break}}this.setCursor=a;function a(Y){u=Y;var Z=(F=="")?"?atalacsr=":F;switch(Y){case MouseToolCursor.Auto:break;case MouseToolCursor.Arrow:r.style.cursor="default";break;case MouseToolCursor.Crosshair:r.style.cursor="crosshair";break;case MouseToolCursor.Grab:r.style.cursor=(N==1)?"-moz-grab":"hand";break;case MouseToolCursor.Hand:r.style.cursor=(B)?"hand":"pointer";break;case MouseToolCursor.Move:r.style.cursor="move";break;case MouseToolCursor.ZoomIn:if(N==1){r.style.cursor="-moz-zoom-in"}else{r.style.cursor=(B)?"hand":'url("'+Z+'ZoomIn.cur")'}break;case MouseToolCursor.ZoomOut:if(N==1){r.style.cursor="-moz-zoom-out"}else{r.style.cursor=(B)?"hand":'url("'+Z+'ZoomOut.cur")'}break;case MouseToolCursor.Custom:if(J!=""){r.style.cursor=J}break}}this.setCustomCursor=D;function D(Y){J=Y}function I(Z){var Y=P(Z);S.CenterOnPoint(Y.X,Y.Y); return false}function n(Y){G(Y,false);return false}function d(Y){G(Y,true);return false}function G(ac,Z){var ab=P(ac);var aa=S.getZoomPercentage();var Y=S.getZoom();var ad;if(Z){ad=Y-Y*(aa/100)}else{ad=Y+Y*(aa/100)}S.setZoom(ad,ab);return false}function R(Y){f=new atalaPoint(0,0);s=new atalaPoint(0,0);if(N==0){f.X=event.screenX;f.Y=event.screenY}else{f.X=Y.screenX;f.Y=Y.screenY}s.X=f.X;s.Y=f.Y;document.onmousemove=Q;document.onmouseup=E;document.onselectstart=__rf;document.ondrag=__rf;if(S.ThumbnailClicked){S.ThumbnailClicked=function(){}}return false}function Q(Y){if(S.ThumbnailClicked){S.ThumbnailClicked=__rf;S.ThumbnailMouseOver=__rf}A(Y);document.onmousemove=A}function A(Y){if(N==0){window.scrollBy(f.X-event.screenX,f.Y-event.screenY);f.X=event.screenX;f.Y=event.screenY}else{window.scrollBy(f.X-Y.screenX,f.Y-Y.screenY);f.X=Y.screenX;f.Y=Y.screenY}return false}function E(Y){document.onmousemove=function(){};document.onmouseup=function(){};if(S.ThumbnailClicked){S.ThumbnailMouseOver=function(){} }return false}this.getSelection=M;function M(){return b}function y(){this.typeOf="atalaRubberBand";var by=this;var aZ;var bp=false;var a9=false;var bh=false;var an=0;var az=new atalaPoint(0,0);var aH;var bc;var aA;var aU;var bt;var aF;var aN;var aD;var bd;var aV;var bb;var a2;var aS;var av;var af;var be;var ab;var aC;var bx=false;this.Changing=function(){};this.Changed=function(){};al();function al(){ah();aH=bq();bc=bq();aH.insertRow(0);aH.rows[0].insertCell(0);bc.insertRow(0);bc.rows[0].insertCell(0);bt=aB();aF=aB();aN=aB();aD=aB();aU=document.createElement("div");aU.style.fontFamily="Arial, helvetica, san-serif";aU.style.fontSize="8pt";aU.style.padding="1px";aU.style.backgroundColor="#FFFFE1";aU.style.border="1px solid #000000";aU.style.position="absolute";aU.style.visibility="hidden";aU.style.zIndex="100001";r.appendChild(bc);r.appendChild(aH);r.appendChild(aU);r.appendChild(bt);r.appendChild(aF);r.appendChild(aN);r.appendChild(aD);aA=new a3();aI();if(bk()){a0()}else{ao()}if(aM()==true&&Z()==true){aJ() }}this.Dispose=ag;function ag(){if(aA!=null){aA.Dispose();aA=null}by=null;aZ=null;az=null;aH=null;bc=null;bd=null;aV=null;aU=null;bt=null;aF=null;aN=null;aD=null}function ah(){aZ=Atalasoft.DOM.getBoundsRect(r);aV=S.getScrollSize();a9=bk();a2=aj();bd=a4();bb=aa();bp=aM();aS=ai();af=bf();av=aY();be=S.getTrayOffsetPoint()}function a3(){var bJ=new Array("move","nw","n","ne","w","e","sw","s","se");var bH=new Array();var bN=false;var bE=new Array();var bF=0;var bB=0;for(var bG=0;bG<9;bG++){bH[bG]=new bK(bG);r.appendChild(bH[bG].grip)}this.Dispose=bD;function bD(){for(var bQ=0;bQ<9;bQ++){bH[bQ].Dispose();bH[bQ]=null}bJ=null;bH=null;bN=null;bE=null}bO();this.setRectangle=bI;function bI(bQ,bT,bR,bS){bF=bR;bB=bS;bH[0].setPos(bQ,bT);bH[1].setPos(bQ-4,bT-4);bH[3].setPos(bQ+bR-4,bT-4);bH[6].setPos(bQ-4,bT+bS-4);bH[8].setPos(bQ+bR-4,bT+bS-4);bH[0].setSize(bR,bS);if(a2){bH[2].setPos(bQ+Math.round(bR/2)-4,bT-4);bH[4].setPos(bQ-4,bT+Math.round(bS/2)-4);bH[5].setPos(bQ+bR-4,bT+Math.round(bS/2)-4);bH[7].setPos(bQ+Math.round(bR/2)-4,bT+bS-4) }else{bH[2].setPos(bQ+4,bT-4);bH[4].setPos(bQ-4,bT+4);bH[5].setPos(bQ+bR-4,bT+4);bH[7].setPos(bQ+4,bT+bS-4);bH[2].setSize(bR-8,8);bH[4].setSize(8,bS-8);bH[5].setSize(8,bS-8);bH[7].setSize(bR-8,8)}bA()}this.resetColors=bM;function bM(){for(var bQ=0;bQ<9;bQ++){bH[bQ].resetColors()}}this.resetGrips=bL;function bL(){for(var bQ=0;bQ<9;bQ++){bH[bQ].resetGripSize();bH[bQ].resetColors()}}this.hide=bP;function bP(){for(var bQ=0;bQ<9;bQ++){bH[bQ].hide()}}this.show=bC;function bC(){for(var bQ=0;bQ<9;bQ++){if(bE[bQ]==true){bH[bQ].show()}else{bH[bQ].hide()}}}this.showGrips=bA;function bA(){for(var bQ=0;bQ<9;bQ++){bE[bQ]=true}bE[0]=true;if(bF<8&&bB<8){bE[1]=false}if(bF<12||bB<12){bE[3]=false;bE[6]=false}if(bF<16||bB<8){bE[2]=false;bE[7]=false}if(bB<16||bF<8){bE[4]=false;bE[5]=false}bC()}this.resetEvents=bO;function bO(){if(aP()==true){if(av){bH[0].grip.onclick=aq}else{bH[0].grip.onmousedown=aq}bH[0].grip.style.cursor="move"}else{bH[0].grip.onmousedown=__rf;bH[0].grip.style.cursor="default"}for(var bQ=1; bQ<9;bQ++){if(ap()==true){if(av){bH[bQ].grip.onclick=bH[bQ].onResize}else{bH[bQ].grip.onmousedown=bH[bQ].onResize}bH[bQ].grip.style.cursor=bJ[bQ]+"-resize"}else{bH[bQ].grip.onmousedown=__rf;bH[bQ].grip.style.cursor="default"}}}function bK(bV){var b2=this;var b0;var bY;var bU=bJ[bV];var bX=false;if(N==0){b0=S.createSpacer(1,1)}else{b0=document.createElement("div")}bY=b0.style;bR();bQ();this.grip=b0;bY.display="block";bY.position="absolute";bY.visibility="hidden";bY.zIndex="100012";b0.onclick=__rf;b0.onselectstart=__rf;b0.onselect=__rf;b0.oncontextmenu=__rf;this.Dispose=bT;function bT(){b2=null;b0=null;bY=null;bU=null}this.setPos=bW;function bW(b4,b5){bY.left=b4+"px";bY.top=b5+"px"}this.setSize=b1;function b1(b4,b5){if(aj()==true&&bU!="move"){b4-=2;b5-=2}if(b4<=0){b4=1}if(b5<=0){b5=1}bY.width=b4+"px";bY.height=b5+"px"}this.hide=b3;function b3(){if(bX){bY.visibility="hidden";bX=false}}this.show=bS;function bS(){if(!bX){bY.visibility="visible";bX=true}}this.resetColors=bR;function bR(){if(bU!="move"){if(a2==true){if(Z()==true){bY.backgroundColor="#"+bo(); bY.border="1px solid #"+a1()}else{bY.backgroundColor="#"+a1();bY.border="1px solid #"+a1()}}else{bY.backgroundColor="";bY.border=""}}}this.resetGripSize=bQ;function bQ(){if(a2==true){bY.width="6px";bY.height="6px"}else{bY.width="8px";bY.height="8px"}}this.onResize=bZ;function bZ(b4){return aG(b4,bU)}}}function bq(){var bA=document.createElement("table");bA.border="0";bA.cellPadding="0";bA.cellSpacing="0";bA.style.position="absolute";bA.style.visibility="hidden";bA.style.zIndex="100001";return bA}function aB(){var bB=F;if(bB==""){bB="?atalaimg="}var bA=Atalasoft.DOM.CreateMask(bB+"mask.png");bA.style.left="0px";bA.style.top="0px";bA.style.width="1px";bA.style.height="1px";bA.style.position="absolute";bA.style.visibility="hidden";bA.style.zIndex="100000";bA.appendChild(S.createSpacer(1,1));return bA}this.getAnimated=aM;function aM(){if(S.getFormValue("_rsa").toLowerCase()=="true"){return true}else{return false}}this.getAspectRatio=ai;function ai(){return S.getFormValueFloat("_rsar")}this.getAutoPostBack=bl; function bl(){if(S.getFormValue("_rsp").toLowerCase()=="true"){return true}else{return false}}this.getBackColor=bo;function bo(){return S.getFormValue("_rsbc")}this.getClickLock=aY;function aY(){if(S.getFormValue("_rscl").toLowerCase()=="true"){return true}else{return false}}this.getDrawMask=bf;function bf(){if(S.getFormValue("_rsdm").toLowerCase()=="true"){return true}else{return false}}this.getForeColor=a1;function a1(){return S.getFormValue("_rsfc")}this.getHeight=ax;function ax(){return S.getFormValueInt("_rsh")}this.getMovable=aP;function aP(){if(S.getFormValue("_rsm").toLowerCase()=="true"){return true}else{return false}}this.getMultiColor=Z;function Z(){if(S.getFormValue("_rsmc").toLowerCase()=="true"){return true}else{return false}}this.getPosition=a7;function a7(){return new atalaPoint(S.getFormValueInt("_rsx"),S.getFormValueInt("_rsy"))}this.getResizable=ap;function ap(){if(S.getFormValue("_rsr").toLowerCase()=="true"){return true}else{return false}}this.getSize=bv;function bv(){return new atalaSize(S.getFormValueInt("_rsw"),S.getFormValueInt("_rsh")) }this.getShowGrips=aj;function aj(){if(S.getFormValue("_rsg").toLowerCase()=="true"){return true}else{return false}}this.getShowTooltip=aa;function aa(){if(S.getFormValue("_rst").toLowerCase()=="true"){return true}else{return false}}this.getVisible=bk;function bk(){if(S.getFormValue("_rsv").toLowerCase()=="true"){return true}else{return false}}this.getVisibility=at;function at(){if(bk()){return"visible"}else{return"hidden"}}this.getWidth=aO;function aO(){return S.getFormValueInt("_rsw")}this.getRectangle=ba;function ba(){return new atalaRectangle(S.getFormValueInt("_rsx"),S.getFormValueInt("_rsy"),S.getFormValueInt("_rsw"),S.getFormValueInt("_rsh"))}function a4(){var bD=a7();var bA=aO();var bB=ax();var bE=S.getZoom();var bC=new atalaRectangle(bD.X,bD.Y,bA,bB);bC.X=Math.round(bC.X*bE);bC.Y=Math.round(bC.Y*bE);bC.Width=Math.round(bC.Width*bE);bC.Height=Math.round(bC.Height*bE);return bC}this.setAnimated=am;function am(bA){if(Atalasoft.Utils.CheckBool(bA)==true){if(aM()!=bA){S.setFormValue("_rsa",bA); if(bA==true){bp=true;aJ()}else{bp=false}}}else{__throwError("Selection.setAnimated",5,bA,"")}}this.setAspectRatio=bz;function bz(bA){if(bA>=0){S.setFormValue("_rsar",bA)}}this.setAutoPostBack=Y;function Y(bA){if(Atalasoft.Utils.CheckBool(bA)==true){if(bl()!=bA){S.setFormValue("_rsp",bA);aR()}}else{__throwError("Selection.setAutoPostBack",5,bA,"")}}this.setBackColor=bi;function bi(bA){S.setFormValue("_rsbc",bA);aI()}this.setClickLock=aK;function aK(bA){if(Atalasoft.Utils.CheckBool(bA)==true){if(aY()!=bA){S.setFormValue("_rscl",bA)}}else{__throwError("Selection.setClickLock",5,bA,"")}}this.setDrawMask=aQ;function aQ(bA){if(Atalasoft.Utils.CheckBool(bA)==true){if(bf()!=bA){S.setFormValue("_rsdm",bA);aX()}}else{__throwError("Selection.setDrawMask",5,bA,"")}}this.setForeColor=aW;function aW(bA){S.setFormValue("_rsfc",bA);aI()}this.setHeight=bs;function bs(bB){if(bB>=0){var bC=ax();if(bB>_isH){bB=_isH}if(bB!=bC){S.setFormValue("_rsh",bB);if(bx){try{by.Changing()}catch(bA){__throwError(_id+".getSelection().Changing",-1,"\n"+by.Changing,bA.message,bA) }}else{try{by.Changed()}catch(bA){__throwError(_id+".getSelection().Changed",-1,"\n"+by.Changed,bA.message,bA)}if(bl()){__doPostBack("RubberBand")}}aX()}}else{__throwError("Selection.setHeight",3,bB,"Valid values are greater than or equal to 0.")}}this.setMovable=bn;function bn(bA){if(Atalasoft.Utils.CheckBool(bA)==true){if(aP()!=bA){S.setFormValue("_rsm",bA);aR()}}else{__throwError("Selection.setMovable",5,bA,"")}}this.setMultiColor=bu;function bu(bA){if(Atalasoft.Utils.CheckBool(bA)==true){S.setFormValue("_rsmc",bA);aI()}else{__throwError("Selection.setMultiColor",5,bA,"")}}this.setPosition=aL;function aL(bA){if(bA.typeOf=="atalaPoint"){ad(bA.X,bA.Y)}else{__throwError("Selection.setPosition",4,bA.typeOf,"atalaPoint expected.")}}function ad(bA,bD){if(bA>=0&&bD>=0){var bC=S.getZoom();S.setFormValue("_rsx",bA);S.setFormValue("_rsy",bD);bd.X=Math.round(bA*bC);bd.Y=Math.round(bD*bC);if(bx){try{by.Changing()}catch(bB){__throwError(_id+".getSelection().Changing",-1,"\n"+by.Changing,bB.message,bB) }}else{aE();try{by.Changed()}catch(bB){__throwError(_id+".getSelection().Changed",-1,"\n"+by.Changed,bB.message,bB)}if(bl()){__doPostBack("RubberBand")}}}else{__throwError("Selection.setSize",3,bA+"x"+bD,"Position must be at least 0x0.")}}this.setResizable=ac;function ac(bA){if(Atalasoft.Utils.CheckBool(bA)==true){if(ap()!=bA){S.setFormValue("_rsr",bA);aR()}}else{__throwError("Selection.setResizable",5,bA,"")}}this.setSize=bg;function bg(bA){if(bA.typeOf=="atalaSize"){a5(bA.Width,bA.Height)}else{__throwError("Selection.setSize",4,bA.typeOf,"atalaSize expected.")}}function a5(bA,bD){if(bA>=0&&bD>=0){var bB=S.getFormValueInt("_rsw");var bF=S.getFormValueInt("_rsh");var bE=S.getTraySize();if(bA>bE.Width){bA=bE.Width}if(bD>bE.Height){bD=bE.Height}if(bA!=bB||bD!=bF){S.setFormValue("_rsw",bA);S.setFormValue("_rsh",bD);if(bx){try{by.Changing()}catch(bC){__throwError(_id+".getSelection().Changing",-1,"\n"+by.Changing,bC.message,bC)}}else{aX();try{by.Changed()}catch(bC){__throwError(_id+".getSelection().Changed",-1,"\n"+by.Changed,bC.message,bC) }if(bl()){__doPostBack("RubberBand")}}}}else{__throwError("Selection.setSize",3,bA+"x"+bD,"Size must be at least 0x0.")}}this.setShowGrips=bw;function bw(bA){if(Atalasoft.Utils.CheckBool(bA)==true){if(aj()!=bA){S.setFormValue("_rsg",bA);ah();aA.resetGrips();if(bA){aA.show()}else{aA.hide()}aX()}}else{__throwError("Selection.setShowGrips",5,bA,"")}}this.setShowTooltip=bm;function bm(bA){if(Atalasoft.Utils.CheckBool(bA)==true){if(aa()!=bA){S.setFormValue("_rst",bA)}}else{__throwError("Selection.setShowTooltip",5,bA,"")}}this.setVisibility=au;function au(bA){if(at()!=bA){if(bA=="visible"){S.setFormValue("_rsv",true);aX()}else{if(bA=="hidden"){S.setFormValue("_rsv",false);aX()}else{__throwError("Selection.setVisibility",3,bA,'Valid values are "hidden" or "visible".')}}}}this.setWidth=ae;function ae(bC){if(bC>=0){var bA=aO();var bD=S.getTraySize();if(bC>bD.Width){bC=bD.Width}if(bC!=bA){S.setFormValue("_rsw",bC);if(bx){try{by.Changing()}catch(bB){__throwError(_id+".getSelection().Changing",-1,"\n"+by.Changing,bB.message,bB) }}else{try{by.Changed()}catch(bB){__throwError(_id+".getSelection().Changed",-1,"\n"+by.Changed,bB.message,bB)}if(bl()){__doPostBack("RubberBand")}}aX()}}else{__throwError("Selection.setWidth",3,bC,"Valid values are greater than or equal to 0.")}}function ay(){if(!af){aN.style.visibility="hidden";aD.style.visibility="hidden";bt.style.visibility="hidden";aF.style.visibility="hidden";return}if(bd.Y>0){bt.style.left=be.X+"px";bt.style.top=be.Y+"px";bt.style.width=aZ.Width+"px";bt.style.height=bd.Y+"px";bt.style.visibility="visible"}else{bt.style.visibility="hidden"}if(bd.Y+bd.Height0){aN.style.left=be.X+"px";aN.style.top=be.Y+bd.Y+"px";aN.style.width=bd.X+"px";aN.style.height=bd.Height+"px";aN.style.visibility="visible"}else{aN.style.visibility="hidden"}if(bd.X+bd.Width=bD||bF+bd.Width>bD){bF=bD-bd.Width;if(bF<0){bF=0 }}if(bE>=bI||bE+bd.Height>bI){bE=bI-bd.Height;if(bE<0){bE=0}}if(bF!=bd.X||bE!=bd.Y){S.setFormValue("_rsx",Math.round(bF/bG));S.setFormValue("_rsy",Math.round(bE/bG));bd.X=Math.round(bF*bG);bd.Y=Math.round(bE*bG)}var bB=be.X+bd.X;var bA=be.Y+bd.Y;var bC=bd.Width;var bH=bd.Height;ar(bB,bA);br(bC,bH);aA.setRectangle(bB,bA,bC,bH);if(a9){a0();ay()}else{ao()}}function ar(bA,bB){bc.style.left=bA+"px";aH.style.left=bA+"px";bc.style.top=bB+"px";aH.style.top=bB+"px"}function br(bA,bB){if(bA==0){bA=1}bc.style.width=bA+"px";aH.style.width=bA+"px";bc.style.height=bB+"px";aH.style.height=bB+"px"}this.startSelect=bj;function bj(bB){if(av){if(bh){bh=false;return false}else{bh=true}}var bA=P(bB);ah();au("visible");az=new atalaPoint(bA.X,bA.Y);bd.X=bA.X-aZ.X-be.X;bd.Y=bA.Y-aZ.Y-be.Y;bd.Width=1;bd.Height=1;bx=true;ab=0;aC=0;aE();if(bb==true){ak()}if(S.getMouseToolLeft()==5||S.getMouseToolRight()==5){document.onmouseup=aw;if(N==1){window.parent.document.onmouseup=aw}}else{document.onmouseup=a8;if(N==1){window.parent.document.onmouseup=a8 }}document.onmousemove=aT;if(N==1){window.parent.document.onmousemove=aT}return false}function aT(bF){var bC=P(bF);var bA=az.X;var bH=az.Y;var bB=Math.abs(bC.X-az.X);var bD=Math.abs(bC.Y-az.Y);var bG=S.getZoom();if(aS>0){var bE=Math.abs((bC.Y-az.Y)/(bC.X-az.X));if(bE>1/aS&&aC==0||ab==1){bB=Math.round(bD*aS)}else{bD=Math.round(bB/aS)}}if(bC.X0){bD=Math.round(bB/aS)}bA=az.X-bB}}else{if(bA+bB>aV.Width+aZ.X){bB=aV.Width-bA+aZ.X;if(aS>0){bD=Math.round(bB/aS)}}}if(bC.Y0){bB=Math.round(bD*aS)}bH=az.Y-bD;if(bC.XaV.Height+aZ.Y){bD=aV.Height-bH+aZ.Y;if(aS>0){bB=Math.round(bD*aS)}if(bC.X0){bd.X=bA-aZ.X;bd.Width=bB}if(aC==0||aS>0){bd.Y=bH-aZ.Y;bd.Height=bD}aE();ad(Math.round(bd.X/bG),Math.round(bd.Y/bG));a5(Math.round(bd.Width/bG),Math.round(bd.Height/bG));if(bb==true){ak()}return false}function aG(bB,bC){if(av){if(bh){bh=false;return false }else{bh=true}}var bA=P(bB);ah();ab=0;aC=0;bx=true;switch(bC){case"nw":az.X=bd.X+bd.Width;az.Y=bd.Y+bd.Height;break;case"n":az.X=bd.X;az.Y=bd.Y+bd.Height;ab=1;break;case"ne":az.X=bd.X;az.Y=bd.Y+bd.Height;break;case"w":az.X=bd.X+bd.Width;az.Y=bd.Y+bd.Height;aC=1;break;case"e":az.X=bd.X;az.Y=bd.Y+bd.Height;aC=1;break;case"sw":az.X=bd.X+bd.Width;az.Y=bd.Y;break;case"s":az.X=bd.X;az.Y=bd.Y;ab=1;break;case"se":az.X=bd.X;az.Y=bd.Y;break}az.X+=be.X;az.Y+=be.Y;aE();if(bb==true){ak()}document.onmouseup=a8;document.onmousemove=aT;if(N==1){window.parent.document.onmouseup=a8;window.parent.document.onmousemove=aT}return false}function aq(bB){if(av){if(bh){bh=false;return false}else{bh=true}}var bA=P(bB);ah();bx=true;az=new atalaPoint(bA.X-bd.X,bA.Y-bd.Y);document.onmouseup=a8;document.onmousemove=a6;if(N==1){window.parent.document.onmouseup=a8;window.parent.document.onmousemove=a6}return false}function a6(bD){var bB=P(bD);var bC=new atalaPoint(0,0);var bE=S.getZoom();var bA=S.getTraySize();bC.X=Math.round((bB.X-az.X)/bE); bC.Y=Math.round((bB.Y-az.Y)/bE);if(bC.X>bA.Width-Math.round(bd.Width/bE)){bC.X=bA.Width-Math.round(bd.Width/bE)}if(bC.X<0){bC.X=0}if(bC.Y>bA.Height-Math.round(bd.Height/bE)){bC.Y=bA.Height-Math.round(bd.Height/bE)}if(bC.Y<0){bC.Y=0}aL(bC);aE();return false}function a8(bD){if(av&&bh){return false}var bC=new atalaPoint(0,0);var bB=new atalaSize(0,0);var bE=S.getZoom();bC.X=Math.round(bd.X/bE);bC.Y=Math.round(bd.Y/bE);bB.Width=Math.round(bd.Width/bE);bB.Height=Math.round(bd.Height/bE);if(bd.Width>1&&bd.Height>1){aL(bC);bg(bB)}else{bx=false}if(bb==true){aU.style.visibility="hidden"}if(bx){bx=false;try{by.Changed()}catch(bA){__throwError(_id+".getSelection().Changed",-1,"\n"+by.Changed,bA.message,bA)}if(bl()&&S.getMouseToolLeft()!=5&&S.getMouseToolRight()!=5){__doPostBack("RubberBand")}}document.onmousemove=null;document.onmouseup=null;if(N==1){window.parent.document.onmousemove=null;window.parent.document.onmouseup=null}return false}function aw(bB){if(av&&bh){return false}a8(bB);ao();au("hidden"); if(bd.Width>1&&bd.Height>1){S.ZoomToRectangle(bd)}if(bx){bx=false;try{by.Changed()}catch(bA){__throwError(_id+".getSelection().Changed",-1,"\n"+by.Changed,bA.message,bA)}if(bl()){__doPostBack("RubberBand")}}return false}function aJ(){if(an==0){aH.style.border="1px dashed #"+bo();bc.style.border="1px solid #"+a1();an=1}else{aH.style.border="1px dashed #"+a1();bc.style.border="1px solid #"+bo();an=0}if(bp==true){setTimeout(aJ,75)}else{aH.style.border="1px dashed #"+a1();bc.style.border="1px solid #"+bo()}}}};