// Copyright (c) 2000-2005 Unidocs. All rights reserved.
function directPageMove(){var jj=document.pageGoFrm.jumpno;var pageno=jj.value;if(pageno.length==0){alert(BookMsgList[an]["PLZ_WRITE_PAGENO"]);jj.value=(m+1);return}if(!go(pageno)){alert(BookMsgList[an]["PLZ_USE_NUMBER"]);jj.value=(m+1);return}pageno=parseInt(pageno);var destPage=pageno+gn;if(destPage>=af){if(an=='en')alert('[Page no :'+pageno+'] does not exist.');jj.value=(m+1);}else{if(m==af-1)fz();ig();fy();if(destPage<m)movePageIndex(PAGE_DIRECTION_LEFT,destPage);else movePageIndex(PAGE_DIRECTION_RIGHT,destPage);}document.onkeydown=hk}function goToFirstPage(){ig();fy();movePageIndex(PAGE_DIRECTION_LEFT,-1);}function goToLastPage(){ig();fy();movePageIndex(PAGE_DIRECTION_RIGHT,af-1);}function movePageIndex(ft,pageno){if(dl)return;var sj=pageno%2;if(sj==0)--pageno;if(m!=pageno){if(m<=0){if(pageno<0)alert(BookMsgList[an]["FIRST_PAGE"]);else{if(o==r){hideLayer(RightBottomImgLayer);openBookFold(parseInt(RightTopImgLayer.style.left),pageno);}else if(o==u){hideLayer(RightTopImgLayer);openBookFold(parseInt(RightBottomImgLayer.style.left),pageno);}}}else{movePage(ft,pageno);}}else{alert(BookMsgList[an]["SAME_PAGE_NO"]);document.pageGoFrm.jumpno.value=(m+1);}}function changeImg(which){printWhich=which;if(which==1){if(m==-1)viewSrc.src=cr('medium',m+1);else viewSrc.src=cr('medium',m);viewSrc.style.width=150;viewSrc.style.height=150;viewSrc2.style.width=0;viewSrc2.style.height=0}else if(which==2){if(m==af-1){viewSrc.src=cr('medium',m);viewSrc.style.width=150;viewSrc.style.height=150;viewSrc2.style.width=0;viewSrc2.style.height=0}else{viewSrc.src=cr('medium',m+1);viewSrc.style.width=150;viewSrc.style.height=150;viewSrc2.style.width=0;viewSrc2.style.height=0}}else if(which==3){if(m==-1){viewSrc.src=cr('medium',m+1);viewSrc.style.width=150;viewSrc.style.height=150;viewSrc2.style.width=0;viewSrc2.style.height=0}else if(m==af-1){viewSrc.src=cr('medium',m);viewSrc.style.width=150;viewSrc.style.height=150;viewSrc2.style.width=0;viewSrc2.style.height=0}else{viewSrc.src=cr('medium',m);viewSrc.style.width=75;viewSrc.style.height=150;viewSrc2.src=cr('medium',m+1);viewSrc2.style.width=75;viewSrc2.style.height=150}}if(which==4){if(glbSourceDoc!=''){chechBoxSel.printStart.readOnly=false;chechBoxSel.printEnd.readOnly=false;chechBoxSel.printStart.style.backgroundColor="#FFFFFF";chechBoxSel.printEnd.style.backgroundColor="#FFFFFF"}}else{if(glbSourceDoc!=''){chechBoxSel.printStart.readOnly=true;chechBoxSel.printEnd.readOnly=true;chechBoxSel.printStart.style.backgroundColor="#e8e8e8";chechBoxSel.printEnd.style.backgroundColor="#e8e8e8";chechBoxSel.printStart.value="";chechBoxSel.printEnd.value=""}}}var printWaitTimer;var gj;function waitPrinting(){clearTimeout(printWaitTimer);if(gj==20){if(!kz&&glbSourceDoc!=''){var jk="";jk+='<object type="application/pdf" classid="CLSID:CA8A9780-280D-11CF-A24D-444553540000" id="PdfPlugin" width="0" height="0">';jk+='<param name="SRC" value="../../../library/'+parent.p_viewer.bookid.value+'/logo/'+glbSourceDoc+'">';jk+='</object>';document.body.insertAdjacentHTML('beforeEnd',jk);kz=true}waitMesg.innerHTML=BookMsgList[an]["PREPARE_PRINTING"];;ac(PdfWaitingLayer);gj=0;printWaitTimer=setTimeout("waitPrinting2()",50);}else{gj++;setTimeout("waitPrinting()",50);}}function waitPrinting2(){clearTimeout(printWaitTimer);if(gj==20){if(printWhich==1){if((m+1)==0)PdfPlugin.printPages(1,1);else PdfPlugin.printPages(m+1,m+1);}else if(printWhich==2)PdfPlugin.printPages(m+2,m+2);else if(printWhich==3)PdfPlugin.printPages(m+1,m+2);else if(printWhich==4){var jl=document.chechBoxSel.printStart.value;var endObj=document.chechBoxSel.printEnd.value;if(jl.length==0){alert(BookMsgList[an]["PRINT_START_NO_NEED"]);hideLayer(PdfWaitingLayer);return}if(endObj.length==0){alert(BookMsgList[an]["PRINT_END_NO_NEED"]);hideLayer(PdfWaitingLayer);return}if(!go(jl)){alert(BookMsgList[an]["PLZ_USE_NUMBER"]);jl="";hideLayer(PdfWaitingLayer);return}if(!go(endObj)){alert(BookMsgList[an]["PLZ_USE_NUMBER"]);endObj="";hideLayer(PdfWaitingLayer);return}var jm=parseInt(jl);var endPageno=parseInt(endObj);if(1>jm||jm>af){if(an=='en')alert('Beginning page number must exist in 1 ~ '+af);hideLayer(PdfWaitingLayer);return}if(1>endPageno||endPageno>af){if(an=='en')alert('End page number must exist in 1 ~ '+af);hideLayer(PdfWaitingLayer);return}if(jm>endPageno){alert(BookMsgList[an]["NEED_BIGGER_PAGE_NO"]);hideLayer(PdfWaitingLayer);return}PdfPlugin.printPages(jm,endPageno);document.onkeydown=hk}gj=0;hideLayer(PdfWaitingLayer);}else{gj++;setTimeout("waitPrinting2()",50);}}function printPDF(){if(!kz&&glbSourceDoc!=''){waitMesg.innerHTML=BookMsgList[an]["LOADING_PDF_DOC"];PdfWaitingLayer.style.left=Math.ceil((hl-300)/2);PdfWaitingLayer.style.top=Math.ceil((ip-60)/2);ac(PdfWaitingLayer);}gj=0;printWaitTimer=setTimeout("waitPrinting()",50);}function printImage(){if(printWhich==3||printWhich==4){alert(BookMsgList[an]["IMAGE_PRINTING"]);return}var cb=(650/ai);var pa=(980/at);if(cb>pa)cb=pa;var az=document.createElement("DIV");sk(az,cb);var pageno=m+1;if(printWhich==2)pageno=m+2;if(pageno==0)pageno=1;for(i=0;i<=ho-1;i++){for(j=0;j<=gc-1;j++){var am=document.createElement("IMG");sl(am,j,i,pageno,cb);az.appendChild(am);}}printContents=az.outerHTML;window.onbeforeprint=beforeDivs;window.onafterprint=sm;window.print();}var printContents;function beforeDivs(){objSelection.innerHTML=printContents}function sm(){objSelection.innerHTML=""}function sk(target,cb){with(target){id="LargePrintGridDiv";with(style){cursor="hand";position="absolute";overflow="hidden";visibility="visible";left=0;top=0;width=ai*cb;height=at*cb;zIndex=1000}}return target;}function sl(gg,ax,ay,pageno,cb){var pageStr=''+pageno;var ei='';switch(pageStr.length){case 1:pageStr="000"+pageStr;break;case 2:pageStr="00"+pageStr;break;case 3:pageStr="0"+pageStr;break}var cs=''+ay;switch(cs.length){case 1:cs="00"+cs;break;case 2:cs="0"+cs;break}var ct=''+ax;switch(ct.length){case 1:ct="00"+ct;break;case 2:ct="0"+ct;break}pageStr+='_'+cs+'_'+ct;ei=gm+'large/'+hz(pageStr).toUpperCase()+'.jpg';var dp=0;var dq=0;if(ax==gc-1&&ga!=0)dp=ga;else dp=ao;if(ay==ho-1&&gb!=0)dq=gb;else dq=cp;var eb="Print_Large_"+ax+"_"+ay;with(gg){src=ei;id=eb;with(style){position="absolute";overflow="hidden";left=Math.ceil(ao*ax*cb);top=Math.ceil(cp*ay*cb);width=Math.ceil(dp*cb);height=Math.ceil(dq*cb);alt=""}}}function ve(){fl("PrintPageNo_LEFT");fl("PrintPageNo_RIGHT");fd("PrintPageNo_LEFT",cr('medium',m));fd("PrintPageNo_RIGHT",cr('medium',m+1));fd("PrintPageNo_LEFT_pno",m);fd("PrintPageNo_RIGHT_pno",m+1);fd("TotalPageCount",db);sn(cz);open("print.html","eBookPrint","left=100, top=100, width=1024, height=768, directories=no, status=no, location=no, menubar=no, scrollbars=no, resizable=1, fullscreen=no");}function openHelpWindow(){if(an=='en')open("../../common/help/en/help.html","eBookHelp","left=100, top=100, width=460, height=730, directories=no, status=no, location=no, menubar=no, scrollbars=yes, resizable=0, fullscreen=no");else open("../../common/help/help.html","eBookHelp","left=100, top=100, width=460, height=730, directories=no, status=no, location=no, menubar=no, scrollbars=yes, resizable=0, fullscreen=no");}function openLinkWindow(so){open(so,"","left=100, top=100, width=800, height=600, directories=yes, status=yes, location=yes, menubar=yes, scrollbars=yes, resizable=1, fullscreen=no");}function openBoard(){if(boardLinkUrl==''){alert(BookMsgList[an]["BOARD_NOT_FOUND"]);return}openLinkWindow(boardLinkUrl);}function hideDivs(){if(document.all){var divs=document.all.tags('DIV');for(var d=0;d<divs.length;d++)if(divs[d]!=div2print)divs[d].style.display='none'}else if(document.layers){for(var l=0;l<document.layers.length;l++)if(document.layers[l]!=div2print)document.layers[l].visibility='hide'}}function vf(){var divs=document.all.tags('DIV');for(var d=0;d<divs.length;d++)divs[d].style.display='block';hideLayer(PrintLayer);}