var atalaWebImageViewerLoaded=true,atalaWebImageViewerVersion="5.0b",atalaViewers=new Array();function atalaWebImageViewer(controlID,currentPath,formID){this.typeOf='atalaWebImageViewer';var _s=this,_id=controlID,_f=document.getElementById(formID);if(_f==null){_f=document.forms[0];};var _p=currentPath,_rv=null,_span=null,_m=null,_l=null,_tbr=null,_cn=null,_vp=null,_traceLog;function __tla(s){if(_traceLog==null)_traceLog=window.open('','atalaTraceLog');_traceLog.document.writeln(_id+': '+s+'<br/>');};var __trace=__tla;this.AntialiasDisplayChanged=function(){};this.AutoZoomChanged=function(){};this.BackColorChanged=function(){};this.BorderColorChanged=function(){};this.BorderStyleChanged=function(){};this.BorderWidthChanged=function(){};this.CaptionChanged=function(){};this.CenteredChanged=function(){};this.FontChanged=function(){};this.ForeColorChanged=function(){};this.ImageChanged=function(){};this.ImageSizeChanged=function(){};this.ScrollPositionChanged=function(){};this.MouseToolChanged=function(){};this.SelectionChanged=null;this.SizeChanged=function(){};this.TitleBarChanged=function(){};this.VisibilityChanged=function(){};this.ZoomChanged=function(){};this.ZoomInOutPercentageChanged=function(){};this.RemoteInvoked=function(){};this.OnInit=function(){};this.OnLoad=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.FireEvent=__fe;function __fe(en,e){atalaFireEvent(_s,en,e);};atalaViewers.push(this);__i();this.Init=__i;function __i(){_m=document.getElementById(_id+'_om');if(_m!=null){_l=atalaGetObject(_id+'_ol');_span=document.getElementById(_id);if(_span==null){_span=_m.parentNode;};_tbr=document.getElementById(_id+'_ot');_cn=document.getElementById(_id+'_oc');_vp=atalaGetObject(_id+'_ov');if(__gw()==0){__sw(64);};if(__gh()==0){__sh(64);};if(__gvs()){__sv('visible');}else{__sv('hidden');};};__fe('OnInit',null);};this.AtlasReload=__atr;function __atr(){__i();__l();};this.Load=__l;function __l(){__ic();var bc=__gbgc();if(bc!='')__bc('setBackColor("'+bc+'");');__uc();__fe('OnLoad',null);};this.Dispose=__d;function __d(){_s=null;_id=null;_f=null;_p=null;_rv=null;_span=null;_m=null;_l=null;_tbr=null;_cn=null;_vp=null;this.AntialiasDisplayChanged=null;this.AutoZoomChanged=null;this.BackColorChanged=null;this.BorderColorChanged=null;this.BorderStyleChanged=null;this.BorderWidthChanged=null;this.CaptionChanged=null;this.CenteredChanged=null;this.FontChanged=null;this.ForeColorChanged=null;this.ImageChanged=null;this.ImageSizeChanged=null;this.ScrollPositionChanged=null;this.MouseToolChanged=null;this.SelectionChanged=null;this.SizeChanged=null;this.TitleBarChanged=null;this.VisibilityChanged=null;this.ZoomChanged=null;this.ZoomInOutPercentageChanged=null;this.RemoteInvoked=null;this.OnLoad=null;};function __bc(exp){var s;if(document.all){s='document.frames[_vp.id]._child.'+exp;}else{s='_vp.contentWindow._child.'+exp;};return eval(s);};function __ic(){__bc('Init();');};function __uc(force){__bc('Update('+force+');');};this.ID=function(){return _id;};this.Form=function(){return _f;};this.getAntialiasDisplay=__gad;function __gad(){return atalaGetFormValueInt(_f,_id+'_a');};this.getAutoZoom=__gaz;function __gaz(){return atalaGetFormValueInt(_f,_id+'_az');};this.getBackColor=__gbgc;function __gbgc(){return atalaGetFormValue(_f,_id+'_bgc');};this.getBorderColor=__gbc;function __gbc(){return atalaGetFormValue(_f,_id+'_bc');};this.getBorderStyle=__gbs;function __gbs(){return atalaGetFormValue(_f,_id+'_bs');};this.getBorderWidth=__gbw;function __gbw(){return atalaGetFormValueInt(_f,_id+'_bw');};this.getBrowserFormat=__gbf;function __gbf(){return atalaGetFormValueInt(_f,_id+'_bf');};this.getCachePath=__gcp;function __gcp(){return atalaGetFormValue(_f,_id+'_cp');};this.getCaption=__gcn;function __gcn(){return atalaGetFormValue(_f,_id+'_ca');};this.getCentered=__gc;function __gc(){if(atalaGetFormValue(_f,_id+'_c').toLowerCase()=='true'){return true;}else{return false;};};this.getDisplayImageUrl=__gdiu;function __gdiu(b){var qs=_p+'?atalagettile=true&atala_id='+_id;if(b){qs+='&atala_tx=0&atala_ty=0'+'&atala_tw='+__gis().Width+'&atala_th='+__gis().Height;}else{qs+='&atala_tx='+__gip().X+'&atala_ty='+__gip().Y+'&atala_tw='+__gws().Width+'&atala_th='+__gws().Height;};qs+='&atala_z='+__gz()+'&atala_si='+__gsi()+'&atala_fi='+__gfi()+'&atala_ad='+__gad()+'&atala_bf='+__gbf()+'&atala_rnd='+Math.round(Math.random()*100000000);return qs;};this.getFont=__gf;function __gf(){return atalaGetFormValue(_f,_id+'_f');};this.getForeColor=__gfgc;function __gfgc(){return atalaGetFormValue(_f,_id+'_fc');};this.getHeight=__gh;function __gh(){return atalaGetFormValue(_f,_id+'_h');};this.getImageSize=__gis;function __gis(){return new atalaSize(atalaGetFormValueInt(_f,_id+'_iw'),atalaGetFormValueInt(_f,_id+'_ih'));};this.getScrollPosition=__gsp;function __gsp(){return new atalaPoint(-atalaGetFormValueInt(_f,_id+'_ipx'),-atalaGetFormValueInt(_f,_id+'_ipy'));};function __gip(){return new atalaPoint(atalaGetFormValueInt(_f,_id+'_ipx'),atalaGetFormValueInt(_f,_id+'_ipy'));};this.getMouseToolLeft=__gmtl;function __gmtl(){return atalaGetFormValueInt(_f,_id+'_mtl');};this.getMouseToolRight=__gmtr;function __gmtr(){return atalaGetFormValueInt(_f,_id+'_mtr');};this.getPathToResources=__gptr;function __gptr(){return atalaGetFormValue(_f,_id+'_pr');};this.getPreCacheTiles=__gpct;function __gpct(){return atalaGetFormValueInt(_f,_id+'_pc');};this.getPreCacheUrl=__gpcu;function __gpcu(){return atalaGetFormValue(_f,_id+'_pi');};this.getScrollBarVisibility=__gsbv;function __gsbv(){return atalaGetFormValueInt(_f,_id+'_sv');};function __gsbh(){return atalaGetFormValueInt(_f,_id+'_sbh');};function __gsbw(){return atalaGetFormValueInt(_f,_id+'_sbw');};this.getSelection=__gsr;function __gsr(){return __bc('getSelection();');};this.getSize=__gs;function __gs(){return new atalaSize(atalaGetFormValueInt(_f,_id+'_w'),atalaGetFormValueInt(_f,_id+'_h'));};this.getImageDisplayOrder=__gido;function __gido(){return atalaGetFormValueInt(_f,_id+'_tm');};this.getTileSize=__gts;function __gts(){return new atalaSize(atalaGetFormValueInt(_f,_id+'_tw'),atalaGetFormValueInt(_f,_id+'_th'));};this.getTitleBar=__gtb;function __gtb(){return atalaGetFormValue(_f,_id+'_t');};this.getViewPortSize=__gvps;function __gvps(){return __bc('getViewPortSize();');};this.getVisibility=__gv;function __gv(){if(__gvs()==true){return'visible';}else{return'hidden';};};this.getWidth=__gw;function __gw(){return atalaGetFormValue(_f,_id+'_w');};this.getZoom=__gz;function __gz(){return atalaGetFormValueFloat(_f,_id+'_z');};this.getZoomInOutPercentage=__gzr;function __gzr(){return atalaGetFormValueInt(_f,_id+'_zp');};this.setAntialiasDisplay=__sad;function __sad(i){if(0<=i<=3){atalaSetFormValue(_f,_id+'_a',i);__uc();__fe('AntialiasDisplayChanged');}else{atalaThrowError('setAntialiasDisplay',3,i,'Valid values are 0-3, 0:None 1:ScaleToGray 2:ReductionOnly 3:Full.')};};this.setAutoZoom=__saz;function __saz(i){if(0<=i<=5){atalaSetFormValue(_f,_id+'_az',i);__daz();__fe('AutoZoomChanged');}else{atalaThrowError('setAutoZoom',3,i,'Valid values are 0-5, 0:None 1:BestFit 2:BestFitShrinkOnly 3:FitToWidth 4:FitToHeight 5:FitToImage.')};};this.setBackColor=__sbgc;function __sbgc(s){try{atalaSetFormValue(_f,_id+'_bgc',s);__bc('setBackColor("'+s+'");');__updateStyle();__fe('BackColorChanged');}catch(ex){atalaThrowError('setBackColor',6,s,ex.message);};};this.setBorderColor=__sbc;function __sbc(s){try{atalaSetFormValue(_f,_id+'_bc',s);__updateStyle();__fe('BorderColorChanged');}catch(ex){atalaThrowError('setBorderColor',6,s,ex.message);};};this.setBorderStyle=__sbs;function __sbs(s){try{atalaSetFormValue(_f,_id+'_bs',s);_m.style.border=s;__fe('BorderStyleChanged');}catch(ex){atalaThrowError('setBorderStyle',6,s,ex.message);};};this.setBorderWidth=__sbw;function __sbw(s){try{atalaSetFormValue(_f,_id+'_bw',s);__updateStyle();__fe('BorderWidthChanged');}catch(ex){atalaThrowError('setBorderWidth',6,s,ex.message);};};this.setCaption=__scn;function __scn(s){try{atalaSetFormValue(_f,_id+'_ca',s);if(_cn!=null){if(s.length!=0){_cn.innerHTML=s;}else{_m.deleteRow(_m.rows.length-1);_cn=null;};}else if(s.length!=0){test=_m.insertRow(_m.rows.length);_cn=test.insertCell(0);_cn.id=_id+'_oc';_cn.innerHTML=s;};__updateStyle();__fe('CaptionChanged');}catch(ex){atalaThrowError('setCaption',6,s,ex.message);};};this.setCentered=__scd;function __scd(b){if(atalaCheckBool(b)==true){if(__gc()!=b){atalaSetFormValue(_f,_id+'_c',b);__bc('Center(true);');__fe('CenteredChanged');};}else{atalaThrowError('setCentered',5,b,'');};};this.setFont=__sf;function __sf(s){try{atalaSetFormValue(_f,_id+'_f',s);__updateStyle();__fe('FontChanged');}catch(ex){atalaThrowError('setFont',6,s,ex.message);};};this.setForeColor=__sfgc;function __sfgc(s){try{atalaSetFormValue(_f,_id+'_fc',s);__updateStyle();__fe('ForeColorChanged');}catch(ex){atalaThrowError('setForeColor',6,s,ex.message);};};this.setHeight=__sh;function __sh(i){atalaSetFormValue(_f,_id+'_h',i);__avp();__fe('SizeChanged');};this.setPreCacheTiles=__spct;function __spct(i){if(i>=0&&i<=1){atalaSetFormValue(_f,_id+'_pc',i);}else{atalaThrowError('setPreCacheTiles',3,i,'Valid values are 0 and 1.');};};this.setScrollPosition=__ssp;function __ssp(p){if(p.typeOf=='atalaPoint'){var op=__gsp();if(p.X!=op.X||p.Y!=op.Y){__sspu(p,true);};}else{atalaThrowError('setScrollPosition',4,p.typeOf,'atalaPoint expected.');};};this.setMouseTool=__smt;function __smt(i,j){if(j==null)j=0;if(0<=i<=7&&0<=j<=7){atalaSetFormValue(_f,_id+'_mtl',i);atalaSetFormValue(_f,_id+'_mtr',j);__bc('MouseTool();');__fe('MouseToolChanged');}else{atalaThrowError('setMouseTool',3,i+', '+j,'Valid values are 0-7, 0:None 1:Center 2:Selection 3:ZoomIn 4:zo 5:ZoomArea 6:Pan 7:PassThrough.')};};this.setSize=__ss;function __ss(s){atalaThrowError(_id+'.setSize',7,s.Width+', '+s.Height,'setSize has been removed from the WebImageViewer, as percentage based values are now supported.')};this.setTitleBar=__stb;function __stb(s){try{atalaSetFormValue(_f,_id+'_t',s);if(_tbr!=null){if(s.length!=0){_tbr.innerHTML=s;}else{_m.deleteRow(0);_tbr=null;};}else if(s.length!=0){test=_m.insertRow(0);_tbr=test.insertCell(0);_tbr.id=_id+'_ot';_tbr.innerHTML=s;};__updateStyle();__fe('TitleBarChanged');}catch(ex){atalaThrowError('setTitleBar',6,s,ex.message);};};this.setVisibility=__sv;function __sv(s){try{if(s=='visible'){atalaSetFormValue(_f,_id+'_v','true');}else{atalaSetFormValue(_f,_id+'_v','false');};_span.style.visibility=s;_m.style.visibility=s;_vp.style.visibility=s;if(s=='visible'){__avp();};__fe('VisibilityChanged');}catch(ex){atalaThrowError('setVisibility',6,s,ex.message);};};this.setWidth=__sw;function __sw(i){atalaSetFormValue(_f,_id+'_w',i);__avp();__fe('SizeChanged');};this.setZoom=__sz;function __sz(f){if(f>0){if(__gaz()==0||__gaz()==5){__szu(f,true,true);};}else{atalaThrowError('setZoom',3,f,'Valid values are greater than 0.')};};this.setZoomInOutPercentage=__szr;function __szr(z){if(1<=z<=100){atalaSetFormValue(_f,_id+'_zp',z);__fe('ZoomInOutPercentageChanged');}else{atalaThrowError('setZoomInOutPercentage',3,z,'Valid values are 1-100.')};};this.OpenUrl=__ou;function __ou(url,fi){if(fi!=null){if(fi>=0){__sfi(fi);}else{atalaThrowError(_id+'.OpenUrl',3,'\n','Frame index cannot be negative.');__sfi(0);};}else{__sfi(0);};__serverOpenUrl(url);__ssi(url);};this.Print=__p;function __p(){atalaPrint(_id,_p);};this.Undo=__uo;function __uo(){__ur(true);};this.Redo=__ro;function __ro(){__ur(false);};this.RemoteInvoke=__rm;function __rm(mthd,args){__dcb(__brq(mthd,args));};this.Invalidate=__r;function __r(){};this.PauseRefresh=__pr;function __pr(){__bc('PauseRefresh();');};this.ResumeRefresh=__rr;function __rr(){__bc('ResumeRefresh();');};this.Update=__fu;function __fu(){__uc(true);};this.setZoomMode=__szm;function __szm(zt){if(zt==5){var ss=__gss();__sw(ss.Width);__sh(ss.Height);}else{__bc('setZoomMode('+zt+');');};};this.getImageUrl=__gsi;function __gsi(){return atalaGetFormValue(_f,_id+'_si');};this.getFrameIndex=__gfi;function __gfi(){return atalaGetFormValue(_f,_id+'_fi');};this.getReturnValue=__grv;function __grv(){return _rv;};this.getPagePath=__gpp;function __gpp(){return _p;};this.getViewPort=__gvp;function __gvp(){return _vp;};function __gci(){return atalaGetFormValue(_f,_id+'_cin');};function __gss(){var z=__gz(),is=__gis();is.Width=Math.ceil(is.Width*z);is.Height=Math.ceil(is.Height*z);return is;};function __gvs(){if(atalaGetFormValue(_f,_id+'_v').toLowerCase()=='true'){return true;}else{return false;};};function __gws(){return __bc('getWindowSize();');};this.setCIN=__sci;function __sci(i){atalaSetFormValue(_f,_id+'_cin',i);};this.setImageSize=__sis;function __sis(w,h){var is=__gis();if(w!=is.Width||h!=is.Height){atalaSetFormValue(_f,_id+'_iw',w);atalaSetFormValue(_f,_id+'_ih',h);__uc();try{_s.ImageSizeChanged();}catch(ex){atalaThrowError(_id+'.ImageSizeChanged',-1,'\n'+_s.ImageSizeChanged,ex.message);};}else{__uc();};};this.setImageUrl=__ssi;function __ssi(url){atalaSetFormValue(_f,_id+'_si',url);try{_s.ImageChanged();}catch(ex){atalaThrowError(_id+'.ImageChanged',-1,'\n'+_s.ImageChanged,ex.message);};};this.setFrameIndex=__sfi;function __sfi(f){atalaSetFormValue(_f,_id+'_fi',f);};this.setPreCacheUrl=__spcu;function __spcu(s){atalaSetFormValue(_f,_id+'_pi',s);};this.setReturnValue=__srv;function __srv(o){_rv=o;};function __sspu(p,u){try{var ss=__gss(),vs=__gvps(),mx=-(ss.Width-vs.Width),my=-(ss.Height-vs.Height);if(p.X<mx){p.X=mx;};if(p.X>0){p.X=0;};if(p.Y<my){p.Y=my;};if(p.Y>0){p.Y=0;};atalaSetFormValue(_f,_id+'_ipx',-p.X);atalaSetFormValue(_f,_id+'_ipy',-p.Y);if(u==true){__uc();};__fe('ScrollPositionChanged');}catch(ex){atalaThrowError('setScrollPosition',6,p.X+"x"+p.Y,ex.message);};};function __szu(f,u,a){try{var p=__gsp(),s,oz=__gz();atalaSetFormValue(_f,_id+'_z',f);p=new atalaPoint(Math.round(p.X/oz*f),Math.round(p.Y/oz*f));s=new atalaSize(Math.round(__gis().Width*f),Math.round(__gis().Height*f));if(a==true){if(__gaz()==5){__daz();};__avp();};__sspu(p,u);__fe('ZoomChanged');}catch(ex){atalaThrowError('setZoom',6,f,ex.message);};};this.DoCallBack=__dcb;function __dcb(qs){var f=atalaGetObject(_id+'_of');f.src=qs;};this.BuildRemoteQuery=__brq;function __brq(mthd,args){if(args==null)args=new Array();var qs=_p+'?atalaremote=true'+'&atala_id='+_id+'&atala_ipx='+__gip().X+'&atala_ipy='+__gip().Y+'&atala_iw='+__gis().Width+'&atala_ih='+__gis().Height+'&atala_w='+__gw()+'&atala_h='+__gh()+'&atala_z='+__gz()+'&atala_az='+__gaz()+'&atala_si='+__gsi()+'&atala_fi='+__gfi()+'&atala_ad='+__gad()+'&atala_bf='+__gbf()+'&atala_cin='+__gci()+'&atala_rsh='+__gsr().getHeight()+'&atala_rsx='+__gsr().getPosition().X+'&atala_rsy='+__gsr().getPosition().Y+'&atala_rsw='+__gsr().getWidth()+'&atala_rsv='+__gsr().getVisible()+'&atala_rm='+mthd+'&atala_rnd='+Math.round(Math.random()*100000000);for(var i=0;i<args.length;i++){var arg='&atala_ra';if(typeof(args[i])=='number'){qs+=arg+'n'+i+'='+args[i];}else if(typeof(args[i])=='string'){qs+=arg+'s'+i+'='+atalaUrlEncode(args[i]);}else if(typeof(args[i])=='boolean'){qs+=arg+'b'+i+'='+args[i];};};return qs;};function __daz(){__szm(__gaz());};function __serverOpenUrl(u){var f=atalaGetObject(_id+'_of');f.src=_p+'?atalaopenurl=true'+'&atala_id='+_id+'&atala_si='+u+'&atala_fi='+__gfi()+'&atala_pc='+__gpct()+'&atala_rnd='+Math.round(Math.random()*100000000);};function __ur(undo){var ur;if(undo){ur=-1;}else{ur=1;};var f=atalaGetObject(_id+'_of');f.src=_p+'?atalaundo='+ur+'&atala_id='+_id+'&atala_si='+__gsi()+'&atala_cin='+__gci()+'&atala_rnd='+Math.round(Math.random()*100000000);};function __avp(){var w=__gw(),h=__gh();_span.style.width=w;_span.style.height=h;if(w.indexOf('%')>0){_m.style.width='100%';_l.style.width='100%';_vp.style.width='100%';}else{_m.style.width=w;_l.style.width=w;_vp.style.width=w;};if(h.indexOf('%')>0){_span.style.display='block';_m.style.height='100%';_l.style.height='100%';_vp.style.height='100%';}else{_m.style.height=h;_l.style.height=h;_vp.style.height=h;};};function __updateStyle(){var bg=__gbgc(),bc=__gbc(),bw=__gbw(),fg=__gfgc(),fn=__gf();if(_tbr!=null){_tbr.parentNode.style.background=bg;_tbr.style.color=fg;_tbr.style.fontFamily=fn;_tbr.style.fontWeight='bold';};if(_cn!=null){_cn.parentNode.style.background=bg;_cn.style.color=fg;_cn.style.fontFamily=fn;};_m.cellSpacing=parseInt(bw);_m.style.background=bc;_m.style.color=fg;_m.style.fontFamily=fn;};};
