window.onbeforeunload=bunload;function bunload(){if(WebImagingToolkit!=null&&WebImagingToolkit.M!=null&&WebImagingToolkit.M.ImageCount>0){return lang.msg_exit;}}function isIE8(){var index=navigator.appVersion.indexOf("MSIE 8.0");if(index==-1){return false;}else{return true;}}var WebImagingToolkit={AQ:"",M:null,l:0,o:0,AM:"down",A5:"over",a:"disable",AI:"visible",z:"hidden",AT:140,AU:140,AL:"webimaging_cls_thumbnail",V:"webimaging_cls_thumbnail_selected",Bq:function(w,h){WebImagingToolkit.AT=w;WebImagingToolkit.AU=h;},A4:function(hBitmap){B.BS();},BB:function(){},Bm:function(O){var n=O;WebImagingToolkit.l=0;WebImagingToolkit.o=0;while(n!=null&&n.tagName!="BODY"){WebImagingToolkit.l+=n.offsetLeft;WebImagingToolkit.o+=n.offsetTop;n=n.offsetParent;}},Initialize:function(Ap,Bd,Bp){var O=document.getElementById(Ap);if(O==null){alert(lang.msg_initialfailed);return null;}WebImagingToolkit.AQ=Ap;O.style.textAlign="left";WebImagingToolkit.M=document.getElementById(Bd);if(WebImagingToolkit.M!=null){WebImagingToolkit.M.License = Bp;if(window.addEventListener){WebImagingToolkit.M.addEventListener("PageDone",WebImagingToolkit.A4,false);WebImagingToolkit.M.addEventListener("ScanDone",WebImagingToolkit.BB,false);}else{WebImagingToolkit.M.attachEvent("PageDone",WebImagingToolkit.A4);WebImagingToolkit.M.attachEvent("ScanDone",WebImagingToolkit.BB);}}WebImagingToolkit.Bm(O);WebImagingToolkit.AQ=Ap;B.Au(O);C.Au(O);C.Ak();B.D.oncontextmenu=function(){return false;};return WebImagingToolkit.M;}};var B={AJ:0,At:1,A1:2,D:null,P:0,Q:0,f:0,k:0,AK:false,F:null,U:null,N:null,W:0,_:null,As:true,L:null,An:function(S){var n=B.D.getElementsByTagName("img");var r=-1;for(i=0;i<n.length;i++){var t=n[i].parentNode;if(t==S){r=i;}}return r;},A_:function(){var n=B.D.getElementsByTagName("img");for(i=0;i<n.length;i++){WebImagingToolkit.M.SetBitmap(i,n[i].value);}},m:function(){if(B.L!=null){var r=B.An(B.L);if(r>=0){B.Ak();C.Ay();var BO=WebImagingToolkit.M.GetBitmapFile(r);C.BH(BO);C.BP();}}},BG:function(){if(WebImagingToolkit.M==null){alert(lang.msg_notwainobject);return false;}WebImagingToolkit.M.SelectScanner();},BE:function(){if(WebImagingToolkit.M==null){alert(lang.msg_notwainobject);return false;}else{if(WebImagingToolkit.M.SourceCount==0){alert(lang.msg_nodriver);return false;}}WebImagingToolkit.M.ShowSetupBeforeScan=true;WebImagingToolkit.M.StartScan();},Bo:function(){if(this.className==WebImagingToolkit.a){return false;}},BR:function(){if(this.className==WebImagingToolkit.a){return false;}WebImagingToolkit.M.SavePages("",false);return;},Bs:function(){if(this.className==WebImagingToolkit.a){return false;}WebImagingToolkit.M.Upload();},BS:function(){var Az=WebImagingToolkit.M.CreateThumbnailFile(WebImagingToolkit.M.ImageCount-1,WebImagingToolkit.AT,WebImagingToolkit.AU);S=document.createElement("div");S.className=WebImagingToolkit.AL;g=document.createElement("img");g.src=Az;if(window.addEventListener){g.addEventListener("ondblclick",B.m,false);}else{g.attachEvent("ondblclick",B.m);}g.value=WebImagingToolkit.M.GetBitmap(WebImagingToolkit.M.ImageCount-1);S.appendChild(g);if(window.addEventListener){S.addEventListener("ondblclick",B.m,false);}else{S.attachEvent("ondblclick",B.m);}B.D.appendChild(S);B.Ai();},d:function(AV,Bk){var v=document.getElementById(AV);if(v!=null){if(Bk==true){v.className="";}else{v.className=WebImagingToolkit.a;}}},K:function(AV,BC,A0,Av,Aw){Z=document.createElement("li");Z.id=AV;if(BC!=""){Z.innerHTML="<div class=\"caption\">"+BC+"</div>";}Z.title=A0;Z.onclick=Av;Z.className=Aw;return Z;},Ay:function(){var v=document.getElementById(WebImagingToolkit.AQ);if(B.D.parentNode.parentNode!=v){v.appendChild(B.D.parentNode);}},Ak:function(){var v=document.getElementById(WebImagingToolkit.AQ);if(B.D.parentNode.parentNode==v){v.removeChild(B.D.parentNode);}},Ai:function(){var v=B.D.getElementsByTagName("img");if(v!=null&&v.length>0){B.d("webimaging_btn_new",true);B.d("webimaging_btn_save",true);B.d("webimaging_btn_upload",true);}else{B.d("webimaging_btn_new",false);B.d("webimaging_btn_save",false);B.d("webimaging_btn_upload",false);}if(B.L!=null&&v!=null&&v.length>0){B.d("webimaging_btn_rotateleft",true);B.d("webimaging_btn_rotateright",true);B.d("webimaging_btn_rotate180",true);B.d("webimaging_btn_delete",true);}else{B.d("webimaging_btn_rotateleft",false);B.d("webimaging_btn_rotateright",false);B.d("webimaging_btn_rotate180",false);B.d("webimaging_btn_delete",false);}},BY:function(){if(this.className==WebImagingToolkit.a){return false;}var v=B.D.getElementsByTagName("img");if(v.length==0||!confirm(lang.msg_unsaved)){return;}var i=0;while(i<v.length){if(v[i].parentNode.className==WebImagingToolkit.V||v[i].parentNode.className==WebImagingToolkit.AL){B.D.removeChild(v[i].parentNode);}else{i++;}}WebImagingToolkit.M.Clear();B.Ai();},Bh:function(){if(this.className==WebImagingToolkit.a){return false;}var v=B.D.getElementsByTagName("img");if(v.length==0||!confirm(lang.msg_confirm_delete)){return;}var i=0;while(i<v.length){if(v[i].parentNode.className==WebImagingToolkit.V){var r=B.An(v[i].parentNode);WebImagingToolkit.M.DeleteImage(r);B.D.removeChild(v[i].parentNode);}else{i++;}}B.Ai();},Am:function(){if(this.className==WebImagingToolkit.a){return false;}var v=B.D.getElementsByTagName("img");for(i=0;i<v.length;i++){if(v[i].parentNode.className==WebImagingToolkit.V){v[i].removeAttribute("src");v[i].removeAttribute("width");v[i].removeAttribute("height");WebImagingToolkit.M.RotateLeft(i);v[i].src=WebImagingToolkit.M.CreateThumbnailFile(i,WebImagingToolkit.AT,WebImagingToolkit.AU);v[i].value=WebImagingToolkit.M.GetBitmap(i);}}},Al:function(){if(this.className==WebImagingToolkit.a){return false;}var v=B.D.getElementsByTagName("img");for(i=0;i<v.length;i++){if(v[i].parentNode.className==WebImagingToolkit.V){v[i].removeAttribute("src");v[i].removeAttribute("width");v[i].removeAttribute("height");WebImagingToolkit.M.RotateRight(i);v[i].src=WebImagingToolkit.M.CreateThumbnailFile(i,WebImagingToolkit.AT,WebImagingToolkit.AU);v[i].value=WebImagingToolkit.M.GetBitmap(i);}}},Ah:function(){if(this.className==WebImagingToolkit.a){return false;}var v=B.D.getElementsByTagName("img");for(i=0;i<v.length;i++){if(v[i].parentNode.className==WebImagingToolkit.V){v[i].removeAttribute("src");v[i].removeAttribute("width");v[i].removeAttribute("height");WebImagingToolkit.M.Rotate180(i);v[i].src=WebImagingToolkit.M.CreateThumbnailFile(i,WebImagingToolkit.AT,WebImagingToolkit.AU);v[i].value=WebImagingToolkit.M.GetBitmap(i);}}},Au:function(AE){var b=document.createElement("div");if(b==null){alert("initialization thumbnail view failed");return false;}b.style.width=AE.style.width;b.style.height=AE.style.height;AE.appendChild(b);B.G=document.createElement("ul");B.G.id="webimaging_id_toolbar";b.appendChild(B.G);B.G.appendChild(B.K("","","","","seperator"));B.G.appendChild(B.K("webimaging_btn_selectscanner",lang.caption_select,lang.hint_select,B.BG,""));B.G.appendChild(B.K("webimaging_btn_startscan",lang.caption_capture,lang.hint_capture,B.BE,""));B.G.appendChild(B.K("","","","","seperator"));B.G.appendChild(B.K("webimaging_btn_rotateleft","",lang.hint_rotateleft,B.Am,WebImagingToolkit.a));B.G.appendChild(B.K("webimaging_btn_rotateright","",lang.hint_rotateright,B.Al,WebImagingToolkit.a));B.G.appendChild(B.K("webimaging_btn_rotate180","",lang.hint_rotate180,B.Ah,WebImagingToolkit.a));B.G.appendChild(B.K("","","","","seperator"));B.G.appendChild(B.K("webimaging_btn_delete","",lang.hint_delete,B.Bh,WebImagingToolkit.a));B.G.appendChild(B.K("","","","","seperator"));B.G.appendChild(B.K("webimaging_btn_new",lang.caption_new,lang.hint_new,B.BY,WebImagingToolkit.a));B.G.appendChild(B.K("webimaging_btn_save",lang.caption_save,lang.hint_save,B.BR,WebImagingToolkit.a));B.G.appendChild(B.K("","","","","seperator"));B.G.appendChild(B.K("webimaging_btn_singlepageview","",lang.hint_singlepageview,B.m,""));var x=B.K("webimaging_btn_thumbnailview","",lang.hint_thumbnailview,null,"");x.className=WebImagingToolkit.AM;B.G.appendChild(x);for(i=0;i<B.G.childNodes.length;i++){var u=B.G.childNodes[i];if(u.nodeName=="LI"&&u.className!="seperator"){u.onmouseover=function(){if(this.className!=WebImagingToolkit.AM&&this.className!=WebImagingToolkit.a){this.className=WebImagingToolkit.A5;}};u.onmouseout=function(){this.className=this.className.replace(WebImagingToolkit.A5,"");};}}B.D=document.createElement("div");B.D.id="webimaging_id_content";b.appendChild(B.D);B.D.style.width=B.D.parentNode.offsetWidth+"px";B.D.style.height=B.D.parentNode.offsetHeight-B.G.offsetHeight-1+"px";B.F=document.createElement("div");B.F.style.fontSize="0";B.F.style.left=WebImagingToolkit.l;B.F.style.top=WebImagingToolkit.o;B.F.style.width=0;B.F.style.height=0;B.F.style.position="absolute";B.F.style.cursor="crosshair";B.F.style.visibility=WebImagingToolkit.z;B.F.className="webimaging_cls_selection_box";B.D.appendChild(B.F);B.N=document.createElement("div");B.N.style.fontSize="0";B.N.style.left=0;B.N.style.top=0;B.N.style.height=0;B.N.style.width=0;B.N.style.position="absolute";B.N.className="webimaging_cls_drag_box";B.D.appendChild(B.N);B.U=document.createElement("div");B.U.style.left=0;B.U.style.top=0;B.U.style.height=0;B.U.style.position="absolute";B.U.className="webimaging_cls_caret";B.U.style.visibility=WebImagingToolkit.z;B.D.appendChild(B.U);B.D.onmousedown=B.BT;B.D.onmousemove=B.BU;B.D.onmouseup=B.Ba;B.W=B.AJ;return true;},A7:function(x,y){v=B.D.getElementsByTagName("img");var $=0;var AC=0;if(isIE8()){$=B.D.offsetLeft;AC=B.D.offsetTop;}for(i=0;i<v.length;i++){var S=v[i].parentNode;if((S.className==WebImagingToolkit.AL||S.className==WebImagingToolkit.V)&&R.Ag(x,y,S.offsetLeft-$,S.offsetTop-AC,S.offsetWidth,S.offsetHeight)){return S;}}return null;},Bi:function(x,y,w,h){if(w<0){x=x+w;w=-w;}if(h<0){y=y+h;y=-y;}var $=0;var AC=0;if(isIE8()){$=B.D.offsetLeft;AC=B.D.offsetTop;}var Aq=new Array;v=B.D.getElementsByTagName("img");for(i=0;i<v.length;i++){var S=v[i].parentNode;if(R.Bb(x,y,w,h,S.offsetLeft-$,S.offsetTop-AC,S.offsetWidth,S.offsetHeight)){Aq[Aq.length]=S;}}return Aq;},AD:function(){v=B.D.getElementsByTagName("img");for(i=0;i<v.length;i++){v[i].parentNode.className=WebImagingToolkit.AL;}},BT:function(H){B.A_();if(!H){H=window.event;}if(R.AP(H)!=R.AN||!B.D){return;}B.D.focus();if(!isIE8()&&B.D.componentFromPoint(H.clientX,H.clientY)!=""){return;}B.P=H.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)-B.D.offsetLeft+B.D.scrollLeft-(document.documentElement.clientLeft||document.body.clientLeft);B.Q=H.clientY+(document.documentElement.scrollTop||document.body.scrollTop)-B.D.offsetTop+B.D.scrollTop-(document.documentElement.clientTop||document.body.clientTop);if(!isIE8()){B.P=B.P-WebImagingToolkit.l;B.Q=B.Q-WebImagingToolkit.o;}B.AK=true;B.F.style.visibility=WebImagingToolkit.z;B.L=B.A7(B.P,B.Q);if(!H.ctrlKey){if(B.L==null){B.AD();}else if(B.L.className!=WebImagingToolkit.V){B.AD();}}if(B.L!=null){if(!H.ctrlKey){B.L.className=WebImagingToolkit.V;}else{if(B.L.className==WebImagingToolkit.V){B.L.className=WebImagingToolkit.AL;}else{B.L.className=WebImagingToolkit.V;}}B.W=B.At;B.f=B.P-B.L.offsetLeft;B.k=B.Q-B.L.offsetTop;while(B.N.firstChild){B.N.removeChild(B.N.firstChild);}var O=B.L.childNodes[0].cloneNode(true);B.N.appendChild(O);if(document.compatMode=="CSS1Compat"){if(isIE8()){B.N.style.left=B.L.offsetLeft-B.D.scrollLeft;B.N.style.top=B.L.offsetTop-B.D.scrollTop;}else{B.N.style.left=B.L.offsetLeft+WebImagingToolkit.l+B.D.offsetLeft-B.D.scrollLeft+1;B.N.style.top=B.L.offsetTop+WebImagingToolkit.o+B.D.offsetTop-B.D.scrollTop+3;}}else{B.N.style.left=B.L.offsetLeft;B.N.style.top=B.L.offsetTop+1;}B.N.style.width=B.L.offsetWidth+"px";B.N.style.height=B.L.offsetHeight+"px";B.N.style.visibility=WebImagingToolkit.AI;}else{B.W=B.A1;}if(!window.addEventListener){B.D.setCapture(true);}},BU:function(H){if(!H){H=window.event;}if(R.AP(H)!=R.AN||!B.AK){return;}B.J=H.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)-B.D.offsetLeft+B.D.scrollLeft-(document.documentElement.clientLeft||document.body.clientLeft);B.I=H.clientY+(document.documentElement.scrollTop||document.body.scrollTop)-B.D.offsetTop+B.D.scrollTop-(document.documentElement.clientTop||document.body.clientTop);if(!isIE8()){B.J=B.J-WebImagingToolkit.l;B.I=B.I-WebImagingToolkit.o;}if(B.J<B.D.scrollLeft){B.J=B.D.scrollLeft;}if(B.J>B.D.clientWidth+B.D.scrollLeft){B.J=B.D.clientWidth+B.D.scrollLeft;}if(B.I>B.D.clientHeight+B.D.scrollTop){B.I=B.D.clientHeight+B.D.scrollTop;}if(B.I<B.D.scrollTop){B.I=B.D.scrollTop;}if(B.W==B.A1){var AS,AR;B.F.style.visibility=WebImagingToolkit.z;AS=Math.min(B.J,B.P);AR=Math.min(B.I,B.Q);if(document.compatMode=="CSS1Compat"){if(isIE8()){B.F.style.left=AS+B.D.offsetLeft-B.D.scrollLeft;B.F.style.top=AR+B.D.offsetTop-B.D.scrollTop;}else{B.F.style.left=AS+WebImagingToolkit.l-B.D.scrollLeft;B.F.style.top=AR+WebImagingToolkit.o+B.D.offsetTop-B.D.scrollTop+1;}}else{B.F.style.left=AS;B.F.style.top=AR;}B.F.style.width=Math.abs(B.J-B.P);B.F.style.height=Math.abs(B.I-B.Q);B.F.style.visibility=WebImagingToolkit.AI;if(!H.ctrlKey){B.AD();}var s=B.Bi(AS,AR,R.AA(B.F.style.width),R.AA(B.F.style.height));for(i=0;i<s.length;i++){s[i].className=WebImagingToolkit.V;B.L=s[i];}}else if(B.W==B.At){B.N.style.visibility=WebImagingToolkit.AI;if(document.compatMode=="CSS1Compat"){if(isIE8()){B.N.style.left=B.J-B.f-B.D.scrollLeft;B.N.style.top=B.I-B.k-B.D.scrollTop;}else{B.N.style.left=B.J-B.f+WebImagingToolkit.l-B.D.scrollLeft+1;B.N.style.top=B.I-B.k+WebImagingToolkit.o+B.D.offsetTop-B.D.scrollTop+3;}}else{B.N.style.left=B.J-B.f;B.N.style.top=B.I-B.k;}B.U.style.visibility=WebImagingToolkit.AI;var T=B.A7(B.J,B.I);if(T){if(T.className==WebImagingToolkit.V){B.U.style.visibility=WebImagingToolkit.z;B._=null;return;}B._=T;var $=0;var AC=0;if(isIE8()){$=B.D.offsetLeft;AC=B.D.offsetTop;}if(B.J<T.offsetLeft-$+T.offsetWidth/2){if(document.compatMode=="CSS1Compat"){if(isIE8()){B.U.style.left=T.offsetLeft-R.AA(T.currentStyle.margin)-1-B.D.scrollLeft+1;}else{B.U.style.left=T.offsetLeft+WebImagingToolkit.l-R.AA(T.currentStyle.margin)-1-B.D.scrollLeft+1;}}else{B.U.style.left=T.offsetLeft-R.AA(T.currentStyle.margin)-1;}B.As=true;}else{if(document.compatMode=="CSS1Compat"){if(isIE8()){B.U.style.left=T.offsetLeft+T.offsetWidth-1+R.AA(T.currentStyle.margin)-B.D.scrollLeft+1;}else{B.U.style.left=T.offsetLeft+WebImagingToolkit.l+T.offsetWidth-1+R.AA(T.currentStyle.margin)-B.D.scrollLeft+1;}}else{B.U.style.left=T.offsetLeft+T.offsetWidth-1+R.AA(T.currentStyle.margin);}B.As=false;}if(document.compatMode=="CSS1Compat"){if(isIE8()){B.U.style.top=T.offsetTop-B.D.scrollTop+"px";}else{B.U.style.top=T.offsetTop+WebImagingToolkit.o+B.D.offsetTop-B.D.scrollTop+3+"px";}}else{B.U.style.top=T.offsetTop+"px";}B.U.style.height=T.offsetHeight+"px";B.U.style.visibility=WebImagingToolkit.AI;}}},Ba:function(H){if(!H){H=window.event;}if(R.AP(H)!=R.AN){return;}B.Ai();if(B.W==B.A1){B.F.style.visibility=WebImagingToolkit.z;B.F.style.left=0;B.F.style.top=0;B.F.style.width=0;B.F.style.height=0;}if(B.W==B.At){while(B.N.firstChild){B.N.removeChild(B.N.firstChild);}if(B._!=null){v=B.D.getElementsByTagName("img");AB=new Array;i=0;while(i<v.length){var S=v[i].parentNode;if(S.className==WebImagingToolkit.V){AB[AB.length]=S;B.D.removeChild(S);}else{i++;}}var BF=B._.nextSibling;for(i=0;i<AB.length;i++){if(B._!=null){if(B.As){B.D.insertBefore(AB[i],B._);}else{if(B._.nextSibling!=null){B.D.insertBefore(AB[i],BF);}else{B.D.appendChild(AB[i]);}}}else{B.D.appendChild(AB[i]);}}B._=null;B.A_();}B.N.style.visibility=WebImagingToolkit.z;B.U.style.visibility=WebImagingToolkit.z;}B.W=B.AJ;B.AK=false;if(!window.addEventListener){B.D.releaseCapture();}}};var R={AN:1,AA:function(AF){if(AF.length<=2){return AF;}return eval(AF.substr(0,AF.length-2));},AP:function(H){Z=0;if(navigator.appName=="Netscape"){Z=H.which;}if(navigator.appName=="Microsoft Internet Explorer"){Z=H.button;}return Z;},Ag:function(AF,A6,A3,A2,BL,BI){if(AF>=A3&&AF<=A3+BL&&A6>=A2&&A6<=A2+BI){return true;}else{return false;}},Bb:function(Ac,Ab,Ae,Aa,BA,A8,BN,BQ){if(Ae<0){BM=Ac;Ac=Ac+Ae;Ae=-Ae;}if(Aa<0){BM=Ab;Ab=Ab+Aa;Aa=-Aa;}return!(BA>Ac+Ae||BA+BN<Ac||A8>Ab+Aa||A8+BQ<Ab);}};var C={j:5,AJ:0,BD:1,A$:2,AW:1,Aj:2,D:null,P:0,Q:0,f:0,k:0,p:0,q:0,AK:false,F:null,U:null,W:0,AO:1,G:null,Br:100,Ao:function(){C.Ak();B.Ay();},BJ:function(){v=document.getElementById("picture");v.width=v.width*1.2;C.Af(1.2);},BW:function(){v=document.getElementById("picture");v.width=v.width*0.8;C.Af(0.8);},Af:function(ratio){if(C.F!=null&&C.F.style.visibility==WebImagingToolkit.AI){v=document.getElementById("picture");C.F.style.left=C.F.offsetLeft*ratio;C.F.style.top=C.F.offsetTop*ratio;C.F.style.width=Math.min(C.F.offsetWidth*ratio,v.width-C.F.offsetLeft)+"px";C.F.style.height=Math.min(C.F.offsetHeight*ratio,v.height-C.F.offsetTop)+"px";}},BK:function(){v=document.getElementById("picture");var xr,yr;xr=v.offsetWidth/v.parentNode.clientWidth;yr=v.offsetHeight/v.parentNode.clientHeight;if(xr>yr){C.Ar();}else{C.A9();}},Ar:function(){v=document.getElementById("picture");var Ad=v.width;v.removeAttribute("width");v.width=v.parentNode.clientWidth-document.body.clientLeft;if(v.width!=v.parentNode.clientWidth-document.body.clientLeft){v.width=v.parentNode.clientWidth-document.body.clientLeft;}var AZ=v.width/Ad;C.Af(AZ);},A9:function(){v=document.getElementById("picture");var Ad=v.width;v.width=Math.floor(v.width*v.parentNode.clientHeight/v.height)-2;if(v.height!=v.parentNode.clientHeight-2){v.width=Math.floor(v.width*v.parentNode.clientHeight/v.height)-2;}var AZ=v.width/Ad;C.Af(AZ);},BV:function(){v=document.getElementById("picture");var Ad=v.width;v.removeAttribute("width");var AZ=v.width/Ad;C.Af(AZ);},Bl:function(){var O=document.getElementById("webimaging_btn_pan");if(O==null){return;}O.className=WebImagingToolkit.AM;C.F.style.width="1px";C.F.style.height="1px";C.F.style.visibility=WebImagingToolkit.z;O=document.getElementById("webimaging_btn_selecting");O.className="";C.AO=C.AW;C.D.style.cursor="url(/webimaging/media/grab.cur),move";},Bn:function(){O=document.getElementById("webimaging_btn_selecting");if(O==null){return;}O.className=WebImagingToolkit.AM;O=document.getElementById("webimaging_btn_pan");O.className="";C.AO=C.Aj;C.D.style.cursor="crosshair";},Bc:function(){var v=B.D.getElementsByTagName("img");B.AD();if(v.length>0){B.L=v[0].parentNode;B.L.className=WebImagingToolkit.V;B.m();}},Bg:function(){var O=B.L.previousSibling;if(O!=null&&(O.className==WebImagingToolkit.AL||O.className==WebImagingToolkit.V)){B.AD();B.L=O;B.L.className=WebImagingToolkit.V;B.m();}},Bf:function(){var O=B.L.nextSibling;if(O!=null&&(O.className==WebImagingToolkit.AL||O.className==WebImagingToolkit.V)){B.AD();B.L=B.L.nextSibling;B.L.className=WebImagingToolkit.V;B.m();}},Be:function(){var v=B.D.getElementsByTagName("img");B.AD();if(v.length>0){B.L=v[v.length-1].parentNode;B.L.className=WebImagingToolkit.V;B.m();}},Am:function(){B.Am();B.m();},Al:function(){B.Al();B.m();},Ah:function(){B.Ah();B.m();},K:function(AV,A0,Av,Aw){Z=document.createElement("li");Z.id=AV;Z.title=A0;Z.onclick=Av;Z.className=Aw;return Z;},BH:function(Az){var c=document.getElementById("picture");c.removeAttribute("src");c.src=Az;},Ay:function(){var v=document.getElementById(WebImagingToolkit.AQ);if(C.D.parentNode.parentNode!=v){v.appendChild(C.D.parentNode);C.Ar();C.Bl();}},Ak:function(){var v=document.getElementById(WebImagingToolkit.AQ);if(C.D.parentNode.parentNode==v){v.removeChild(C.D.parentNode);}},BP:function(){var v=document.getElementById("webimaging_btn_pageindicator");if(v==null){return;}var g=B.D.getElementsByTagName("img");var r=B.An(B.L)+1;v.innerHTML=lang.caption_page+" "+r+"/"+g.length;},Au:function(AE){var b=document.createElement("div");if(b==null){alert("initialization single page view failed");return false;}b.id="singleView";b.style.width=AE.style.width;b.style.height=AE.style.height;AE.appendChild(b);C.G=document.createElement("ul");C.G.id="webimaging_id_toolbar";b.appendChild(C.G);C.G.appendChild(C.K("","","","seperator"));C.G.appendChild(C.K("webimaging_btn_zoomin",lang.hint_zoomin,C.BJ,""));C.G.appendChild(C.K("webimaging_btn_zoomout",lang.hint_zoomout,C.BW,""));C.G.appendChild(C.K("webimaging_btn_bestfit",lang.hint_bestfit,C.BK,""));C.G.appendChild(C.K("webimaging_btn_fitwidth",lang.hint_fitwidth,C.Ar,""));C.G.appendChild(C.K("webimaging_btn_fitheight",lang.hint_fitheight,C.A9,""));C.G.appendChild(C.K("webimaging_btn_actualsize",lang.hint_actualsize,C.BV,""));C.G.appendChild(C.K("","","","seperator"));C.G.appendChild(C.K("webimaging_btn_rotateleft",lang.hint_rotateleft,C.Am,""));C.G.appendChild(C.K("webimaging_btn_rotateright",lang.hint_rotateright,C.Al,""));C.G.appendChild(C.K("webimaging_btn_rotate180",lang.hint_rotate180,C.Ah,""));C.G.appendChild(C.K("","","","seperator"));C.G.appendChild(C.K("webimaging_btn_firstpage",lang.hint_firstpage,C.Bc,""));C.G.appendChild(C.K("webimaging_btn_previouspage",lang.hint_previouspage,C.Bg,""));C.G.appendChild(C.K("webimaging_btn_nextpage",lang.hint_nextpage,C.Bf,""));C.G.appendChild(C.K("webimaging_btn_lastpage",lang.hint_lastpage,C.Be,""));C.G.appendChild(C.K("","","","seperator"));var x=B.K("webimaging_btn_singlepageview","",lang.hint_singlepageview,null,"");x.className=WebImagingToolkit.AM;C.G.appendChild(x);C.G.appendChild(C.K("webimaging_btn_thumbnailview",lang.hint_thumbnailview,C.Ao,""));var Ax=document.createElement("div");Ax.id="webimaging_btn_pageindicator";Ax.innerHTML="";C.G.appendChild(Ax);for(i=0;i<C.G.childNodes.length;i++){var u=C.G.childNodes[i];if(u.nodeName=="LI"&&u.className!="seperator"){u.onmouseover=function(){if(this.className!=WebImagingToolkit.AM){this.className="over";}};u.onmouseout=function(){this.className=this.className.replace("over","");};}}C.D=document.createElement("div");C.D.id="webimaging_id_content";var g=document.createElement("img");g.id="picture";g.className="webimaging_cls_singlepage";if(window.addEventListener){g.addEventListener("ondblclick",C.Ao,false);}else{g.attachEvent("ondblclick",C.Ao);}C.D.appendChild(g);b.appendChild(C.D);C.F=document.createElement("div");C.F.style.fontSize="0";C.F.style.left=-10;C.F.style.top=-10;C.F.style.width=0;C.F.style.height=0;C.F.style.border="1px dotted red";C.F.style.position="absolute";C.F.className="webimaging_cls_selection_box";C.D.appendChild(C.F);C.D.style.width=C.D.parentNode.style.width;C.D.style.height=C.D.parentNode.offsetHeight-C.G.offsetHeight+"px";C.D.onmousedown=C.BX;C.D.onmousemove=C.Bj;C.D.onmouseup=C.BZ;C.D.oncontextmenu=function(){return false;};C.W=C.AW;C.D.style.cursor="url(/webimaging/media/grab.cur),move";return true;},BX:function(H){if(!H){H=window.event;}if(R.AP(H)!=R.AN||!C.D){return;}if(!isIE8()&&C.D.componentFromPoint(H.clientX,H.clientY)!=""){return;}C.P=H.clientX+document.body.scrollLeft-C.D.offsetLeft+C.D.scrollLeft-document.body.clientLeft;C.Q=H.clientY+document.body.scrollTop-C.D.offsetTop+C.D.scrollTop-document.body.clientTop;if(!isIE8()){C.P=C.P-WebImagingToolkit.l;C.Q=C.Q-WebImagingToolkit.o;}var c=document.getElementById("picture");if(C.P>c.offsetWidth){return;}if(C.Q>c.offsetHeight){return;}C.AK=true;if(R.Ag(C.P,C.Q,C.F.offsetLeft,C.F.offsetTop,C.F.offsetWidth,C.F.offsetHeight)){C.f=C.F.offsetLeft;C.k=C.F.offsetTop;C.p=C.F.offsetWidth;C.q=C.F.offsetHeight;if(C.F.style.cursor=="move"){C.W=C.A$;}else{C.W=C.BD;}}else{C.W=C.AJ;switch(C.AO){case C.Aj:C.F.style.left=C.P;C.F.style.top=C.Q;C.F.style.width=0;C.F.style.height=0;C.F.style.visibility=WebImagingToolkit.AI;break;case C.AW:C.p=C.D.scrollLeft;C.q=C.D.scrollTop;C.f=H.clientX;C.k=H.clientY;C.D.style.cursor="url(/webimaging/media/grabbing.cur),move";default:;}}C.D.setCapture(true);},Bj:function(H){if(!H){H=window.event;}var c=document.getElementById("picture");C.J=H.clientX+document.body.scrollLeft-C.D.offsetLeft+C.D.scrollLeft-document.body.clientLeft;C.I=H.clientY+document.body.scrollTop-C.D.offsetTop+C.D.scrollTop-document.body.clientTop;if(!isIE8()){C.J=C.J-WebImagingToolkit.l;C.I=C.I-WebImagingToolkit.o;}if(C.J<1){C.J=1;}if(C.J>c.offsetWidth){C.J=c.offsetWidth;}if(C.I>c.offsetHeight){C.I=c.offsetHeight;}if(C.I<1){C.I=1;}if(C.W==C.AJ&&R.Ag(C.J,C.I,C.F.offsetLeft,C.F.offsetTop,C.F.offsetWidth,C.F.offsetHeight)){if(R.Ag(C.J,C.I,C.F.offsetLeft+C.j,C.F.offsetTop+C.j,C.F.offsetWidth-2*C.j,C.F.offsetHeight-2*C.j)){C.F.style.cursor="move";}else{if(C.J<=C.F.offsetLeft+C.j){if(C.I<=C.F.offsetTop+C.j){C.F.style.cursor="nw-resize";}else if(C.I>=C.F.offsetTop+C.F.offsetHeight-C.j){C.F.style.cursor="sw-resize";}else{C.F.style.cursor="w-resize";}}else if(C.J>=C.F.offsetLeft+C.F.offsetWidth-C.j){if(C.I<=C.F.offsetTop+C.j){C.F.style.cursor="ne-resize";}else if(C.I>=C.F.offsetTop+C.F.offsetHeight-C.j){C.F.style.cursor="se-resize";}else{C.F.style.cursor="e-resize";}}else{if(C.I<C.F.offsetTop+C.j){C.F.style.cursor="n-resize";}else{C.F.style.cursor="s-resize";}}}}if(R.AP(H)!=R.AN||!C.AK){return;}switch(C.W){case C.AJ:switch(C.AO){case C.AW:C.D.scrollLeft=C.p-(H.clientX-C.f);C.D.scrollTop=C.q-(H.clientY-C.k);break;case C.Aj:if(C.J<C.P){C.F.style.left=C.J;}else{C.F.style.left=C.P;}C.F.style.width=Math.abs(C.J-C.P);if(C.I<C.Q){C.F.style.top=C.I;}else{C.F.style.top=C.Q;}C.F.style.height=Math.abs(C.I-C.Q)+"px";break;default:;}break;case C.A$:C.F.style.left=Math.min(Math.max(C.f+C.J-C.P,1),c.offsetWidth-C.F.offsetWidth);C.F.style.top=Math.min(Math.max(C.k+C.I-C.Q,1),c.offsetHeight-C.F.offsetHeight);break;case C.BD:var AY=C.f,AX=C.k,AG=C.p,AH=C.q;switch(C.F.style.cursor){case"s-resize":AH=C.q+C.I-C.Q;break;case"n-resize":AX=C.B.k+C.I-C.Q;AH=C.q+C.Q-C.I;break;case"e-resize":AG=C.p+C.J-C.P;break;case"w-resize":AY=C.B.f+C.J-C.P;AG=C.p+C.P-C.J;break;case"ne-resize":AX=C.B.k+C.I-C.Q;AH=C.q+C.Q-C.I;AG=C.p+C.J-C.P;break;case"se-resize":AG=C.p+C.J-C.P;AH=C.q+C.I-C.Q;break;case"nw-resize":AX=C.B.k+C.I-C.Q;AH=C.q+C.Q-C.I;AY=C.B.f+C.J-C.P;AG=C.p+C.P-C.J;break;case"sw-resize":AH=C.q+C.I-C.Q;AY=C.B.f+C.J-C.P;AG=C.p+C.P-C.J;break;default:;}C.F.style.left=Math.max(AY,1);C.F.style.top=Math.max(AX,1);C.F.style.width=Math.min(Math.max(AG,4*C.j),c.offsetWidth-AY);C.F.style.height=Math.min(Math.max(AH,4*C.j),c.offsetHeight-AX)+"px";break;default:;}},BZ:function(H){if(!H){H=window.event;}if(R.AP(H)!=R.AN){return;}if(C.AO==C.Aj&&C.F.offsetWidth<=2&&C.F.offsetHeight<=4){C.F.style.left=0;C.F.style.top=0;C.F.style.width=0;C.F.style.height=0;}if(C.AO==C.AW){C.D.style.cursor="url(/webimaging/media/grab.cur),move";}C.W=C.AJ;C.D.releaseCapture();C.AK=false;}};
