// Copyright (c) 2000-2007 Unidocs. All rights reserved.
function directPageMove(){var fv=document.pageGoFrm.jumpno;var pageno=fv.value;if(pageno.length==0){alert(BookMsgList[am]["PLZ_WRITE_PAGENO"]);fv.value=(g+1);if(fv.value==0)fv.value=1;return}if(!hm(pageno)){alert(BookMsgList[am]["PLZ_USE_NUMBER"]);fv.value=(g+1);if(fv.value==0)fv.value=1;return}pageno=parseInt(pageno);var destPage=pageno+ja;if(destPage>=ah){if(am=='en')alert('[Page no :'+pageno+'] does not exist.');fv.value=(g+1);if(fv.value==0)fv.value=1}else if(g==destPage){document.pageGoFrm.jumpno.value=(g+1);if(document.pageGoFrm.jumpno.value==0)document.pageGoFrm.jumpno.value=1;if(ev)alert(BookMsgList[am]["SAME_PAGE_NO"]);else et(BookMsgList[am]["SAME_PAGE_NO"]);}else{if(g==ah-1)gl();jm();he();if(destPage<g)movePageIndex(PAGE_DIRECTION_LEFT,destPage);else movePageIndex(PAGE_DIRECTION_RIGHT,destPage);}document.onkeydown=iw}function goToFirstPage(){jm();he();movePageIndex(PAGE_DIRECTION_LEFT,-1);}function goToLastPage(){jm();he();movePageIndex(PAGE_DIRECTION_RIGHT,ah-1);}function movePageIndex(fu,pageno){if(ds)return;var uq=pageno%2;if(uq==0)--pageno;if(g!=pageno){if(g<=0){if(pageno<0){if(ev)alert(BookMsgList[am]["FIRST_PAGE"]);else et(BookMsgList[am]["FIRST_PAGE"]);}else{if(m==ab){hideLayer(document.getElementById("RightBottomImgLayer"));openBookFold(parseInt(document.getElementById("RightTopImgLayer").style.left),pageno);}else if(m==ag){hideLayer(document.getElementById("RightTopImgLayer"));openBookFold(parseInt(document.getElementById("RightBottomImgLayer").style.left),pageno);}}}else{movePage(fu,pageno);}}else{document.pageGoFrm.jumpno.value=(g+1);if(document.pageGoFrm.jumpno.value==0)document.pageGoFrm.jumpno.value=1;if(ev)alert(BookMsgList[am]["SAME_PAGE_NO"]);else et(BookMsgList[am]["SAME_PAGE_NO"]);}}function changeImg(which){printWhich=which;if(which==1){if(g==-1)viewSrc.src="common/blank.gif";else viewSrc.src=dm('medium',g);viewSrc.style.width=150;viewSrc.style.height=150;viewSrc2.style.width=0;viewSrc2.style.height=0}else if(which==2){if(g==ah-1){viewSrc.src="common/blank.gif";viewSrc.style.width=150;viewSrc.style.height=150;viewSrc2.style.width=0;viewSrc2.style.height=0}else{viewSrc.src=dm('medium',g+1);viewSrc.style.width=150;viewSrc.style.height=150;viewSrc2.style.width=0;viewSrc2.style.height=0}}else if(which==3){if(g==-1){viewSrc.src=dm('medium',g+1);viewSrc.style.width=150;viewSrc.style.height=150;viewSrc2.style.width=0;viewSrc2.style.height=0}else if(g==ah-1){viewSrc.src=dm('medium',g);viewSrc.style.width=150;viewSrc.style.height=150;viewSrc2.style.width=0;viewSrc2.style.height=0}else{viewSrc.src=dm('medium',g);viewSrc.style.width=75;viewSrc.style.height=150;viewSrc2.src=dm('medium',g+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 ht;function waitPrinting(){clearTimeout(printWaitTimer);if(ht==20){if(!mg&&glbSourceDoc!=''){var ku="";ku+='<object type="application/pdf" classid="CLSID:CA8A9780-280D-11CF-A24D-444553540000" id="PdfPlugin" width="0" height="0">';ku+='<param name="SRC" value="'+dp+'/media/'+glbSourceDoc+'">';ku+='</object>';document.body.insertAdjacentHTML('beforeEnd',ku);mg=true}waitMesg.innerHTML=BookMsgList[am]["PREPARE_PRINTING"];;v(document.getElementById("PdfWaitingLayer"));ht=0;printWaitTimer=setTimeout("waitPrinting2()",50);}else{ht++;setTimeout("waitPrinting()",50);}}function waitPrinting2(){clearTimeout(printWaitTimer);if(ht==20){if(printWhich==1){if((g+1)==0)PdfPlugin.printPagesFit(1,1,1);else PdfPlugin.printPagesFit(g+1,g+1,1);}else if(printWhich==2)PdfPlugin.printPagesFit(g+2,g+2,1);else if(printWhich==3)PdfPlugin.printPagesFit(g+1,g+2,1);else if(printWhich==4){var startObj=document.chechBoxSel.printStart.value;var endObj=document.chechBoxSel.printEnd.value;if(startObj.length==0){alert(BookMsgList[am]["PRINT_START_NO_NEED"]);hideLayer(document.getElementById("PdfWaitingLayer"));return}if(endObj.length==0){alert(BookMsgList[am]["PRINT_END_NO_NEED"]);hideLayer(document.getElementById("PdfWaitingLayer"));return}if(!hm(startObj)){alert(BookMsgList[am]["PLZ_USE_NUMBER"]);startObj="";hideLayer(document.getElementById("PdfWaitingLayer"));return}if(!hm(endObj)){alert(BookMsgList[am]["PLZ_USE_NUMBER"]);endObj="";hideLayer(document.getElementById("PdfWaitingLayer"));return}var startPageno=parseInt(startObj);var endPageno=parseInt(endObj);if(1>startPageno||startPageno>ah){if(am=='en')alert('Beginning page number must exist in 1 ~ '+ah);hideLayer(document.getElementById("PdfWaitingLayer"));return}if(1>endPageno||endPageno>ah){if(am=='en')alert('End page number must exist in 1 ~ '+ah);hideLayer(document.getElementById("PdfWaitingLayer"));return}if(startPageno>endPageno){alert(BookMsgList[am]["NEED_BIGGER_PAGE_NO"]);hideLayer(document.getElementById("PdfWaitingLayer"));return}PdfPlugin.printPagesFit(startPageno,endPageno,1);document.onkeydown=iw}ht=0;hideLayer(document.getElementById("PdfWaitingLayer"));}else{ht++;setTimeout("waitPrinting2()",50);}}function printPDF(){if(!mg&&glbSourceDoc!=''){waitMesg.innerHTML=BookMsgList[am]["LOADING_PDF_DOC"];document.getElementById("PdfWaitingLayer").style.left=Math.ceil((ix-300)/2);document.getElementById("PdfWaitingLayer").style.top=Math.ceil((iy-60)/2);v(document.getElementById("PdfWaitingLayer"));}ht=0;printWaitTimer=setTimeout("waitPrinting()",50);}function printImage(){if(printWhich==3||printWhich==4){alert(BookMsgList[am]["IMAGE_PRINTING"]);return}var cj=(650/ak);var qp=(980/aq);if(cj>qp)cj=qp;var cc=document.createElement("DIV");ur(cc,cj);var pageno=g+1;if(printWhich==2)pageno=g+2;if(pageno==0)pageno=1;else if(pageno>ah)pageno=ah;if(g==-1&&printWhich==1){if(ev)alert(BookMsgList[am]["IMAGE_PRINTING_THIS"]);else et(BookMsgList[am]["IMAGE_PRINTING_THIS"]);}else if(g+1>=ah&&printWhich==2){if(ev)alert(BookMsgList[am]["IMAGE_PRINTING_THIS"]);else et(BookMsgList[am]["IMAGE_PRINTING_THIS"]);}else{for(i=0;i<=iz-1;i++){for(j=0;j<=hl-1;j++){var ap=document.createElement("IMG");us(ap,j,i,pageno,cj);cc.appendChild(ap);}}printContents=cc.outerHTML;window.onbeforeprint=beforeDivs;window.onafterprint=ut;window.print();}}var printContents;function beforeDivs(){divArrays=new Array();hideDivs();document.getElementById("objSelection").innerHTML=printContents}function ut(){document.getElementById("objSelection").innerHTML="";uu();}function ur(target,cj){target.id="LargePrintGridDiv";target.style.cursor="hand";target.style.position="absolute";target.style.overflow="hidden";target.style.visibility="visible";target.style.left=0;target.style.top=0;target.style.width=ak*cj;target.style.height=aq*cj;target.style.zIndex=1000;return target;}function us(ao,ay,az,pageno,cj){var pageStr=''+pageno;var eg='';switch(pageStr.length){case 1:pageStr="000"+pageStr;break;case 2:pageStr="00"+pageStr;break;case 3:pageStr="0"+pageStr;break}var di=''+az;switch(di.length){case 1:di="00"+di;break;case 2:di="0"+di;break}var dj=''+ay;switch(dj.length){case 1:dj="00"+dj;break;case 2:dj="0"+dj;break}pageStr=hg+'_'+pageStr+'_'+di+'_'+dj;if(fz&&fy&&EN_FULLDRAW)eg=fl+'ext_large/'+gc(pageStr).toUpperCase()+'.jpg';else eg=fl+'large/'+gc(pageStr).toUpperCase()+'.jpg';var eh=0;var ei=0;if(ay==hl-1&&hj!=0)eh=hj;else eh=ar;if(az==iz-1&&hk!=0)ei=hk;else ei=db;var es="Print_Large_"+ay+"_"+az;ao.src=eg;ao.id=es;ao.style.position="absolute";ao.style.overflow="hidden";ao.style.left=Math.ceil(ar*ay*cj);ao.style.top=Math.ceil(db*az*cj);ao.style.width=Math.ceil(eh*cj);ao.style.height=Math.ceil(ei*cj);ao.style.alt=""}function xs(){gk("PrintPageNo_LEFT");gk("PrintPageNo_RIGHT");fw("PrintPageNo_LEFT",dm('medium',g));fw("PrintPageNo_RIGHT",dm('medium',g+1));fw("PrintPageNo_LEFT_pno",g);fw("PrintPageNo_RIGHT_pno",g+1);fw("TotalPageCount",dg);uv(dp);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(am=='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");}function openLinkWindow(uw){open(uw,"","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==''){if(ev)alert(BookMsgList[am]["BOARD_NOT_FOUND"]);else et(BookMsgList[am]["BOARD_NOT_FOUND"]);return}openLinkWindow(boardLinkUrl);}divArrays=new Array();function divAtt(){this.obj;this.display}function hideDivs(){if(document.all){var divs=document.all.tags('DIV');var divObj;for(var d=0;d<divs.length;d++){if(divs[d]!=objSelection){divObj=new divAtt();divObj.obj=divs[d];divObj.display=divs[d].style.display;divArrays[d]=divObj;divs[d].style.display='none'}}}else if(document.layers){for(var l=0;l<document.layers.length;l++)if(document.layers[l]!=objSelection)document.layers[l].visibility='hide'}}function uu(){try{for(var d=0;d<divArrays.length;d++){if(divArrays[d]&&divArrays[d].obj)eval(divArrays[d].obj).style.display=divArrays[d].display;}}catch(e){alert(e.description);}hideLayer(objSelection);}