// Copyright (c) 2000-2005 Unidocs. All rights reserved.
function directPageMove(){var fm=document.pageGoFrm.jumpno;
var pageno=fm.value;
if(pageno.length==0){alert(BookMsgList[aj]["PLZ_WRITE_PAGENO"]);
fm.value=(m+1);
if(fm.value==0)fm.value=1;
return}if(!ih(pageno)){alert(BookMsgList[aj]["PLZ_USE_NUMBER"]);
fm.value=(m+1);
if(fm.value==0)fm.value=1;
return}pageno=parseInt(pageno);
var destPage=pageno+hd;
if(destPage>=af){if(aj=='en')alert('[Page no :'+pageno+'] does not exist.');
else alert('[ÆäÀÌÁö ¹øÈ£ :'+pageno+']´Â Á¸ÀçÇÏÁö ¾Ê´Â ÆäÀÌÁö ÀÔ´Ï´Ù.');
fm.value=(m+1);
if(fm.value==0)fm.value=1}else if(m==destPage){document.pageGoFrm.jumpno.value=(m+1);
if(document.pageGoFrm.jumpno.value==0)document.pageGoFrm.jumpno.value=1;
if(fc)alert(BookMsgList[aj]["SAME_PAGE_NO"]);
else ez(BookMsgList[aj]["SAME_PAGE_NO"]);
}else{if(m==af-1)gq();
ix();
gp();
if(destPage<m)movePageIndex(PAGE_DIRECTION_LEFT,destPage);
else movePageIndex(PAGE_DIRECTION_RIGHT,destPage);
}document.onkeydown=hz}function goToFirstPage(){ix();
gp();
movePageIndex(PAGE_DIRECTION_LEFT,-1);
}function goToLastPage(){ix();
gp();
movePageIndex(PAGE_DIRECTION_RIGHT,af-1);
}function movePageIndex(gi,pageno){if(dq)return;
var tz=pageno%2;
if(tz==0)--pageno;
if(m!=pageno){if(m<=0){if(pageno<0){if(fc)alert(BookMsgList[aj]["FIRST_PAGE"]);
else ez(BookMsgList[aj]["FIRST_PAGE"]);
}else{if(o==r){hideLayer(RightBottomImgLayer);
openBookFold(parseInt(RightTopImgLayer.style.left),pageno);
}else if(o==v){hideLayer(RightTopImgLayer);
openBookFold(parseInt(RightBottomImgLayer.style.left),pageno);
}}}else{movePage(gi,pageno);
}}else{document.pageGoFrm.jumpno.value=(m+1);
if(document.pageGoFrm.jumpno.value==0)document.pageGoFrm.jumpno.value=1;
if(fc)alert(BookMsgList[aj]["SAME_PAGE_NO"]);
else ez(BookMsgList[aj]["SAME_PAGE_NO"]);
}}function changeImg(which){printWhich=which;
if(which==1){if(m==-1)viewSrc.src=da('medium',m+1);
else viewSrc.src=da('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=da('medium',m);
viewSrc.style.width=150;
viewSrc.style.height=150;
viewSrc2.style.width=0;
viewSrc2.style.height=0}else{viewSrc.src=da('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=da('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=da('medium',m);
viewSrc.style.width=150;
viewSrc.style.height=150;
viewSrc2.style.width=0;
viewSrc2.style.height=0}else{viewSrc.src=da('medium',m);
viewSrc.style.width=75;
viewSrc.style.height=150;
viewSrc2.src=da('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 ha;
function waitPrinting(){clearTimeout(printWaitTimer);
if(ha==20){if(!ly&&glbSourceDoc!=''){var ke="";
ke+='<object type="application/pdf" classid="CLSID:CA8A9780-280D-11CF-A24D-444553540000" id="PdfPlugin" width="0" height="0">';
ke+='<param name="SRC" value="../../../library/'+parent.p_viewer.bookid.value+'/logo/'+glbSourceDoc+'">';
ke+='</object>';
document.body.insertAdjacentHTML('beforeEnd',ke);
ly=true}waitMesg.innerHTML=BookMsgList[aj]["PREPARE_PRINTING"];
;
ab(PdfWaitingLayer);
ha=0;
printWaitTimer=setTimeout("waitPrinting2()",50);
}else{ha++;
setTimeout("waitPrinting()",50);
}}function waitPrinting2(){clearTimeout(printWaitTimer);
if(ha==20){if(printWhich==1){if((m+1)==0)PdfPlugin.printPagesFit(1,1,true);
else PdfPlugin.printPagesFit(m+1,m+1,true);
}else if(printWhich==2)PdfPlugin.printPagesFit(m+2,m+2,true);
else if(printWhich==3)PdfPlugin.printPagesFit(m+1,m+2,true);
else if(printWhich==4){var kf=document.chechBoxSel.printStart.value;
var endObj=document.chechBoxSel.printEnd.value;
if(kf.length==0){alert(BookMsgList[aj]["PRINT_START_NO_NEED"]);
hideLayer(PdfWaitingLayer);
return}if(endObj.length==0){alert(BookMsgList[aj]["PRINT_END_NO_NEED"]);
hideLayer(PdfWaitingLayer);
return}if(!ih(kf)){alert(BookMsgList[aj]["PLZ_USE_NUMBER"]);
kf="";
hideLayer(PdfWaitingLayer);
return}if(!ih(endObj)){alert(BookMsgList[aj]["PLZ_USE_NUMBER"]);
endObj="";
hideLayer(PdfWaitingLayer);
return}var kg=parseInt(kf);
var endPageno=parseInt(endObj);
if(1>kg||kg>af){if(aj=='en')alert('Beginning page number must exist in 1 ~ '+af);
else alert('½ÃÀÛ ÆäÀÌÁö ¹øÈ£°¡ 1 ~ '+af+' ³»¿¡ Á¸Àç ÇÏ¿©¾ß ÇÕ´Ï´Ù');
hideLayer(PdfWaitingLayer);
return}if(1>endPageno||endPageno>af){if(aj=='en')alert('End page number must exist in 1 ~ '+af);
else alert('³¡ ÆäÀÌÁö ¹øÈ£°¡ 1 ~ '+af+' ³»¿¡ Á¸Àç ÇÏ¿©¾ß ÇÕ´Ï´Ù');
hideLayer(PdfWaitingLayer);
return}if(kg>endPageno){alert(BookMsgList[aj]["NEED_BIGGER_PAGE_NO"]);
hideLayer(PdfWaitingLayer);
return}PdfPlugin.printPagesFit(kg,endPageno,true);
document.onkeydown=hz}ha=0;
hideLayer(PdfWaitingLayer);
}else{ha++;
setTimeout("waitPrinting2()",50);
}}function printPDF(){if(!ly&&glbSourceDoc!=''){waitMesg.innerHTML=BookMsgList[aj]["LOADING_PDF_DOC"];
PdfWaitingLayer.style.left=Math.ceil((ic-300)/2);
PdfWaitingLayer.style.top=Math.ceil((ie-60)/2);
ab(PdfWaitingLayer);
}ha=0;
printWaitTimer=setTimeout("waitPrinting()",50);
}function printImage(){if(printWhich==3||printWhich==4){alert(BookMsgList[aj]["IMAGE_PRINTING"]);
return}var cc=(650/ai);
var ql=(980/ao);
if(cc>ql)cc=ql;
var az=document.createElement("DIV");
ua(az,cc);
var pageno=m+1;
if(printWhich==2)pageno=m+2;
if(pageno==0)pageno=1;
for(i=0; i<=ig-1; i++){for(j=0; j<=gt-1; j++){var am=document.createElement("IMG");
ub(am,j,i,pageno,cc);
az.appendChild(am);
}}printContents=az.outerHTML;
window.onbeforeprint=beforeDivs;
window.onafterprint=uc;
window.print();
}var printContents;
function beforeDivs(){divArrays=new Array();
hideDivs();
objSelection.innerHTML=printContents}function uc(){objSelection.innerHTML="";
ud();
}function ua(target,cc){with(target){id="LargePrintGridDiv";
with(style){cursor="hand";
position="absolute";
overflow="hidden";
visibility="visible";
left=0;
top=0;
width=ai*cc;
height=ao*cc;
zIndex=1000}}return target;
}function ub(gx,ax,ay,pageno,cc){var pageStr=''+pageno;
var dt='';
switch(pageStr.length){case 1:pageStr="000"+pageStr;
break;
case 2:pageStr="00"+pageStr;
break;
case 3:pageStr="0"+pageStr;
break}var db=''+ay;
switch(db.length){case 1:db="00"+db;
break;
case 2:db="0"+db;
break}var dc=''+ax;
switch(dc.length){case 1:dc="00"+dc;
break;
case 2:dc="0"+dc;
break}pageStr+='_'+db+'_'+dc;
if(fq&&fp&&EN_FULLDRAW)dt=fd+'ext_large/'+fu(pageStr).toUpperCase()+'.jpg';
else dt=fd+'large/'+fu(pageStr).toUpperCase()+'.jpg';
var du=0;
var dv=0;
if(ax==gt-1&&gr!=0)du=gr;
else du=an;
if(ay==ig-1&&gs!=0)dv=gs;
else dv=cs;
var eh="Print_Large_"+ax+"_"+ay;
with(gx){src=dt;
id=eh;
with(style){position="absolute";
overflow="hidden";
left=Math.ceil(an*ax*cc);
top=Math.ceil(cs*ay*cc);
width=Math.ceil(du*cc);
height=Math.ceil(dv*cc);
alt=""}}}function wv(){gb("PrintPageNo_LEFT");
gb("PrintPageNo_RIGHT");
fn("PrintPageNo_LEFT",da('medium',m));
fn("PrintPageNo_RIGHT",da('medium',m+1));
fn("PrintPageNo_LEFT_pno",m);
fn("PrintPageNo_RIGHT_pno",m+1);
fn("TotalPageCount",cp);
ue(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(aj=='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(uf){open(uf,"","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(fc)alert(BookMsgList[aj]["BOARD_NOT_FOUND"]);
else ez(BookMsgList[aj]["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 ud(){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);
}
