function SetImage(){var a=YAHOO.util.Dom.get("htmlImage");a.src=szImageURL+"&vx=0&vy=0&vw="+vw+"&vh="+vh+"&zp="+zp+"&qf="+iqString+"&rc="+rc+"&sh=0&sw=0";a.width=vw;a.height=vh}function Submit(){Navigate(szBaseURL+"&rc="+rc+"&zp="+zp)}function GoToInstall(){installUrl=installUrl.replace("&a=0","");Navigate(installUrl+"&a=1")}function Navigate(a){if(document.fNavigate){document.fNavigate.action=a;document.fNavigate.submit()}else{window.location.href=a}}function SetZoom(a){s_objectID="h_zoom";zp=a;vw=Math.round(iw*zp/100);vh=Math.round(ih*zp/100);SetZoomDivs(zp);SetImage();SetZoomCookie()}function SetZoomSel(a){var b=document.getElementById("zoom");if("undefined"!=typeof b&&null!=b&&undefined!=b&&""!=b){for(i=0;i<b.length;i++){if(a==b.options[i].value){b.selectedIndex=i;break}}}}function SetZoomDivs(a){if(a>=100){YAHOO.util.Dom.addClass("zoomIn","disabled")}else{YAHOO.util.Dom.removeClass("zoomIn","disabled")}if(a<=25){YAHOO.util.Dom.addClass("zoomOut","disabled")}else{YAHOO.util.Dom.removeClass("zoomOut","disabled")}}function ZoomOut(){var a=document.getElementById("zoom");if(a.selectedIndex>0){a.selectedIndex=a.selectedIndex-1;SetZoom(a.options[a.selectedIndex].value)}}function ZoomIn(){var a=document.getElementById("zoom");if(a.selectedIndex<a.length-1){a.selectedIndex=a.selectedIndex+1;SetZoom(a.options[a.selectedIndex].value)}}function GotoImage(a){if(currentImageNo!=a){var b="/Browse/View.aspx?dbid="+dbid+"&path="+imagePath+"."+a;var c=isNaN(parseInt(a));if(isBook){b="/Browse/BookView.aspx?dbid="+dbid+"&pageno="+a}if(c||a<1||a>cImages){numRange=numRange.replace("{0}",cImages);alert(numRange)}else{if(1!=a||1!=cImages){Navigate(b)}}}return false}function PrevPage(){if(prevUrl.length>0){Navigate(prevUrl)}}function NextPage(){if(nextUrl.length>0){Navigate(nextUrl)}}function Help(){window.open("/Browse/help_u.aspx","Help","toolbar=no,scrollbars=1,resizable=1,menubar=no,location=no,height=375,width=456")}function Share(){EmailFriend()}function PrintPopup(f){OptionsPopup(false);SavePopup(false);if("undefined"==typeof OrderPrint){Print()}else{var b;if(f){b=document.getElementById("orderPrintDialogHtml")}else{b=document.getElementById("printDialogHtml")}if(null!=b){var e=b.getAttribute("width");var d=b.getAttribute("height");var c=Math.max(0,(document.body.clientWidth/2)-(e/2));var a=Math.max(0,(document.body.clientHeight/3)-(d/2));b.style.left=Math.round(c);b.style.top=Math.round(a);b.style.width=e;b.style.height=d;b.style.position="absolute";b.style.zIndex=3;b.style.backgroundColor="#EEEEEE";b.style.border="1px solid #999999";b.style.display="block"}else{Print()}}}function printDialogPrint(){var a=new Image();var b="/handler/ajax/SuccessHandler.ashx?op=Write&dbid="+dbid+"&unq="+Math.floor(Math.random()*1999999999)+"&pagetype=Image&successtype="+SuccessType+"&eventtype=print";a.src=b;printDialogCancel();Print()}function printDialogCancel(){var a;a=document.getElementById("orderPrintDialogHtml");if(null!=a){a.style.display="none"}a=document.getElementById("printDialogHtml");if(null!=a){a.style.display="none"}}function Print(){window.open("/Browse/print_u.aspx?"+printUrlParams,"Print")}function printDialogGotoApress(b,d,c){printDialogCancel();var f=TGN.Ancestry.Search.CV.selectedPid;var a="http://"+b+"/index.aspx?action="+d+"&ppvhash="+ppv+"&dbid="+dbid+"&iid="+iid+"&pid="+f+c;var e=window.open(a,"_blank","status=0,location=0,toolbar=0,menubar=0,resizable=1,scrollbars=1,titlebar=0");if(e!=null){e.focus()}}function SavePopup(a){var b;if(a){OptionsPopup(false);printDialogCancel();if("undefined"==typeof SaveThis){Save()}else{if("undefined"==typeof SaveOwt){var c=document.getElementById("owtLink");c.style.display="none"}b=document.getElementById("saveHTML");b.style.left=document.body.offsetWidth/2-250;b.style.top=185;b.style.display="block"}}else{b=document.getElementById("saveHTML");b.style.display="none"}}function OkSave(b){document.getElementById("saveHTML").style.display="none";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(){if(tiled){window.open("/Browse/print_u.aspx?"+printUrlParams,"Save")}else{alert(copyAlert)}}function OptionsPopup(a){if(a){printDialogCancel();SavePopup(false)}var b=document.getElementById("optionsHTML");b.style.left=document.body.offsetWidth/2-134;b.style.top=150;b.style.display=a?"block":"none"}function SetZoomCookie(){window.focus();setDictionaryCookie("BROWSES","Z"+dbid,escape(zp*2),null,null)}function SetCookieIQ(){setDictionaryCookie("BROWSE","XIQ",iq,null,"Tue, 02 Jan 2035 00:00:00 UTC");iq==0?iqString="mc":iqString="pq"}function SetCookieIC(){setDictionaryCookie("BROWSE","XIC",ic,null,"Tue, 02 Jan 2035 00:00:00 UTC")}var goToInstall=false;function ToggleViewer(){var a=document.getElementById("viewer");if(a!=null){if(a[0]==undefined){if(a.checked){GoToInstall();goToInstall=true}}else{if(a[0].checked){GoToInstall();goToInstall=true}}}}function ToggleQuality(){var a=iq;var b=document.getElementById("quality");if(b==undefined){if(b.checked){iq="0"}else{iq="1"}}else{if(b.checked){iq="0"}else{iq="1"}}SetCookieIQ(iq);if(0==a&&1==iq&&goToInstall==false){Navigate(szBaseURL+"&rc="+rc+"&qf=pq")}}function SetOptionsValues(){document.getElementById("quality").checked=(iq==0);document.getElementById("viewer").checked=false}function OkOptions(){OptionsOk()}function OptionsOk(){ToggleViewer();ToggleQuality()}function hv_checkZoom(){if(!imgShowZoom){var a=0}}function hv_checkDimensions(){if(iw==0||ih==0){var a=YAHOO.util.Dom.get("htmlImage");ih=a.height;iw=a.width}}SetZoomDivs(zp);SetZoomSel(zp);hv_checkZoom();hv_checkDimensions();