function ImageControl_OnImageLoadFinish(){BuildZoomObject(startZoom)}function Navigate(a){if(document.fNavigate){document.fNavigate.action=a;document.fNavigate.submit()}else{window.location.href=a}}function GotoImage(a){if(currentImageNo!=a){if(isBook){Navigate("/Browse/BookView.aspx?dbid="+dbid+"&pageno="+a)}else{var b=isNaN(parseInt(a));a=parseInt(a);if(b||a<1||a>cImages){alert(numRange+cImages)}else{if(1!=a||1!=cImages){Navigate("/Browse/View.aspx?dbid="+dbid+"&path="+imagePath+"."+a+"&sid="+sid)}}}}return false}function PrevPage(){if(prevUrl.length>0){Navigate(prevUrl)}}function NextPage(){if(nextUrl.length>0){Navigate(nextUrl)}}function HiliteRect(a){ImageControl.NextHighlight()}function SetMode(a){if(1==a){document.all("modePan").src=cacheDomain+"/i/content/tools/pan_s.gif";document.all("modeMag").src=cacheDomain+"/i/content/tools/magnify.gif"}else{if(2==a){document.all("modePan").src=cacheDomain+"/i/content/tools/pan.gif";document.all("modeMag").src=cacheDomain+"/i/content/tools/magnify.gif"}else{if(3==a){document.all("modePan").src=cacheDomain+"/i/content/tools/pan.gif";document.all("modeMag").src=cacheDomain+"/i/content/tools/magnify_s.gif"}}}ImageControl.Mode=a}function AddZoomItem(d,a,c,b){d.options[a]=new Option(c,b)}function RemoveZoomItem(b,a){b.remove(a)}function RemoveZoomItems(a){while(a.options.length>0){RemoveZoomItem(a,0)}}function BuildZoomObject(b){var e=document.getElementById("zoom");RemoveZoomItems(e);var d=[b,-1,-2,-3,25,50,75,100,125,150,175,200];d.sort(function(g,f){if(g<0&&f<0){return f-g}else{return g-f}});var a=0;for(i=0;i<d.length;i++){if(i>0){if(d[i]==d[i-1]){continue}}if(d[i]==-1){AddZoomItem(e,a,fitImage,d[i]);a++}else{if(d[i]==-2){AddZoomItem(e,a,fitWidth,d[i]);a++}else{if(d[i]==-3){AddZoomItem(e,a,fitHeight,d[i]);a++}else{var c="";if(d[i]<10){c="     "}else{if(d[i]<100){c="    "}else{if(d[i]<1000){c="   "}else{if(d[i]<10000){c="  "}else{c=" "}}}}AddZoomItem(e,a,c+d[i]+"%",d[i]);a++}}}if(d[i]==b){e.selectedIndex=i;SetZoomDivs(b)}}}function SetZoom(a){SetZoomDivs(a);ImageControl.Zoom=a;SetCookieZoom()}function SetZoomDivs(a){if(a>=200){document.getElementById("zoomin").style.display="none";document.getElementById("zoomin_no").style.display=""}else{document.getElementById("zoomin").style.display="";document.getElementById("zoomin_no").style.display="none"}if(a<=25){document.getElementById("zoomout").style.display="none";document.getElementById("zoomout_no").style.display=""}else{document.getElementById("zoomout").style.display="";document.getElementById("zoomout_no").style.display="none"}}function ZoomIn(){var b=document.getElementById("zoom");var d=b.length;var a=b.selectedIndex;var c=ImageControl.Zoom;if(a>=0){for(i=a;i<d;i++){if(b.options[i].value>c){SetZoom(b.options[i].value);b.selectedIndex=i;break}}}}function ZoomOut(){var b=document.getElementById("zoom");var d=b.length;var a=b.selectedIndex;var c=ImageControl.Zoom;if(a>=0){for(i=a;i>=0;i--){if(b.options[i].value>0){if(b.options[i].value<c){SetZoom(b.options[i].value);b.selectedIndex=i;break}}}}}function ToggleChrome(){ImageControl.FullScreen=!ImageControl.FullScreen}function SwitchToBasic(){setDictionaryCookie("BROWSE","MODE","BASIC",null,"Tue, 02 Jan 2035 00:00:00 UTC");var a=window.location.href;a=a.replace("&a=1","");Navigate(a+"&a=0")}function GoToInstall(){Navigate(installUrl)}function SetCookieIQ(){setDictionaryCookie("BROWSE","XIQ",iq,null,"Tue, 02 Jan 2035 00:00:00 UTC")}function SetCookieZoom(){window.focus();var a=ImageControl.Zoom;setDictionaryCookie("BROWSES","Z"+dbid,escape(a),null,null)}function SetCookieIC(){setDictionaryCookie("BROWSE","XIC",ic,null,"Tue, 02 Jan 2035 00:00:00 UTC")}function SetCookieTN(){setDictionaryCookie("BROWSE","XTN",tn,null,"Tue, 02 Jan 2035 00:00:00 UTC")}function Share(){EmailFriend()}function SavePopup(a){var b;var c;if(a){if("undefined"==typeof SaveThis){Save()}else{if("undefined"==typeof SaveOwt){_findObj("owtLink").style.display="none"}b=_findObj("saveHTML");c=_findObj("popIFRAME");c.style.width=517;c.style.height=272;c.style.left=b.style.left=document.body.offsetWidth/2-250;c.style.top=b.style.top=185;c.style.display="block";b.style.display="block";c.style.zIndex=99;b.style.zIndex=100;_findObj("saveBtn").focus()}}else{b=_findObj("saveHTML");c=_findObj("popIFRAME");c.style.display="none";c.style.zIndex=0;b.style.display="none"}}function OkSave(b){SavePopup(false);var a="";for(i=0;i<b.length;i++){if(b[i].checked){a=b[i].value;break}}if(a=="saveOwt"){SaveOwt()}else{if(a=="savePt"){SavePt()}else{if(a=="savePtOther"){SavePtOther()}else{if(a=="savePtStart"){SavePtStart()}else{if(a=="saveShoebox"){SaveThis("Image")}else{Save()}}}}}}function Save(){var a=new Image();var b="/handler/ajax/SuccessHandler.ashx?op=Write&dbid="+dbid+"&pid="+pid+"&iid="+iid+"&unq="+Math.floor(Math.random()*1999999999)+"&pagetype=Image&successtype="+SuccessType+"&eventtype=savDisk";a.src=b;ImageControl.Save()}function PrintPopup(g){OptionsPopup(false);SavePopup(false);if("undefined"==typeof OrderPrint){Print()}else{var b;if(g){b=document.getElementById("orderPrintDialogHtml")}else{b=document.getElementById("printDialogHtml")}if(null!=b){var e=_findObj("popIFRAME");var f=b.getAttribute("width");var d=b.getAttribute("height");var c=Math.max(0,(document.body.clientWidth/2)-(f/2));var a=Math.max(0,(document.body.clientHeight/3)-(d/2));e.style.left=b.style.left=Math.round(c);e.style.top=b.style.top=Math.round(a);b.style.width=f;b.style.height=d;e.style.width=Math.round(f)+2;e.style.height=Math.round(d)+2;b.style.position="absolute";b.style.zIndex=3;b.style.backgroundColor="#EEEEEE";b.style.border="1px solid #999999";e.style.display="block";b.style.display="block";e.style.zIndex=99;b.style.zIndex=100}else{Print()}}}function printDialogPrint(){var a=new Image();var b="/handler/ajax/SuccessHandler.ashx?op=Write&dbid="+dbid+"&pid="+pid+"&iid="+iid+"&unq="+Math.floor(Math.random()*1999999999)+"&pagetype=Image&successtype="+SuccessType+"&eventtype=print";a.src=b;printDialogCancel();Print()}function printDialogCancel(){var b=_findObj("popIFRAME");if(null!=b){b.style.display="none";b.style.zIndex=0}var a=_findObj("orderPrintDialogHtml");if(null!=a){a.style.display="none"}a=_findObj("printDialogHtml");if(null!=a){a.style.display="none"}}function Print(){ImageControl.Print()}function PrintBasic(){window.open("/Browse/print_u.aspx?"+printUrlParams,"Print")}function printDialogGotoApress(c,g,f){var e="printCanvas";if(f=="&ptid=15"){e="print"}var b=new Image();var d="/handler/ajax/SuccessHandler.ashx?op=Write&dbid="+dbid+"&pid="+pid+"&iid="+iid+"&unq="+Math.floor(Math.random()*1999999999)+"&pagetype=Image&successtype="+SuccessType+"&eventtype="+e+" ";b.src=d;printDialogCancel();var a="http://"+c+"/index.aspx?action="+g+"&ppvhash="+ppv+"&dbid="+dbid+"&iid="+iid+"&pid="+pid+f;var h=window.open(a,"_blank","status=0,location=0,toolbar=0,menubar=0,resizable=1,scrollbars=1,titlebar=0");if(h!=null){h.focus()}}function Help(){window.open("/Browse/help_x.aspx","Help","toolbar=no,scrollbars=1,resizable=1,menubar=no,location=no,height=375,width=456")}function OptionsPopup(a){var c;var b;if(a){printDialogCancel();SavePopup(false);b=_findObj("optionsHTML");c=_findObj("popIFRAME");c.style.width=522;c.style.height=287;c.style.left=b.style.left=document.body.offsetWidth/2-250;c.style.top=b.style.top=150;c.style.display="block";b.style.display="block";c.style.zIndex=99;b.style.zIndex=100;_findObj("thumbCheck").checked=tn==1;_findObj("contrast0").checked=0==ic;_findObj("contrast1").checked=1==ic;var d=_findObj("quality0");if(d!=undefined&&d!=null){_findObj("quality0").checked=1==iq;_findObj("quality1").checked=0==iq}_findObj("saveBtn").focus()}else{b=_findObj("optionsHTML");c=_findObj("popIFRAME");c.style.display="none";c.style.zIndex=0;b.style.display="none"}}function ToggleThumb(){tn=_findObj("thumbCheck").checked?1:0;SetCookieTN(tn);ImageControl.Thumb=tn}function ToggleContrast(){ic=_findObj("contrast0").checked?0:1;SetCookieIC(ic);if(ic==1){ImageControl.ImageContrast="normal"}else{ImageControl.ImageContrast="autolevel"}}function ToggleViewer(){var a=_findObj("viewer0").checked?0:1;if(a==1){SwitchToBasic()}}var origIQ=iq;function OkOptions(){OptionsPopup(false);ToggleThumb();ToggleContrast();var a=_findObj("quality0");if(a!=undefined&&a!=null){iq=_findObj("quality0").checked?1:0;SetCookieIQ(iq)}ToggleViewer();if(0==origIQ&&1==iq){if(isBook){Navigate("/Browse/BookView.aspx?dbid="+dbid+"&iid="+iid+"&iq=1")}else{Navigate("/Browse/View.aspx?dbid="+dbid+"&iid="+iid+"&iq=1")}}};