var cntx,antx,tntx;var catImageLN,catImageRN;var EncObj,GuideObj;var SmcObj={width:0,height:0,wRatio:1.0,hRatio:1.0,dblClickTimer:undefined,touchDownTime:0,touchUpTime:0,leftUrl:'',leftName:'',leftDir:'',rightUrl:'',rightName:'',rightDir:'',bufWidth:[],bufHeight:[],imgobj:undefined,imgGrpobj:undefined,leftBack:undefined,leftImgGrp:undefined,leftImg:undefined,rightBack:undefined,rightImgGrp:undefined,rightImg:undefined,leftLink:undefined,leftSearch:undefined,rightLink:undefined,rightSearch:undefined,leftImgBef:undefined,rightImgBef:undefined,leftApproved:true,rightApproved:true,firstLoading:true,loadto:0,loaded:0,storedPage:0,direction:'',together:false,drawL:0,drawR:0,tempN:0,downKind:0};function init_smc(){cntx=mainCnv.getContext("2d");cntx.imageSmoothingEnabled=true;if(MoveInfo.pageOverSpeed==="F"){AniObj.transPercent=[0.15,0.28,0.4,0.5,0.59,0.67,0.74,0.8,0.85,0.9,0.95,1.0];AniObj.transLen=AniObj.transPercent.length;AniObj.transInterval=15;AniObj.angleDiv=25;} else{AniObj.transPercent=[0.08,0.15,0.22,0.28,0.34,0.4,0.45,0.5,0.55,0.59,0.63,0.67,0.71,0.74,0.77,0.80,0.83,0.85,0.88,0.90,0.92,0.94,0.96,0.98,1.0];AniObj.transLen=AniObj.transPercent.length;AniObj.transInterval=5;AniObj.angleDiv=45;} SmcObj.imgobj=document.getElementById('smcsvg1');SmcObj.imgGrpobj=document.getElementById('smcntg1');SmcObj.leftImgGrp=document.getElementById('smcImgL1');SmcObj.rightImgGrp=document.getElementById('smcImgR1');SmcObj.leftLink=document.getElementById('smcLinkL1');SmcObj.rightLink=document.getElementById('smcLinkR1');SmcObj.leftSearch=document.getElementById('smcSearchL1');SmcObj.rightSearch=document.getElementById('smcSearchR1');if(Action.mouseTouch===false){if(SkinInfo.smc==="005"){smcDiv.addEventListener("touchstart",SmcObj.do_touchStart,false);smcDiv.addEventListener("touchmove",SmcObj.do_touchMove,false);} else if(MoveInfo.spDrag===true){smcDiv.addEventListener("touchstart",DragObj.do_touchStart,false);smcDiv.addEventListener("touchmove",DragObj.do_touchMove,false);smcDiv.addEventListener("touchend",DragObj.do_touchEnd,false);}} else{if(SkinInfo.smc==="005"){smcDiv.addEventListener("mousedown",SmcObj.do_mouseDown,false);smcDiv.addEventListener("mousemove",SmcObj.do_mouseMove,false);}}} SmcObj.onload_func2=function(){SmcObj.loaded=0;SmcObj.leftUrl="",SmcObj.rightUrl="";var leftLoad=true,rightLoad=true;if(ScreenInfo.onesmc===true){rightLoad=false;SmcObj.loadto=1;} else{if(Action.drawCondition<-1&&PageInfo.currentPage===0&&CataInfo.openingAnimation===true){SmcObj.leftBack=SmcObj.load_backRect();SmcObj.leftImgGrp.appendChild(SmcObj.leftBack);SmcObj.leftImgGrp.setAttribute("visibility","hidden");if(CataInfo.incview==="m")CoverObj.state=1;leftLoad=false;SmcObj.loadto=1;} else{SmcObj.loadto=2;}} SmcObj.wRatio=ScreenInfo.smImageWidth/ScreenInfo.bigImageOriWidth;SmcObj.hRatio=ScreenInfo.smImageHeight/ScreenInfo.bigImageOriHeight;SmcObj.storedPage=PageInfo.currentPage;if(leftLoad===true){if(!SmcObj.leftBack){SmcObj.leftBack=SmcObj.load_backRect();SmcObj.leftImgGrp.appendChild(SmcObj.leftBack);} var bbb=SmcObj.get_imageUrl(PageInfo.currentPage);SmcObj.leftUrl=bbb[0],SmcObj.leftName=bbb[1],SmcObj.leftDir=bbb[2];if(SmcObj.leftUrl!==""){if(ServerInfo.applyCipher===true){SmcObj.leftImg=document.createElementNS("http://www.w3.org/2000/svg","image");SmcObj.load_leftImageCipher('first',PageInfo.currentPage,SmcObj.leftImg,SmcObj.leftUrl,5,true);} else SmcObj.load_leftImage('first',PageInfo.currentPage);} else SmcObj.load_completedFirst();if(SmcObj.leftUrl!==""&&MoveInfo.enlargeClick===true)SmcObj.leftImgGrp.setAttribute("class","enlgcsr");else SmcObj.leftImgGrp.setAttribute("class","normcsr");} if(rightLoad===true){SmcObj.rightImgGrp.setAttribute('transform','translate('+ScreenInfo.smImageWidth+',0)');SmcObj.rightLink.setAttribute('transform','translate('+ScreenInfo.smImageWidth+',0)');SmcObj.rightSearch.setAttribute('transform','translate('+ScreenInfo.smImageWidth+',0)');if(!SmcObj.rightBack){SmcObj.rightBack=SmcObj.load_backRect();SmcObj.rightImgGrp.appendChild(SmcObj.rightBack);} var bbb=SmcObj.get_imageUrl(PageInfo.currentPage+1);SmcObj.rightUrl=bbb[0],SmcObj.rightName=bbb[1],SmcObj.rightDir=bbb[2];if(SmcObj.rightUrl!==""){if(ServerInfo.applyCipher===true){SmcObj.rightImg=document.createElementNS("http://www.w3.org/2000/svg","image");SmcObj.load_rightImageCipher('first',PageInfo.currentPage+1,SmcObj.rightImg,SmcObj.rightUrl,5,false);} else SmcObj.load_rightImage('first',PageInfo.currentPage+1);} else SmcObj.load_completedFirst();if(SmcObj.rightUrl!==""&&MoveInfo.enlargeClick===true)SmcObj.rightImgGrp.setAttribute("class","enlgcsr");else SmcObj.rightImgGrp.setAttribute("class","normcsr");} SmcObj.imgobj.style.width=smRect.width+"px";SmcObj.imgobj.style.height=smRect.height+"px";Action.arWheelClip.push(SmcObj);} SmcObj.load_leftImageEach=function(sover){SmcObj.direction=sover;var bbb=SmcObj.get_imageUrl(PageInfo.currentPage);SmcObj.leftUrl=bbb[0],SmcObj.leftName=bbb[1],SmcObj.leftDir=bbb[2];if(SmcObj.leftImg){SmcObj.leftImgGrp.removeChild(SmcObj.leftImg);SmcObj.leftImg=undefined;} if(SmcObj.leftUrl!==""){if(ServerInfo.applyCipher===true)SmcObj.load_leftImageCipher('each',PageInfo.currentPage);else SmcObj.load_leftImage('each',PageInfo.currentPage);} else SmcObj.after_leftImageLoaded('thru');if(SmcObj.leftUrl!==""&&MoveInfo.enlargeClick===true)SmcObj.leftImgGrp.setAttribute("class","enlgcsr");else SmcObj.leftImgGrp.setAttribute("class","normcsr");} SmcObj.load_rightImageEach=function(sover){SmcObj.direction=sover;var bbb=SmcObj.get_imageUrl(PageInfo.currentPage+1);SmcObj.rightUrl=bbb[0],SmcObj.rightName=bbb[1],SmcObj.rightDir=bbb[2];if(SmcObj.rightImg){SmcObj.rightImgGrp.removeChild(SmcObj.rightImg);SmcObj.rightImg=undefined;} if(SmcObj.rightUrl!==""){if(ServerInfo.applyCipher===true)SmcObj.load_rightImageCipher('each',PageInfo.currentPage+1);else SmcObj.load_rightImage('each',PageInfo.currentPage+1);} else SmcObj.after_rightImageLoaded('thru');if(SmcObj.rightUrl!==""&&MoveInfo.enlargeClick===true)SmcObj.rightImgGrp.setAttribute("class","enlgcsr");else SmcObj.rightImgGrp.setAttribute("class","normcsr");} SmcObj.load_leftImage=function(skd,npage){if(PermitMan.check_memberZone("smimage")===true)SmcObj.leftApproved=PageInfo.is_previewPage(npage);SmcObj.leftImg=SmcObj.load_cataImage(SmcObj.leftUrl,npage,5,false);SmcObj.leftImg.addEventListener("load",SmcObj.after_leftImageLoaded(skd));SmcObj.leftImgGrp.appendChild(SmcObj.leftImg);if(SmcObj.leftApproved===true)SmcObj.dispatch_leftImage(SmcObj.leftImg);else SmcObj.leftImg.setAttribute("filter","url(#approveMatrix)");} SmcObj.load_leftImageCipher=function(skd,npage){if(PermitMan.check_memberZone("smimage")===true)SmcObj.leftApproved=PageInfo.is_previewPage(npage);load_cataImageCipher(skd,npage,SmcObj.leftUrl,1);} SmcObj.load_leftImageCipher2=function(skd,npage,urlsrc){SmcObj.leftImg=SmcObj.load_cataImage(urlsrc,npage,5,false);SmcObj.leftImg.addEventListener("load",SmcObj.after_leftImageLoaded(skd));SmcObj.leftImgGrp.appendChild(SmcObj.leftImg);if(SmcObj.leftApproved===true)SmcObj.dispatch_leftImage(SmcObj.leftImg);else SmcObj.leftImg.setAttribute("filter","url(#approveMatrix)");} SmcObj.dispatch_leftImage=function(obj){if(SkinInfo.smc==="004"){obj.setAttribute("onmousedown","SmcObj.mouseDown004(evt,true)");obj.setAttribute("onmouseup","SmcObj.mouseUp004(evt,true)");} else{if(MoveInfo.enlargeClick===true&&MoveInfo.bigImageOnly===false)obj.setAttribute("onclick","SmcObj.mouseClick(evt,true)");}} SmcObj.load_rightImage=function(skd,npage){if(PermitMan.check_memberZone("smimage")===true)SmcObj.rightApproved=PageInfo.is_previewPage(npage);SmcObj.rightImg=SmcObj.load_cataImage(SmcObj.rightUrl,npage,6,false);SmcObj.rightImg.addEventListener("load",SmcObj.after_rightImageLoaded(skd));SmcObj.rightImgGrp.appendChild(SmcObj.rightImg);if(SmcObj.rightApproved===true)SmcObj.dispatch_rightImage(SmcObj.rightImg);else SmcObj.rightImg.setAttribute("filter","url(#approveMatrix)");} SmcObj.load_rightImageCipher=function(skd,npage){if(PermitMan.check_memberZone("smimage")===true)SmcObj.rightApproved=PageInfo.is_previewPage(npage);load_cataImageCipher(skd,npage,SmcObj.rightUrl,2);} SmcObj.load_rightImageCipher2=function(skd,npage,urlsrc){SmcObj.rightImg=SmcObj.load_cataImage(urlsrc,npage,6,false);SmcObj.rightImg.addEventListener("load",SmcObj.after_rightImageLoaded(skd));SmcObj.rightImgGrp.appendChild(SmcObj.rightImg);if(SmcObj.rightApproved===true)SmcObj.dispatch_rightImage(SmcObj.rightImg);else SmcObj.rightImg.setAttribute("filter","url(#approveMatrix)");} SmcObj.dispatch_rightImage=function(obj){if(SkinInfo.smc==="004"){obj.setAttribute("onmousedown","SmcObj.mouseDown004(evt,false)");obj.setAttribute("onmouseup","SmcObj.mouseUp004(evt,false)");} else{if(MoveInfo.enlargeClick===true&&MoveInfo.bigImageOnly===false)obj.setAttribute("onclick","SmcObj.mouseClick(evt,false)");}} SmcObj.after_leftImageLoaded=function(skd){if(skd!=="thru")console.log("SmcObj(cipher:"+ServerInfo.applyCipher+") : "+SmcObj.leftUrl+" : left image loaded");if(skd==="first"){SmcObj.load_completedFirst();return;} if(Action.drawCondition>9)SmcObj.load_completedEnc();else if(skd==="all")SmcObj.load_completedAll();else{if(SmcObj.direction==="next"){if(ScreenInfo.onesmc===true)after_nextFrontImageLoaded();else after_nextRearImageLoaded();} else{after_prevFrontImageLoaded();}}} SmcObj.after_rightImageLoaded=function(skd){if(skd!=="thru")console.log("SmcObj(cipher:"+ServerInfo.applyCipher+") : "+SmcObj.rightUrl+" : right image loaded");if(skd==="first"){SmcObj.load_completedFirst();return;} if(Action.drawCondition>9)SmcObj.load_completedEnc();else if(skd==="all")SmcObj.load_completedAll();else{if(SmcObj.direction==="next")after_nextFrontImageLoaded();else after_prevRearImageLoaded();}} SmcObj.load_completedEnc=function(){SmcObj.loaded++;if(SmcObj.loaded===SmcObj.loadto){go_downsize();}} SmcObj.load_completedAll=function(){SmcObj.loaded++;if(SmcObj.loaded===SmcObj.loadto){finish_turnover2();}} SmcObj.load_completedFirst=function(){SmcObj.loaded++;if(SmcObj.loaded===SmcObj.loadto){if(SkinInfo.smc==="004"||SkinInfo.smc==="007"){SmcObj.show_outData();MoveInfo.show_pageNumber();} else{SmcObj.firstLoading=false;}}} SmcObj.get_imageUrl=function(n){if(SkinInfo.smcgallery===true||MoveInfo.bigImageOnly===true)return FileInfo.cimgFilePath(n,"","","*");return FileInfo.cimgFilePath(n,"s","","*");} SmcObj.load_backRect=function(){var rect=document.createElementNS("http://www.w3.org/2000/svg","rect");rect.setAttribute("width",ScreenInfo.smImageWidth);rect.setAttribute("height",ScreenInfo.smImageHeight);rect.setAttribute("fill",ScreenInfo.blankColor);return rect;} SmcObj.load_cataImage=function(surl,npage,nkd,cipher){var svgimg=document.createElementNS("http://www.w3.org/2000/svg","image");if(cipher===true)load_cataImageCipher2(surl,npage,nkd,svgimg);else svgimg.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",surl);svgimg.setAttribute("preserveAspectRatio","none");svgimg.setAttribute("width",ScreenInfo.smImageWidth);if(DataMan.dobufDim===true){if(SmcObj.bufWidth[npage]==undefined){SmcObj.bufWidth[npage]=0;SmcObj.bufHeight[npage]=0;} if(SmcObj.bufWidth[npage]===0){if(cipher===false)SmcObj.watch_loadImage(surl,npage,nkd,svgimg);} else{ScreenInfo.smImageOriWidth=SmcObj.bufWidth[npage];ScreenInfo.smImageOriHeight=SmcObj.bufHeight[npage];ScreenInfo.ratioWH=ScreenInfo.smImageOriWidth/ScreenInfo.smImageOriHeight;var th=Math.floor(SmcObj.bufHeight[npage]*ScreenInfo.smImageWidth/SmcObj.bufWidth[npage]);svgimg.setAttribute("height",th);DragObj.do_afterOnload(npage,nkd,th);}} else{svgimg.setAttribute("height",ScreenInfo.smImageHeight);} return svgimg;} SmcObj.watch_loadImage=function(surl,npage,nkd,svgimg){var img=new Image();img.onload=function(){SmcObj.bufWidth[npage]=img.naturalWidth;SmcObj.bufHeight[npage]=img.naturalHeight;if(ScreenInfo.smImageDiff===true){ScreenInfo.smImageOriWidth=img.naturalWidth;ScreenInfo.smImageOriHeight=img.naturalHeight;ScreenInfo.ratioWH=ScreenInfo.smImageOriWidth/ScreenInfo.smImageOriHeight;var th=Math.floor(img.naturalHeight*ScreenInfo.smImageWidth/img.naturalWidth);svgimg.setAttribute("height",th);DragObj.do_afterOnload(npage,nkd,th);}} img.src=surl;} SmcObj.prepare_turnover=function(){LinkObj.remove_linkData();LinkObj.remove_searchData();LinkObj.remove_outClip();ScreenMan.prepare_turnover();if(SoundInfo.sndplayInOver===true){var audioPlayer=document.getElementById("smcaudio");audioPlayer.setAttribute("src",FileInfo.skin5FilePath("sound/bookOver.mp3"));audioPlayer.load();audioPlayer.play();}} SmcObj.prepare_turnover2=function(){LinkObj.remove_linkData();LinkObj.remove_searchData();LinkObj.remove_outClip();ScreenMan.prepare_turnover();} SmcObj.prepare_enlarge=function(){if(loginDiv)hide_loginClip();LinkObj.remove_linkData();LinkObj.remove_searchData();LinkObj.remove_outClip();LinkObj.remove_highlight();} SmcObj.finish_turnover=function(skd){if(skd==undefined)skd="all";SmcObj.loaded=0;SmcObj.loadto=0;SmcObj.storedPage=PageInfo.currentPage;SmcObj.loadto++;if(ScreenInfo.onesmc===false)SmcObj.loadto++;var bbb=SmcObj.get_imageUrl(PageInfo.currentPage);SmcObj.leftUrl=bbb[0],SmcObj.leftName=bbb[1],SmcObj.leftDir=bbb[2];SmcObj.width=ScreenInfo.smImageWidth;if(SmcObj.leftImg){SmcObj.leftImgGrp.removeChild(SmcObj.leftImg);SmcObj.leftImg=undefined;} if(SmcObj.leftUrl!==""){if(ServerInfo.applyCipher===true)SmcObj.load_leftImageCipher(skd,PageInfo.currentPage);else SmcObj.load_leftImage(skd,PageInfo.currentPage);} else{if(Action.drawCondition>9)SmcObj.load_completedEnc();else if(skd==="all")SmcObj.load_completedAll();} if(SmcObj.leftUrl!==""&&MoveInfo.enlargeClick===true)SmcObj.leftImgGrp.setAttribute("class","enlgcsr");else SmcObj.leftImgGrp.setAttribute("class","normcsr");if(ScreenInfo.onesmc===false){bbb=SmcObj.get_imageUrl(PageInfo.currentPage+1);SmcObj.rightUrl=bbb[0],SmcObj.rightName=bbb[1],SmcObj.rightDir=bbb[2];if(SmcObj.rightImg){SmcObj.rightImgGrp.removeChild(SmcObj.rightImg);SmcObj.rightImg=undefined;} if(SmcObj.rightUrl!==""){if(ServerInfo.applyCipher===true)SmcObj.load_rightImageCipher(skd,PageInfo.currentPage+1);else SmcObj.load_rightImage(skd,PageInfo.currentPage+1);} else{if(Action.drawCondition>9)SmcObj.load_completedEnc();else if(skd==="all")SmcObj.load_completedAll();} if(SmcObj.rightUrl!==""&&MoveInfo.enlargeClick===true)SmcObj.rightImgGrp.setAttribute("class","enlgcsr");else SmcObj.rightImgGrp.setAttribute("class","normcsr");}} SmcObj.load_imagesAtDrag=function(){var bbb=SmcObj.get_imageUrl(PageInfo.currentPage);SmcObj.leftUrl=bbb[0],SmcObj.leftName=bbb[1],SmcObj.leftDir=bbb[2];if(ScreenInfo.onesmc===false){var aaa=SmcObj.get_imageUrl(PageInfo.currentPage+1);SmcObj.rightUrl=aaa[0],SmcObj.rightName=aaa[1],SmcObj.rightDir=aaa[2];}} SmcObj.unload_func=function(){LinkObj.remove_linkData();LinkObj.remove_searchData();LinkObj.remove_outClip();LinkObj.remove_highlight();if(SmcObj.leftImg){SmcObj.leftImgGrp.removeChild(SmcObj.leftImg);SmcObj.leftImg=undefined;} if(SmcObj.rightImg){SmcObj.rightImgGrp.removeChild(SmcObj.rightImg);SmcObj.rightImg=undefined;}} SmcObj.show_outData=function(){LinkPtrObj=SmcObj;show_linkData();if(LinkInfo.showDescript===true)show_picData();if(SoundInfo.soundAppKind==="Y")load_pagesoundData();if(SearchInfo.searchMark===true||SearchInfo.useCoords===true)show_searchResult();} SmcObj.do_afterMainFinish=function(){if(SkinInfo.smc==="004"||SkinInfo.smc==="007")return;SmcObj.show_outData();SmcObj.loadto=0;} SmcObj.onresize_func=function(){if(ScreenInfo.syncRealHappen==false)return;SmcObj.wRatio=ScreenInfo.smImageWidth/ScreenInfo.bigImageOriWidth;SmcObj.hRatio=ScreenInfo.smImageHeight/ScreenInfo.bigImageOriHeight;SmcObj.imgobj.style.width=smRect.width+"px";var th=0;if(ScreenInfo.smImageDiff===true){th=Math.floor(SmcObj.bufHeight[PageInfo.currentPage]*ScreenInfo.smImageWidth/SmcObj.bufWidth[PageInfo.currentPage]);SmcObj.imgobj.style.height=th+"px";} else{SmcObj.imgobj.style.height=smRect.height+"px";th=ScreenInfo.smImageHeight;} if(SmcObj.leftBack){SmcObj.leftBack.setAttribute("width",ScreenInfo.smImageWidth);SmcObj.leftBack.setAttribute("height",th);} if(SmcObj.leftImg){SmcObj.leftImg.setAttribute("width",ScreenInfo.smImageWidth);SmcObj.leftImg.setAttribute("height",th);} if(SmcObj.rightBack){SmcObj.rightImgGrp.setAttribute('transform','translate('+ScreenInfo.smImageWidth+',0)');SmcObj.rightLink.setAttribute('transform','translate('+ScreenInfo.smImageWidth+',0)');SmcObj.rightSearch.setAttribute('transform','translate('+ScreenInfo.smImageWidth+',0)');SmcObj.rightBack.setAttribute("width",ScreenInfo.smImageWidth);SmcObj.rightBack.setAttribute("height",th);} if(SmcObj.rightImg){SmcObj.rightImg.setAttribute("width",ScreenInfo.smImageWidth);SmcObj.rightImg.setAttribute("height",th);} if(ScreenInfo.smImageDiff===true){smcDiv.style.height=th+"px";if(smcntDiv)smcntDiv.style.height=th+"px";} else if(CataInfo.incview==="m"){document.getElementById('smcsvg0').style.width=smRect.width+"px";document.getElementById('smcsvg0').style.height=smRect.height+"px";document.getElementById('smcsvg1').style.width=smRect.width+"px";document.getElementById('smcsvg1').style.height=smRect.height+"px";document.getElementById('smcsvg2').style.width=smRect.width+"px";document.getElementById('smcsvg2').style.height=smRect.height+"px";}} SmcObj.get_downsizeImgUrl=function(){if(SmcObj.leftUrl==undefined)return SmcObj.rightUrl;else if(SmcObj.rightUrl==undefined)return SmcObj.leftUrl;else if(Action.drawCondition===10)return SmcObj.leftUrl;return SmcObj.rightUrl;} SmcObj.nextPermission=function(device){if(PermitMan.aniSvg===true){var rekd=aniSvg.nextPermission(device);if(rekd===1)return true;else if(rekd===2)return false;} if(MoveInfo.skipLastFirst===true&&PageInfo.is_lastPage()===true&&coverAniState!==0)return false;if((UnifyInfo.classUnify===true||MoveInfo.skipLastFirst===false)&&PageInfo.is_lastPage()===true){if(device!=="wheel"){if(CataInfo.cataLang==="en")DebugMan.traceLog("It is the last page.",true);else DebugMan.traceLog("마지막 페이지입니다.",true);} return false;} return true;} SmcObj.prevPermission=function(device){if(PermitMan.aniSvg===true){var rekd=aniSvg.nextPermission(device);if(rekd===1)return true;else if(rekd===2)return false;} if(MoveInfo.skipLastFirst===true&&PageInfo.is_firstPage()===true&&coverAniState!==0)return false;if((UnifyInfo.classUnify===true||MoveInfo.skipLastFirst===false)&&PageInfo.is_firstPage()===true){if(device!=="wheel"){if(CataInfo.cataLang==="en")DebugMan.traceLog("It is the first page.",true);else DebugMan.traceLog("처음 페이지입니다.",true);} return false;} return true;} SmcObj.firstPermission=function(device){if(PermitMan.aniSvg===true){var rekd=aniSvg.nextPermission(device);if(rekd===1)return true;else if(rekd===2)return false;} if(PageInfo.is_firstPage()===true){if(device!=="wheel"){if(CataInfo.cataLang==="en")DebugMan.traceLog("It is the first page.",true);else DebugMan.traceLog("처음 페이지입니다.",true);} return false;} return true;} SmcObj.lastPermission=function(device){if(PermitMan.aniSvg===true){var rekd=aniSvg.nextPermission(device);if(rekd===1)return true;else if(rekd===2)return false;} if(PageInfo.is_lastPage()===true){if(device!=="wheel"){if(CataInfo.cataLang==="en")DebugMan.traceLog("It is the last page.",true);else DebugMan.traceLog("마지막 페이지입니다.",true);} return false;} return true;} SmcObj.etcPermission=function(skd){return true;} SmcObj.mouseClick=function(e,bool){if(Action.mouseDownBlock===true)return;if(PermitMan.normalPerm(0)===false)return;if(Action.drawCondition>0)return;clickX=e.clientX;clickY=e.clientY;go_enlarge(bool,"mouse");} SmcObj.mouseDown004=function(e,bool){e.preventDefault();clickX=e.clientX;clickY=e.clientY;SmcObj.touchDownTime=MoveInfo.get_currTime();} SmcObj.mouseUp004=function(e,bool){if(Action.mouseDownBlock===true)return;if(PermitMan.normalPerm(0)===false)return;if(Action.drawCondition>0)return;clickX=e.clientX;clickY=e.clientY;var uptime=MoveInfo.get_currTime();if(Action.get_dblclicked(uptime-SmcObj.touchDownTime)===false){go_enlarge(bool,"mouse");} else if(Action.get_dblclicked(uptime-SmcObj.touchUpTime)===true){if(SmcObj.dblClickTimer){clearTimeout(SmcObj.dblClickTimer);SmcObj.dblClickTimer=undefined;} aniSvg.escape_catimageState();aniSvg.make_stopState();} else{SmcObj.dblClickTimer=setTimeout(function(){go_enlarge(bool,"mouse");},Action.doubleClickTime);} SmcObj.touchUpTime=uptime;} SmcObj.do_mouseDown=function(e){e.preventDefault();clickX=e.clientX;clickY=e.clientY;SmcObj.downKind=1;} SmcObj.do_touchStart=function(e){clickX=e.touches[0].clientX;clickY=e.touches[0].clientY;if(clickXsmRect.right||clickYsmRect.bottom)return;DragObj.beftransX=DragObj.transX;DragObj.beftransY=DragObj.transY;if(e.touches.length>1){SmcObj.downKind=4;var tx=e.touches[1].clientX;var ty=e.touches[1].clientY;DragObj.befScale=DragObj.currScale;DragObj.befDistance=Math.sqrt((clickX-tx)*(clickX-tx)+(clickY-ty)*(clickY-ty));} else if(DragObj.currScale!==1){SmcObj.downKind=5;} else SmcObj.downKind=1;Action.touchStartTime=MoveInfo.get_currTime();} SmcObj.do_mouseMove=function(e){if(Action.aniLocking===true||Action.mainState!=="normal")return;if(Action.drawCondition<0)return;if(SmcObj.downKind===1&&Action.mouseDragged===false&&Math.abs(e.clientX-clickX)>3){Action.mouseDownBlock=true;Action.mouseDragged=true;Action.mouseDragClip=aniSvg;aniSvg.do_mouseDown();return;} if(e.clientY>=smRect.bottom-30&&e.clientY<=smRect.bottom){if(e.clientX>=smRect.right-30&&e.clientX<=smRect.right){if(aniSvg.demoOut===true){Action.aniLocking=true;aniSvg.go_nextDemo();aniSvg.demoOut=false;}} else if(e.clientX>=0&&e.clientX<=30){if(aniSvg.demoOut===true){aniSvg.demoOut=false;Action.aniLocking=true;aniSvg.go_prevDemo();}} else aniSvg.demoOut=true;} else aniSvg.demoOut=true;} SmcObj.do_touchMove=function(e){if(Action.aniLocking===true)return;befX=e.touches[0].clientX;befY=e.touches[0].clientY;var xd=befX-clickX;var yd=befY-clickY;if(SmcObj.downKind===1){if(DragObj.currScale===1&&Math.abs(befX-clickX)>3){if(MoveInfo.bigImageOnly===true&&ScreenInfo.pchZoom==="N"&&ScreenInfo.innerOriWidth>window.innerWidth)return;SmcObj.downKind=3;e.preventDefault();} else if(Math.abs(befY-clickY)>10)SmcObj.downKind=6;} else if(SmcObj.downKind===3){if(Action.mouseDragged===false){Action.mouseDragClip=aniSvg;TouchInfo.set_flicked(MoveInfo.get_currTime()-Action.touchStartTime);if(TouchInfo.flicked===true)return;Action.mouseDragged=true;aniSvg.do_mouseDown();} else{befX=e.touches[0].clientX;befY=e.touches[0].clientY;aniSvg.do_mouseDrag(e);}} if(MoveInfo.bigImageOnly===false||ScreenInfo.pchZoom==="N")return;if(SmcObj.downKind===4){var tx=e.touches[1].clientX;var ty=e.touches[1].clientY;var dist=Math.sqrt((befX-tx)*(befX-tx)+(befY-ty)*(befY-ty));DragObj.currScale=DragObj.befScale*dist/DragObj.befDistance;if(DragObj.currScale<1)DragObj.currScale=1;var pw=smRect.width*DragObj.befScale;var ph=smRect.height*DragObj.befScale;var tw=smRect.width*DragObj.currScale;var th=smRect.height*DragObj.currScale;if(DragObj.currScale>1){DragObj.transX=DragObj.beftransX+(pw-tw)/2;if(DragObj.transX>0)DragObj.transX=0;else if(DragObj.transX0)DragObj.transY=0;else if(DragObj.transY1){DragObj.transX=DragObj.beftransX+xd;if(DragObj.transX>0)DragObj.transX=0;else if(DragObj.transX0)DragObj.transY=0;else if(DragObj.transY8)SmcObj.downKind=3;if(DragObj.transY===0||DragObj.transY===(smRect.height-th))SmcObj.downKind=6;} } SmcObj.do_mouseUp=function(e){SmcObj.downKind=0;} SmcObj.do_mouseWheel=function(e){var delta=e.wheelDelta?e.wheelDelta:-e.detail;if(Action.drawCondition>0)return false;if(Action.drawCondition===-1&&delta<0){if(PermitMan.get_nextPerm("wheel")===false){Action.wheelSeq=0;return false;} Action.aniLocking=true;CoverObj.do_coverAnimation("next");} else if(delta>0){if(PermitMan.get_prevPerm("wheel")===false){Action.wheelSeq=0;return false;} Action.aniLocking=true;go_prev(true);} else{if(PermitMan.get_nextPerm("wheel")===false){Action.wheelSeq=0;return false;} Action.aniLocking=true;go_next(true);} return true;} function load_cataImageCipher(skd,npage,surl,loadkd){var ext=get_extension(surl);var stype=(ext.toLowerCase()=="jpg")?"image/jpeg":"image/"+ext;var xmlHttp=new XMLHttpRequest();if(ServerInfo.fileCipher===false)xmlHttp.open("GET",ServerInfo.cpScript+"?mykey="+ServerInfo.cpKey+"&myurl=.."+surl);else xmlHttp.open("GET",surl);xmlHttp.responseType="arraybuffer";xmlHttp.onreadystatechange=function(){if(xmlHttp.readyState!==4)return;if(xmlHttp.status===200){var arybuf=xmlHttp.response;if(!arybuf)return;var byteArray=new Uint8Array(arybuf);var decrArray=cipher_rc4(ServerInfo.cpKey,byteArray);var blob=new Blob([decrArray],{type:stype});var urlsrc=URL.createObjectURL(blob);if(loadkd===1)SmcObj.load_leftImageCipher2(skd,npage,urlsrc);else if(loadkd===2)SmcObj.load_rightImageCipher2(skd,npage,urlsrc);else if(loadkd===3)go_nextLNCipher(urlsrc);else if(loadkd===4)go_nextRNCipher(urlsrc);else if(loadkd===5)go_prevLNCipher(urlsrc);else if(loadkd===6)go_prevRNCipher(urlsrc);else if(loadkd===7)EncObj.load_bigimgLeft(urlsrc);else if(loadkd===8)EncObj.load_bigimgRight(urlsrc);else if(loadkd===9)GuideObj.load_imageLeft(urlsrc);else if(loadkd===10)GuideObj.load_imageRight(urlsrc);else if(loadkd===11)glassesSvg.load_bigimgLeft(urlsrc);else if(loadkd===12)glassesSvg.load_bigimgRight(urlsrc);else if(loadkd===13)printpageSvg.load_imageCipher2(urlsrc);else if(loadkd===14)printpageSvg.partPrint2(urlsrc);else if(loadkd===19)aniSvg.initTexture2(npage,urlsrc);else if(loadkd===20)aniSvg.load_imageCipher(npage,urlsrc);else if(loadkd===21)go_enlargeCipher(urlsrc);else if(loadkd===22)go_downsizeCipher(urlsrc);}} xmlHttp.send();} function load_cataImageCipher2(surl,npage,nkd,svgimg){var ext=get_extension(surl);var stype=(ext.toLowerCase()=="jpg")?"image/jpeg":"image/"+ext;var xmlHttp=new XMLHttpRequest();if(ServerInfo.fileCipher===false)xmlHttp.open("GET",ServerInfo.cpScript+"?mykey="+ServerInfo.cpKey+"&myurl=.."+surl);else xmlHttp.open("GET",surl);xmlHttp.responseType="arraybuffer";xmlHttp.onreadystatechange=function(){if(xmlHttp.readyState!==4)return;if(xmlHttp.status===200){var arybuf=xmlHttp.response;if(!arybuf)return;var byteArray=new Uint8Array(arybuf);var decrArray=cipher_rc4(ServerInfo.cpKey,byteArray);var blob=new Blob([decrArray],{type:stype});var urlsrc=URL.createObjectURL(blob);svgimg.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",urlsrc);if(DataMan.dobufDim===true&&SmcObj.bufWidth[npage]===0&&nkd!==-1)SmcObj.watch_loadImage(surl,npage,nkd,svgimg);}} xmlHttp.send();} function clear_canvas(){cntx.clearRect(0,0,winRect.width,winRect.height);} function go_enlarge(bool,caller){tempN=0;prepare_enlarge();if(ScreenInfo.onesmc===true){Action.drawCondition=3;set_bigImageGeom(3,caller);} else if(bool===true){Action.drawCondition=3;set_bigImageGeom(3,caller);} else{Action.drawCondition=4;set_bigImageGeom(4,caller);} var bbb=(ScreenInfo.onesmc===true||bool===true)?FileInfo.cimgFilePath(PageInfo.currentPage,"s","","*"):FileInfo.cimgFilePath(PageInfo.currentPage+1,"s","","*");if(bbb[0]==""){alert('No cimgFilePath data');} else{catImageLN=new Image();if(ServerInfo.applyCipher===true){load_cataImageCipher('ecn',0,bbb[0],21);} else{catImageLN.src=bbb[0];catImageLN.onload=go_enlarge2;load_enc();}}} function go_enlargeCipher(urlsrc){catImageLN.src=urlsrc;catImageLN.onload=go_enlarge2;load_enc();} function go_enlarge2(){AniObj.seq=0;cntx.globalAlpha=1;maincnvDiv.style.zIndex=40;maincnvDiv.style.width=winRect.width+"px";maincnvDiv.style.height=winRect.height+"px";mainCnv.width=winRect.width;mainCnv.height=winRect.height;if(Action.drawCondition===3)AniObj.timer=setInterval(enlarge_animateL,40);else AniObj.timer=setInterval(enlarge_animateR,40);} function prepare_enlarge(){if(BBwInfo.applyBBw===true)BBwInfo.prepare_enlarge();SmcObj.prepare_enlarge();OnsmObj.prepare_enlarge();Action.aniLocking=true;AniObj.finishEnlargeTimer=false;AniObj.finishEnlargeLoader=false;} function enlarge_animateL(){var percent=AniObj.sizePercent[AniObj.seq];cntx.drawImage(catImageLN,smRect.x-(smRect.x-ScreenInfo.bigImageRect.x)*percent,smRect.y-(smRect.y-ScreenInfo.bigImageRect.y)*percent,ScreenInfo.smImageWidth+(ScreenInfo.bigImageWidth-ScreenInfo.smImageWidth)*percent,ScreenInfo.smImageHeight+(ScreenInfo.bigImageHeight-ScreenInfo.smImageHeight)*percent);AniObj.seq++;if(AniObj.seq===AniObj.sizePercent.length){clearInterval(AniObj.timer);setTimeout("finish_animateEnc()",300);}} function enlarge_animateR(){var percent=AniObj.sizePercent[AniObj.seq];cntx.drawImage(catImageLN,smRect.centerPt.x-(smRect.centerPt.x-ScreenInfo.bigImageRect.x)*percent,smRect.y-(smRect.y-ScreenInfo.bigImageRect.y)*percent,ScreenInfo.smImageWidth+(ScreenInfo.bigImageWidth-ScreenInfo.smImageWidth)*percent,ScreenInfo.smImageHeight+(ScreenInfo.bigImageHeight-ScreenInfo.smImageHeight)*percent);AniObj.seq++;if(AniObj.seq===AniObj.sizePercent.length){clearInterval(AniObj.timer);setTimeout("finish_animateEnc()",300);}} function init_enc(){EncObj={wRatio:1.0,hRatio:1.0,storedPage:PageInfo.currentPage,loadto:0,loaded:0,guidewidth:0,downKind:0,mouseDragged:false,encbefX:0,encbefY:0,encX:0,encY:0,moveTimer:undefined,moveInterval:50,moveStep:50,ratioCB:1.0,correction:2,onbigWidth:40,onbigHeight:40,onbigWidthHalf:0,onbigHeightHalf:0,leftUrl:'',leftName:'',leftDir:'',rightUrl:'',rightName:'',rightDir:'',svgobj:undefined,imgGrp:undefined,leftImg:undefined,leftLink:undefined,leftSearch:undefined,rightImg:undefined,rightLink:undefined,rightSearch:undefined,onbigGrp:undefined,onbigTop:undefined,onbigRight:undefined,onbigBottom:undefined,onbigLeft:undefined};var s="\n" +"\n" +"\n" +"\n" +"\n" +"\n";encDiv.innerHTML=s;EncObj.svgobj=document.getElementById('encsvg');EncObj.imgGrp=document.getElementById('encImg');EncObj.leftLink=document.getElementById('encLinkL');EncObj.rightLink=document.getElementById('encLinkR');EncObj.leftSearch=document.getElementById('encSearchL');EncObj.rightSearch=document.getElementById('encSearchR');EncObj.onbigGrp=document.getElementById('onbigImg');if(SkinInfo.onbigimage==="001"){EncObj.onbigHeight=30;} else if(SkinInfo.onbigimage==="004"){EncObj.onbigWidth=36;} else if(SkinInfo.onbigimage==="005"){EncObj.onbigWidth=51;EncObj.onbigHeight=31;} EncObj.onbigWidthHalf=Math.floor(EncObj.onbigWidth/2);EncObj.onbigHeightHalf=Math.floor(EncObj.onbigHeight/2);EncObj.onload_func=function(){EncObj.wRatio=ScreenInfo.bigImageWidth/ScreenInfo.bigImageOriWidth;EncObj.hRatio=ScreenInfo.bigImageHeight/ScreenInfo.bigImageOriHeight;var leftLoad=false,rightLoad=false;EncObj.leftUrl="",EncObj.rightUrl="";if(Action.drawCondition===3||(Action.drawCondition===4&&Action.togetherEnlarge===true)){leftLoad=true;var aaa=FileInfo.cimgFilePath(PageInfo.currentPage,"","","*");EncObj.leftUrl=aaa[0],EncObj.leftName=aaa[1],EncObj.leftDir=aaa[2];if(EncObj.leftUrl!=="")EncObj.loadto++;} if(Action.drawCondition===4||(Action.drawCondition===3&&Action.togetherEnlarge===true)){rightLoad=true;var bbb=FileInfo.cimgFilePath(PageInfo.currentPage+1,"","","*");EncObj.rightUrl=bbb[0],EncObj.rightName=bbb[1],EncObj.rightDir=bbb[2];if(EncObj.rightUrl!="")EncObj.loadto++;} if(leftLoad===true&&EncObj.leftUrl!==""){if(ServerInfo.applyCipher===true)load_cataImageCipher('enc',0,EncObj.leftUrl,7);else EncObj.load_bigimgLeft(EncObj.leftUrl);EncObj.guidewidth=1;} if(rightLoad===true&&EncObj.rightUrl!==""){if(ServerInfo.applyCipher===true)load_cataImageCipher('enc',0,EncObj.rightUrl,8);else EncObj.load_bigimgRight(EncObj.rightUrl);EncObj.guidewidth=1;if(Action.togetherEnlarge===true)EncObj.guidewidth=2;} if(Action.mouseTouch===false){encDiv.addEventListener("touchstart",EncObj.touchDown,false);encDiv.addEventListener("touchend",EncObj.touchEnd,false);} EncObj.svgobj.style.width=(ScreenInfo.bigImageRect.width*EncObj.guidewidth)+"px";EncObj.svgobj.style.height=ScreenInfo.bigImageRect.height+"px";EncObj.set_onbig();} EncObj.load_bigimgLeft=function(urlsrc){EncObj.leftImg=document.createElementNS("http://www.w3.org/2000/svg","image");EncObj.leftImg.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",urlsrc);if(Action.mouseTouch===true){EncObj.leftImg.setAttribute("onmousedown","EncObj.mouseDown(evt)");EncObj.leftImg.setAttribute("onmouseup","EncObj.mouseUp(evt)");} EncObj.leftImg.setAttribute("load",EncObj.after_leftImgLoaded());EncObj.leftImg.setAttribute("preserveAspectRatio","none");EncObj.leftImg.setAttribute("width",ScreenInfo.bigImageWidth);EncObj.leftImg.setAttribute("height",ScreenInfo.bigImageHeight);EncObj.imgGrp.appendChild(EncObj.leftImg);} EncObj.load_bigimgRight=function(urlsrc){EncObj.rightImg=document.createElementNS("http://www.w3.org/2000/svg","image");EncObj.rightImg.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",urlsrc);if(Action.mouseTouch===true){EncObj.rightImg.setAttribute("onmousedown","EncObj.mouseDown(evt)");EncObj.rightImg.setAttribute("onmouseup","EncObj.mouseUp(evt)");} EncObj.rightImg.setAttribute("load",EncObj.after_rightImgLoaded());EncObj.rightImg.setAttribute("preserveAspectRatio","none");EncObj.rightImg.setAttribute("width",ScreenInfo.bigImageWidth);EncObj.rightImg.setAttribute("height",ScreenInfo.bigImageHeight);EncObj.imgGrp.appendChild(EncObj.rightImg);if(Action.togetherEnlarge===true){EncObj.rightImg.setAttribute('x',ScreenInfo.bigImageWidth);EncObj.rightLink.setAttribute('transform','translate('+ScreenInfo.bigImageWidth+',0)');EncObj.rightSearch.setAttribute('transform','translate('+ScreenInfo.bigImageWidth+',0)');}} EncObj.onresize_func=function(){EncObj.set_bigImageGeom("current");EncObj.set_location(true);} EncObj.set_onbig=function(){EncObj.onbigTop=document.createElementNS("http://www.w3.org/2000/svg","image");EncObj.onbigTop.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",ServerInfo.serverUrl+"/skin5/enc/onbigimage"+SkinInfo.onbigimage+".png");EncObj.onbigTop.setAttribute("width",EncObj.onbigWidth);EncObj.onbigTop.setAttribute("height",EncObj.onbigHeight);EncObj.onbigTop.setAttribute("onmouseover","EncObj.onButtonTopOver()");EncObj.onbigTop.setAttribute("onmouseout","EncObj.onButtonOut('top')");EncObj.onbigGrp.appendChild(EncObj.onbigTop);EncObj.onbigRight=document.createElementNS("http://www.w3.org/2000/svg","image");EncObj.onbigRight.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",ServerInfo.serverUrl+"/skin5/enc/onbigimage"+SkinInfo.onbigimage+".png");EncObj.onbigRight.setAttribute("width",EncObj.onbigWidth);EncObj.onbigRight.setAttribute("height",EncObj.onbigHeight);EncObj.onbigRight.setAttribute("onmouseover","EncObj.onButtonRightOver()");EncObj.onbigRight.setAttribute("onmouseout","EncObj.onButtonOut('right')");EncObj.onbigGrp.appendChild(EncObj.onbigRight);EncObj.onbigBottom=document.createElementNS("http://www.w3.org/2000/svg","image");EncObj.onbigBottom.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",ServerInfo.serverUrl+"/skin5/enc/onbigimage"+SkinInfo.onbigimage+".png");EncObj.onbigBottom.setAttribute("width",EncObj.onbigWidth);EncObj.onbigBottom.setAttribute("height",EncObj.onbigHeight);EncObj.onbigBottom.setAttribute("onmouseover","EncObj.onButtonBottomOver()");EncObj.onbigBottom.setAttribute("onmouseout","EncObj.onButtonOut('bottom')");EncObj.onbigGrp.appendChild(EncObj.onbigBottom);EncObj.onbigLeft=document.createElementNS("http://www.w3.org/2000/svg","image");EncObj.onbigLeft.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",ServerInfo.serverUrl+"/skin5/enc/onbigimage"+SkinInfo.onbigimage+".png");EncObj.onbigLeft.setAttribute("width",EncObj.onbigWidth);EncObj.onbigLeft.setAttribute("height",EncObj.onbigHeight);EncObj.onbigLeft.setAttribute("onmouseover","EncObj.onButtonLeftOver()");EncObj.onbigLeft.setAttribute("onmouseout","EncObj.onButtonOut('left')");EncObj.onbigGrp.appendChild(EncObj.onbigLeft);} EncObj.after_leftImgLoaded=function(){console.log("EncObj(cipher:"+ServerInfo.applyCipher+") : "+EncObj.leftUrl+" : left image loaded");EncObj.load_completed();} EncObj.after_rightImgLoaded=function(){console.log("EncObj(cipher:"+ServerInfo.applyCipher+") : "+EncObj.rightUrl+" : right image loaded");EncObj.load_completed();} EncObj.load_completed=function(){EncObj.loaded++;if(EncObj.loaded===EncObj.loadto){do_afterEncLoaded();}} EncObj.do_afterLoadEnlarge=function(x1,y1){EncObj.encX=x1,EncObj.encY=y1;EncObj.encbefX=x1,EncObj.encbefY=y1;if(Action.mainState==="slide")return;EncObj.svgobj.style.left=x1+"px";EncObj.svgobj.style.top=y1+"px";EncObj.svgobj.setAttribute("class","downcsr");linkoutDiv.style.left=x1+"px";linkoutDiv.style.top=y1+"px";LinkPtrObj=EncObj;show_linkData();if(SearchInfo.searchMark===true||SearchInfo.useCoords===true)show_searchResult();if(soundctrlSvg)loc_soundcontrol();EncObj.loc_onbigImage();EncObj.set_onbigimageVisible();load_guide(EncObj.guidewidth);if(Action.mouseTouch===true)EncObj.svgobj.addEventListener("mousemove",EncObj.mouseMove,false);else encDiv.addEventListener("touchmove",EncObj.touchMove,false);} EncObj.loc_onbigImage=function(){EncObj.onbigTop.setAttribute('transform','translate('+(cataRect.centerPt.x-EncObj.encX-EncObj.onbigWidthHalf)+','+(cataRect.y-EncObj.encY)+')');EncObj.onbigRight.setAttribute('transform','translate('+(cataRect.right-EncObj.encX)+','+(cataRect.centerPt.y-20-EncObj.encY-EncObj.onbigHeightHalf)+') rotate(90)');EncObj.onbigBottom.setAttribute('transform','translate('+(cataRect.centerPt.x-EncObj.encX+EncObj.onbigWidthHalf)+','+(cataRect.bottom-EncObj.encY)+') rotate(180)');EncObj.onbigLeft.setAttribute('transform','translate('+(cataRect.x-EncObj.encX)+','+(cataRect.centerPt.y-EncObj.encY+EncObj.onbigHeightHalf)+') rotate(270)');} EncObj.set_onbigimageVisible=function(){var tx=EncObj.encX,ty=EncObj.encY;if(ty>=ScreenInfo.bigDragRect.bottom)EncObj.onbigTop.setAttribute("visibility","hidden");else EncObj.onbigTop.setAttribute("visibility","visible");if(tx<=ScreenInfo.bigDragRect.x)EncObj.onbigRight.setAttribute("visibility","hidden");else EncObj.onbigRight.setAttribute("visibility","visible");if(ty<=ScreenInfo.bigDragRect.y)EncObj.onbigBottom.setAttribute("visibility","hidden");else EncObj.onbigBottom.setAttribute("visibility","visible");if(tx>=ScreenInfo.bigDragRect.right)EncObj.onbigLeft.setAttribute("visibility","hidden");else EncObj.onbigLeft.setAttribute("visibility","visible");} EncObj.mouseDown=function(e){e.preventDefault();clickX=e.clientX,clickY=e.clientY;if(Action.mainState==="slide")Action.mainState="stop";if(ScreenInfo.bigImageRect.width<=cataRect.width&&ScreenInfo.bigImageRect.height<=cataRect.height)return;EncObj.downKind=1;EncObj.svgobj.setAttribute("class","dragcsr");} EncObj.touchDown=function(e){e.preventDefault();clickX=e.touches[0].clientX,clickY=e.touches[0].clientY;if(Action.mainState==="slide")Action.mainState="stop";if(ScreenInfo.bigImageRect.width<=cataRect.width&&ScreenInfo.bigImageRect.height<=cataRect.height)return;EncObj.downKind=1;} EncObj.mouseMove=function(e){e.preventDefault();if(EncObj.downKind===0)return;EncObj.unifyMove(e.clientX,e.clientY);} EncObj.touchMove=function(e){e.preventDefault();if(EncObj.downKind===0)return;EncObj.unifyMove(e.touches[0].clientX,e.touches[0].clientY);} EncObj.unifyMove=function(tx,ty){if(EncObj.mouseDragged===false&&(Math.abs(tx-clickX)>3||Math.abs(ty-clickY)>3))EncObj.mouseDragged=true;EncObj.encX=tx-clickX+EncObj.encbefX;EncObj.encY=ty-clickY+EncObj.encbefY;EncObj.set_location(true);} EncObj.mouseUp=function(e){e.preventDefault();EncObj.downKind=0;if(EncObj.mouseDragged===true){EncObj.svgobj.setAttribute("class","downcsr");EncObj.mouseDragged=false;EncObj.encbefX+=e.clientX-clickX;EncObj.encbefY+=e.clientY-clickY;} else go_downsize();} EncObj.touchEnd=function(e){e.preventDefault();EncObj.downKind=0;if(EncObj.mouseDragged===true){EncObj.mouseDragged=false;EncObj.encbefX=EncObj.encX;EncObj.encbefY=EncObj.encY;} else go_downsize();} EncObj.set_location=function(bool){if(EncObj.encXScreenInfo.bigDragRect.right)EncObj.encX=ScreenInfo.bigDragRect.right;if(EncObj.encYScreenInfo.bigDragRect.bottom)EncObj.encY=ScreenInfo.bigDragRect.bottom;ScreenInfo.bigImageRect.x=EncObj.encX;ScreenInfo.bigImageRect.y=EncObj.encY;EncObj.svgobj.style.left=EncObj.encX+"px";EncObj.svgobj.style.top=EncObj.encY+"px";linkoutDiv.style.left=EncObj.encX+"px";linkoutDiv.style.top=EncObj.encY+"px";GuideObj.loc_mapFromEnc(EncObj.encX,EncObj.encY);if(Action.togetherEnlarge===true)EncObj.sync_drawCondition(EncObj.encX);if(bool===true)EncObj.loc_onbigImage();EncObj.set_onbigimageVisible();} EncObj.do_mouseWheel=function(e){var delta=e.wheelDelta?e.wheelDelta:-e.detail;if(Action.drawCondition<10)return false;if(delta<0){var ny=EncObj.encY-EncObj.moveStep;EncObj.encY=(ny<=ScreenInfo.bigDragRect.y)?ScreenInfo.bigDragRect.y:ny;EncObj.loc_sizeFromOnbigimage();} else if(delta>0){var ny=EncObj.encY+EncObj.moveStep;EncObj.encY=(ny>=ScreenInfo.bigDragRect.bottom)?ScreenInfo.bigDragRect.bottom:ny;EncObj.loc_sizeFromOnbigimage();} return true;} EncObj.do_keyDown=function(e){var ncode=e.keyCode;if(ncode<37||ncode>40)return;if(ncode===38)EncObj.onButtonTopOver();else if(ncode===40)EncObj.onButtonBottomOver();else if(ncode===37)EncObj.onButtonLeftOver();else if(ncode===39)EncObj.onButtonRightOver();} EncObj.do_keyUp=function(e){var ncode=e.keyCode;if(ncode<37||ncode>40)return;if(ncode===38)EncObj.onButtonOut('top');else if(ncode===40)EncObj.onButtonOut('bottom');else if(ncode===37)EncObj.onButtonOut('left');else if(ncode===39)EncObj.onButtonOut('right');} EncObj.sync_drawCondition=function(tx){if(Action.drawCondition===10&&(tx+ScreenInfo.bigImageWidth)cataRect.centerPt.x){Action.drawCondition=10;}} EncObj.onButtonTopOver=function(){EncObj.onbigTop.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",ServerInfo.serverUrl+"/skin5/enc/onbigimage"+SkinInfo.onbigimage+"_over.png");if(PermitMan.normalPerm(0)===false)return;if(EncObj.encY>=ScreenInfo.bigDragRect.bottom)return;if(EncObj.moveTimer!=undefined)EncObj.do_stopTimer();Action.aniLocking=true;EncObj.moveTimer=setInterval(EncObj.do_topmcTimer,EncObj.moveInterval);} EncObj.onButtonRightOver=function(){EncObj.onbigRight.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",ServerInfo.serverUrl+"/skin5/enc/onbigimage"+SkinInfo.onbigimage+"_over.png");if(PermitMan.normalPerm(0)===false)return;if(EncObj.encX<=ScreenInfo.bigDragRect.x)return;if(EncObj.moveTimer!=undefined)EncObj.do_stopTimer();Action.aniLocking=true;EncObj.moveTimer=setInterval(EncObj.do_rightmcTimer,EncObj.moveInterval);} EncObj.onButtonBottomOver=function(){EncObj.onbigBottom.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",ServerInfo.serverUrl+"/skin5/enc/onbigimage"+SkinInfo.onbigimage+"_over.png");if(PermitMan.normalPerm(0)==false)return;if(EncObj.encY<=ScreenInfo.bigDragRect.y)return;if(EncObj.moveTimer!=undefined)EncObj.do_stopTimer();Action.aniLocking=true;EncObj.moveTimer=setInterval(EncObj.do_bottommcTimer,EncObj.moveInterval);} EncObj.onButtonLeftOver=function(){EncObj.onbigLeft.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",ServerInfo.serverUrl+"/skin5/enc/onbigimage"+SkinInfo.onbigimage+"_over.png");if(PermitMan.normalPerm(0)==false)return;if(EncObj.encX>=ScreenInfo.bigDragRect.right)return;if(EncObj.moveTimer!=undefined)EncObj.do_stopTimer();Action.aniLocking=true;EncObj.moveTimer=setInterval(EncObj.do_leftmcTimer,EncObj.moveInterval);} EncObj.onButtonOut=function(s){if(s==="top")EncObj.onbigTop.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",ServerInfo.serverUrl+"/skin5/enc/onbigimage"+SkinInfo.onbigimage+".png");else if(s==="right")EncObj.onbigRight.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",ServerInfo.serverUrl+"/skin5/enc/onbigimage"+SkinInfo.onbigimage+".png");else if(s==="bottom")EncObj.onbigBottom.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",ServerInfo.serverUrl+"/skin5/enc/onbigimage"+SkinInfo.onbigimage+".png");else if(s==="left")EncObj.onbigLeft.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",ServerInfo.serverUrl+"/skin5/enc/onbigimage"+SkinInfo.onbigimage+".png");if(EncObj.moveTimer!=undefined)EncObj.do_stopTimer();} EncObj.do_topmcTimer=function(){var ny=EncObj.encY+EncObj.moveStep;if(ny>=ScreenInfo.bigDragRect.bottom){EncObj.encY=ScreenInfo.bigDragRect.bottom;EncObj.do_stopTimer();} else{EncObj.encY=ny;} EncObj.loc_sizeFromOnbigimage();} EncObj.do_rightmcTimer=function(){var nx=EncObj.encX-EncObj.moveStep;if(nx<=ScreenInfo.bigDragRect.x){EncObj.encX=ScreenInfo.bigDragRect.x;EncObj.do_stopTimer();} else{EncObj.encX=nx;} EncObj.loc_sizeFromOnbigimage();} EncObj.do_bottommcTimer=function(){var ny=EncObj.encY-EncObj.moveStep;if(ny<=ScreenInfo.bigDragRect.y){EncObj.encY=ScreenInfo.bigDragRect.y;EncObj.do_stopTimer();} else{EncObj.encY=ny;} EncObj.loc_sizeFromOnbigimage();} EncObj.do_leftmcTimer=function(){var nx=EncObj.encX+EncObj.moveStep;if(nx>=ScreenInfo.bigDragRect.right){EncObj.encX=ScreenInfo.bigDragRect.right;EncObj.do_stopTimer();} else{EncObj.encX=nx;} EncObj.loc_sizeFromOnbigimage();} EncObj.loc_sizeFromOnbigimage=function(){EncObj.svgobj.style.left=EncObj.encX+"px";EncObj.svgobj.style.top=EncObj.encY+"px";linkoutDiv.style.left=EncObj.encX+"px";linkoutDiv.style.top=EncObj.encY+"px";GuideObj.loc_mapFromEnc(EncObj.encX,EncObj.encY);if(Action.togetherEnlarge===true)EncObj.sync_drawCondition(EncObj.encX);EncObj.loc_onbigImage();EncObj.set_onbigimageVisible();} EncObj.do_stopTimer=function(){EncObj.encbefX=EncObj.encX;EncObj.encbefY=EncObj.encY;clearInterval(EncObj.moveTimer);EncObj.moveTimer=undefined;Action.aniLocking=false;} EncObj.prepare_downsize=function(){LinkObj.remove_linkData();LinkObj.remove_searchData();LinkObj.remove_outClip();LinkObj.remove_highlight();} EncObj.loc_encFromMap=function(calcX,calcY){var tx=EncObj.encbefX,ty=EncObj.encbefY;if(cataRect.width=(ScreenInfo.bigDragRect.right-EncObj.correction))tx=ScreenInfo.bigDragRect.right;else tx=nx;EncObj.encbefX=tx;} if(cataRect.height(ScreenInfo.bigDragRect.bottom-EncObj.correction))ty=ScreenInfo.bigDragRect.bottom;else ty=ny;EncObj.encbefY=ty;} EncObj.svgobj.style.left=tx+'px';EncObj.svgobj.style.top=ty+'px';linkoutDiv.style.left=tx+"px";linkoutDiv.style.top=ty+"px";EncObj.encX=tx,EncObj.encY=ty;ScreenInfo.bigImageRect.x=tx,ScreenInfo.bigImageRect.y=ty;if(Action.togetherEnlarge===true)EncObj.sync_drawCondition(tx);EncObj.set_onbigimageVisible();} EncObj.loc_sizeFromControl=function(ratio){var w=ScreenInfo.midImageWidth+(ScreenInfo.bigImageOriWidth-ScreenInfo.midImageWidth)*ratio;var h=ScreenInfo.midImageHeight+(ScreenInfo.bigImageOriHeight-ScreenInfo.midImageHeight)*ratio;EncObj.ratioCB=w/ScreenInfo.bigImageWidth;ScreenInfo.set_bigImageVar(w,h);EncObj.set_bigImageGeom("current");EncObj.wRatio=ScreenInfo.bigImageWidth/ScreenInfo.bigImageOriWidth;EncObj.hRatio=ScreenInfo.bigImageHeight/ScreenInfo.bigImageOriHeight;if(EncObj.leftUrl!==""){EncObj.leftImg.setAttribute("width",ScreenInfo.bigImageWidth);EncObj.leftImg.setAttribute("height",ScreenInfo.bigImageHeight);} if(EncObj.rightUrl!==""){EncObj.rightImg.setAttribute("width",ScreenInfo.bigImageWidth);EncObj.rightImg.setAttribute("height",ScreenInfo.bigImageHeight);if(Action.togetherEnlarge===true){EncObj.rightImg.setAttribute('x',ScreenInfo.bigImageWidth);EncObj.rightLink.setAttribute('transform','translate('+ScreenInfo.bigImageWidth+',0)');EncObj.rightSearch.setAttribute('transform','translate('+ScreenInfo.bigImageWidth+',0)');}} EncObj.encX=ScreenInfo.bigImageRect.x;EncObj.encY=ScreenInfo.bigImageRect.y;EncObj.svgobj.style.left=EncObj.encX+'px';EncObj.svgobj.style.top=EncObj.encY+'px';EncObj.svgobj.style.width=ScreenInfo.bigImageRect.width+"px";EncObj.svgobj.style.height=ScreenInfo.bigImageRect.height+"px";EncObj.svgobj.style.top=EncObj.encY+"px";linkoutDiv.style.left=EncObj.encX+"px";linkoutDiv.style.top=EncObj.encY+"px";EncObj.loc_onbigImage();LinkObj.loc_linkData();} EncObj.set_bigImageGeom=function(caller){var bw=(Action.togetherEnlarge===true)?ScreenInfo.bigImageWidth*2:ScreenInfo.bigImageWidth;var dragX=cataRect.right-bw;var dragY=cataRect.bottom-ScreenInfo.bigImageHeight;var dragWidth,dragHeight;var imageX=0;if(bw<=cataRect.width){imageX=cataRect.x+Math.floor((cataRect.width-bw)/2);dragX=imageX;dragWidth=0;} else{imageX=cataRect.centerPt.x-Math.floor((cataRect.centerPt.x-EncObj.encX)*EncObj.ratioCB);if(imageX<=(cataRect.right-bw))imageX=cataRect.right-bw;else if(imageX>cataRect.x)imageX=cataRect.x;dragWidth=cataRect.x-dragX;} var imageY=0;if(ScreenInfo.bigImageHeight<=cataRect.height){imageY=cataRect.y+Math.floor((cataRect.height-ScreenInfo.bigImageHeight)/2);dragY=imageY;dragHeight=0;} else{imageY=cataRect.centerPt.y-Math.floor((cataRect.centerPt.y-EncObj.encY)*EncObj.ratioCB);if(imageY<(cataRect.bottom-ScreenInfo.bigImageHeight))imageY=cataRect.bottom-ScreenInfo.bigImageHeight;else if(imageY>cataRect.y)imageY=cataRect.y;dragHeight=cataRect.y-dragY;} ScreenInfo.bigImageRect=new Rectangle(imageX,imageY,bw,ScreenInfo.bigImageHeight);ScreenInfo.bigDragRect=new Rectangle(dragX,dragY,dragWidth,dragHeight);} EncObj.onload_func();} function load_enc(){var w=ScreenInfo.bigImageWidth;if(Action.togetherEnlarge===true)w+=ScreenInfo.bigImageWidth;encDiv.style.left=winRect.x+"px";encDiv.style.top=winRect.y+"px";encDiv.style.width=winRect.width+"px";encDiv.style.height=winRect.height+"px";init_enc();} function do_afterEncLoaded(){AniObj.finishEnlargeLoader=true;if(AniObj.finishEnlargeTimer===false)return;do_afterLoadEnlarge();} function finish_animateEnc(){AniObj.finishEnlargeTimer=true;if(AniObj.finishEnlargeLoader===false)return;do_afterLoadEnlarge();} function do_afterLoadEnlarge(){var xpos=0,ypos=0;if(tempN===0){if(Action.togetherEnlarge===true&&Action.drawCondition===4){xpos=ScreenInfo.bigImageRect.x-ScreenInfo.bigImageWidth;if(ScreenInfo.bigImageWidth*2<=cataRect.width){ScreenInfo.bigImageRect.offset(-ScreenInfo.bigImageWidth,0);ScreenInfo.bigDragRect.offset(-ScreenInfo.bigImageWidth,0);}} else{xpos=ScreenInfo.bigImageRect.x;} ypos=ScreenInfo.bigImageRect.y;} else{xpos=ScreenInfo.bigImageRect.x;ypos=ScreenInfo.bigImageRect.y;} EncObj.do_afterLoadEnlarge(xpos,ypos);encDiv.style.visibility="visible";clear_canvas();maincnvDiv.style.zIndex=22;mainCnv.width=1;mainCnv.height=1;maincnvDiv.style.width="1px";maincnvDiv.style.height="1px";smcDiv.style.visibility="hidden";if(smctrDiv)smctrDiv.style.visibility="hidden";if(CoverObj.bookdecoX!==NOMOVE)bookdecoDiv.style.visibility="hidden";MenuObj.finish_enlarge();SpacerObj.finish_enlarge();OnsmObj.finish_enlarge();if(Action.mainState==="slide"){setTimeout("go_enlargeSlideNext()",MoveInfo.slideIntervalBIG);} else{if(Action.mainState==="stop")Action.mainState="normal";Action.aniLocking=false;Action.drawCondition+=7;} MoveInfo.show_pageNumber();} function go_enlargeSlideNext(){if(MoveInfo.pairEnlarge===true||Action.drawCondition===11){go_nextEnc(3,"next");} else if(Action.drawCondition===10){go_nearEnc(4);}} function go_nearEnc(n){tempN=n;Action.loaded=0;Action.loadto=0;cntx.fillStyle=ScreenInfo.blankColor;if(n===3)load_catImageLN();else load_catImageRN();} function go_directEnc(n){if(n<=PageInfo.firstPage&&PageInfo.firstPage===0&&PageInfo.blank_image(0)===0)n=1;else if(n>=PageInfo.cataPages)n=PageInfo.cataPages;if(ScreenInfo.onesmc===true){if(n<1)n=1;tempN=3;} else if(n%2!==PageInfo.firstPage){n=n-1;tempN=4;} else{tempN=3;} go_nextEnc(n,"direct");} function go_nextEnc(n,skd){if(skd==="next"){tempN=n;PageInfo.reset_pageNext();} else if(skd==="prev"){tempN=n;if(ScreenInfo.onesmc===true)tempN=3;PageInfo.reset_pagePrev();} else if(skd==="direct"){PageInfo.prevPage=PageInfo.currentPage;PageInfo.currentPage=n;} Action.loaded=0;Action.loadto=0;cntx.fillStyle=ScreenInfo.blankColor;if(MoveInfo.pairEnlarge===true){SmcObj.together=(PageInfo.blank_imageSet(PageInfo.currentPage)===true)?false:true;if(SmcObj.together===false){if(PageInfo.currentPage==0&&PageInfo.blank_image(0)===0)load_catImageRN();else load_catImageLN();} else{load_catImageLN();load_catImageRN();}} else{if(tempN===3)load_catImageLN();else load_catImageRN();}} function load_catImageLN(){var aaa=FileInfo.cimgFilePath(PageInfo.currentPage,"s","","*");if(aaa[0]==""){alert('No cimgFilePath data : '+PageInfo.currentPage+' page');} else{catImageLN=new Image();catImageLN.src=aaa[0];Action.loadto++;catImageLN.onload=go_enc;}} function load_catImageRN(){var bbb=FileInfo.cimgFilePath(PageInfo.currentPage+1,"s","","*");if(bbb[0]==""){alert('No cimgFilePath data : '+(PageInfo.currentPage+1)+' page');} else{catImageRN=new Image();catImageRN.src=bbb[0];Action.loadto++;catImageRN.onload=go_enc;}} function go_enc(){Action.loaded++;if(Action.loadto===Action.loaded){maincnvDiv.style.zIndex=40;maincnvDiv.style.width=winRect.width+"px";maincnvDiv.style.height=winRect.height+"px";mainCnv.width=winRect.width;mainCnv.height=winRect.height;if(MoveInfo.pairEnlarge===true){if(Action.togetherEnlarge===false&&SmcObj.together===false){if(PageInfo.currentPage===0&&PageInfo.blank_image(0)===0)go_near(4);else go_near(3);} else if(Action.togetherEnlarge===false&&SmcObj.together===true){Action.togetherEnlarge=true;set_bigImageGeom(3,"mouse");go_singleToPair();} else if(Action.togetherEnlarge===true&&SmcObj.together===false){Action.togetherEnlarge=false;if(PageInfo.currentPage===0&&PageInfo.blank_image(0)===0){set_bigImageGeom(4,"mouse");go_pairToRight();} else{set_bigImageGeom(3,"mouse");go_pairToLeft();}} else go_pair();} else{go_near(tempN);}}} function go_near(n){Action.drawCondition=n;cntx.globalAlpha=1;if(ScreenInfo.onesmc===true||n===3){cntx.drawImage(catImageLN,ScreenInfo.bigImageRect.x,ScreenInfo.bigImageRect.y,ScreenInfo.bigImageWidth,ScreenInfo.bigImageHeight);} else{cntx.drawImage(catImageRN,ScreenInfo.bigImageRect.x,ScreenInfo.bigImageRect.y,ScreenInfo.bigImageWidth,ScreenInfo.bigImageHeight);} go_encFinal();} function go_pair(){if(Action.drawCondition===10)Action.drawCondition=3;else Action.drawCondition=4;cntx.drawImage(catImageLN,ScreenInfo.bigImageRect.x,ScreenInfo.bigImageRect.y,ScreenInfo.bigImageWidth,ScreenInfo.bigImageHeight);cntx.drawImage(catImageRN,ScreenInfo.bigImageRect.x+ScreenInfo.bigImageWidth,ScreenInfo.bigImageRect.y,ScreenInfo.bigImageWidth,ScreenInfo.bigImageHeight);go_encFinal();} function go_singleToPair(){Action.drawCondition=3;cntx.drawImage(catImageLN,ScreenInfo.bigImageRect.x,ScreenInfo.bigImageRect.y,ScreenInfo.bigImageWidth,ScreenInfo.bigImageHeight);go_encFinal();} function go_pairToLeft(){Action.drawCondition=3;if(ScreenInfo.bigImageRect.xScreenInfo.bigDragRect.right)ScreenInfo.bigImageRect.x=ScreenInfo.bigDragRect.right;cntx.drawImage(catImageLN,ScreenInfo.bigImageRect.x,ScreenInfo.bigImageRect.y,ScreenInfo.bigImageWidth,ScreenInfo.bigImageHeight);go_encFinal();} function go_pairToRight(){Action.drawCondition=4;if(ScreenInfo.bigImageRect.xScreenInfo.bigDragRect.right)ScreenInfo.bigImageRect.x=ScreenInfo.bigDragRect.right;cntx.drawImage(catImageRN,ScreenInfo.bigImageRect.x,ScreenInfo.bigImageRect.y,ScreenInfo.bigImageWidth,ScreenInfo.bigImageHeight);go_encFinal();} function go_encFinal(){EncObj.prepare_downsize();if(soundctrlSvg!=undefined)unload_soundcontrol();if(Action.mouseTouch===false){encDiv.removeEventListener("touchstart",EncObj.touchDown);encDiv.removeEventListener("touchend",EncObj.touchEnd);encDiv.removeEventListener("touchmove",EncObj.touchMove);} encDiv.innerHTML="";encDiv.style.visibility="hidden";EncObj=undefined;if(Action.mouseTouch===false){guideDiv.removeEventListener("touchstart",GuideObj.touchStartThis);guideDiv.removeEventListener("touchend",GuideObj.touchEnd);guideDiv.removeEventListener("touchmove",GuideObj.touchMove);} guideDiv.innerHTML="";guideDiv.style.visibility="hidden";guideSvg=undefined;AniObj.finishEnlargeTimer=false;AniObj.finishEnlargeLoader=false;load_enc();setTimeout("finish_animateEnc()",300);} function go_downsize(){Action.aniLocking=true;ScreenInfo.bigImageRect.x=(Action.togetherEnlarge===true&&Action.drawCondition===11)?EncObj.encX+ScreenInfo.bigImageWidth:EncObj.encX;ScreenInfo.bigImageRect.y=EncObj.encY;if(SmcObj.storedPage!==PageInfo.currentPage){SmcObj.finish_turnover();} else{catImageLN=new Image();if(ServerInfo.applyCipher===true){load_cataImageCipher('dcn',0,SmcObj.get_downsizeImgUrl(),22);} else{catImageLN.src=SmcObj.get_downsizeImgUrl();catImageLN.onload=go_downsize2;}}} function go_downsizeCipher(urlsrc){catImageLN.src=urlsrc;catImageLN.onload=go_downsize2;load_enc();} function go_downsize2(){if(Action.drawCondition===10)Action.drawCondition=5;else Action.drawCondition=6;AniObj.seq=0;cntx.globalAlpha=1;maincnvDiv.style.zIndex=40;maincnvDiv.style.width=winRect.width+"px";maincnvDiv.style.height=winRect.height+"px";mainCnv.width=winRect.width;mainCnv.height=winRect.height;cntx.drawImage(catImageLN,ScreenInfo.bigImageRect.x,ScreenInfo.bigImageRect.y,ScreenInfo.bigImageWidth,ScreenInfo.bigImageHeight);smcDiv.style.visibility="visible";if(smctrDiv)smctrDiv.style.visibility="visible";if(CoverObj.bookdecoX!==NOMOVE)bookdecoDiv.style.visibility="visible";MenuObj.prepare_downsize();SpacerObj.prepare_downsize();OnsmObj.prepare_downsize();EncObj.prepare_downsize();if(Action.mouseTouch===false){encDiv.removeEventListener("touchstart",EncObj.touchDown,false);encDiv.removeEventListener("touchend",EncObj.touchEnd,false);encDiv.removeEventListener("touchmove",EncObj.touchMove,false);} encDiv.innerHTML="";encDiv.style.visibility="hidden";EncObj=undefined;if(CataInfo.openingAnimation===true){if(PageInfo.blank_imageFromLeft(PageInfo.currentPage)===0){CoverObj.hide_leftPage();CoverObj.set_cover();} else if(PageInfo.blank_imageFromLeft(PageInfo.currentPage)===1){CoverObj.hide_rightPage();CoverObj.set_cover();}} if(Action.mouseTouch===false){guideDiv.removeEventListener("touchstart",GuideObj.touchStartThis,false);guideDiv.removeEventListener("touchend",GuideObj.touchEnd,false);guideDiv.removeEventListener("touchmove",GuideObj.touchMove,false);} guideDiv.innerHTML="";guideDiv.style.visibility="hidden";guideSvg=undefined;if(CataInfo.incview==="m")complete_downsize();else if(Action.drawCondition===5)AniObj.timer=setInterval(downsize_animateL,40);else AniObj.timer=setInterval(downsize_animateR,40);} function downsize_animateL(){clear_canvas();var percent=AniObj.sizePercent[AniObj.seq];cntx.drawImage(catImageLN,ScreenInfo.bigImageRect.x+(smRect.x-ScreenInfo.bigImageRect.x)*percent,ScreenInfo.bigImageRect.y+(smRect.y-ScreenInfo.bigImageRect.y)*percent,ScreenInfo.smImageWidth+(ScreenInfo.bigImageWidth-ScreenInfo.smImageWidth)*(1-percent),ScreenInfo.smImageHeight+(ScreenInfo.bigImageHeight-ScreenInfo.smImageHeight)*(1-percent));AniObj.seq++;if(AniObj.seq===AniObj.sizePercent.length){clearInterval(AniObj.timer);complete_downsize();}} function downsize_animateR(){clear_canvas();var percent=AniObj.sizePercent[AniObj.seq];cntx.drawImage(catImageLN,ScreenInfo.bigImageRect.x+(smRect.centerPt.x-ScreenInfo.bigImageRect.x)*percent,ScreenInfo.bigImageRect.y+(smRect.y-ScreenInfo.bigImageRect.y)*percent,ScreenInfo.smImageWidth+(ScreenInfo.bigImageWidth-ScreenInfo.smImageWidth)*(1-percent),ScreenInfo.smImageHeight+(ScreenInfo.bigImageHeight-ScreenInfo.smImageHeight)*(1-percent));AniObj.seq++;if(AniObj.seq===AniObj.sizePercent.length){clearInterval(AniObj.timer);complete_downsize();}} function complete_downsize(){clear_canvas();maincnvDiv.style.zIndex=22;mainCnv.width=1;mainCnv.height=1;maincnvDiv.style.width="1px";maincnvDiv.style.height="1px";Action.drawCondition=0;if(BBwInfo.applyBBw===true)BBwInfo.complete_downsize();SmcObj.show_outData();linkoutDiv.style.left=smRect.x+"px";linkoutDiv.style.top=smRect.y+"px";MoveInfo.show_pageNumber();if(Action.mainState==="slide"){go_next(true);return;} Action.aniLocking=false;} function set_bigImageGeom(drawC,caller){if(MoveInfo.enlarge2Step===true&&caller==="mouse"){ScreenInfo.set_bigImageVar(ScreenInfo.midImageWidth,ScreenInfo.midImageHeight);} var bw=(Action.togetherEnlarge===true)?ScreenInfo.bigImageWidth*2:ScreenInfo.bigImageWidth;var dragX=cataRect.right-bw;var dragY=cataRect.bottom-ScreenInfo.bigImageHeight;var dragWidth,dragHeight;var calcX=clickX;var imageX=0;if(bw<=cataRect.width){imageX=cataRect.x+Math.floor((cataRect.width-bw)/2);if(drawC===4&&Action.togetherEnlarge===true)imageX+=ScreenInfo.bigImageWidth;dragX=imageX;dragWidth=0;} else{if(caller==="current"){imageX=cataRect.x+Math.floor((cataRect.width-bw)/2);} else if(ScreenInfo.onesmc===true){if(calcXcataRect.x)imageX=cataRect.x;} dragX=cataRect.right-bw;dragWidth=cataRect.x-dragX;} var calcY=clickY;var imageY=0;if(ScreenInfo.bigImageHeight<=cataRect.height){imageY=cataRect.y+Math.floor((cataRect.height-ScreenInfo.bigImageHeight)/2);dragY=imageY;dragHeight=0;} else{if(caller==="current")imageY=cataRect.centerPt.y-ScreenInfo.bigImageHeight/2;else imageY=cataRect.centerPt.y-Math.floor((calcY-smRect.y)*ScreenInfo.ratioBS);if(imageY<(cataRect.bottom-ScreenInfo.bigImageHeight))imageY=cataRect.bottom-ScreenInfo.bigImageHeight;else if(imageY>cataRect.y)imageY=cataRect.y;dragY=cataRect.bottom-ScreenInfo.bigImageHeight;dragHeight=cataRect.y-dragY;} ScreenInfo.bigImageRect=new Rectangle(imageX,imageY,bw,ScreenInfo.bigImageHeight);ScreenInfo.bigDragRect=new Rectangle(dragX,dragY,dragWidth,dragHeight);} function init_guide(){GuideObj={loadto:0,loaded:0,downKind:0,mouseDragged:false,nextStep:'',mapX:0,mapY:0,mapbefX:0,mapbefY:0,mapWidth:0,mapHeight:0,width:GuideInfo.width,startX:5,startY:5,curX:0,curY:0,befX:0,befY:0,leftUrl:'',rightUrl:'',leftImg:undefined,rightImg:undefined,svgobj:undefined,guideGrp:undefined,guideback:undefined,guideline:undefined,linemap:undefined,ctrlWidth:0,ctrlY:0,ctrlbefY:62,ctrlStartY:9,ctrlDragTugY:0,ctrlMidY:62,ctrlBottomY:78,ctrlGrp:undefined,ctrlBtn:undefined};var s="\n";s+="\n";s+="\n";else s+=" ontouchstart=\"GuideObj.mouseDownLinemap(evt,false)\" />\n";if(MoveInfo.enlarge2Step===true&&MenuInfo.sizeMenuType==="guide"){s+="\n";s+="\n";s+="\n";else s+=" ontouchstart=\"GuideObj.mouseDownCtrlBtn(evt, false)\" />\n";s+="\n";} s+="\n";s+="
\n";guideDiv.innerHTML=s;GuideObj.svgobj=document.getElementById('guidesvg');GuideObj.guideGrp=document.getElementById('guideGrp');GuideObj.guideback=document.getElementById('guideBack');GuideObj.guideline=document.getElementById('guideLine');GuideObj.linemap=document.getElementById('guideMap');if(MoveInfo.enlarge2Step===true&&MenuInfo.sizeMenuType==="guide"){GuideObj.ctrlGrp=document.getElementById('guideCtrlGrp');GuideObj.ctrlBtn=document.getElementById('guideCtrlBtn');GuideObj.ctrlDragTugY=GuideObj.ctrlMidY+(GuideObj.ctrlBottomY-GuideObj.ctrlMidY)/2;GuideObj.ctrlWidth=24;} GuideObj.guideback.setAttribute("width",GuideInfo.width+10);GuideObj.guideback.setAttribute("height",GuideInfo.height+10);GuideObj.guideline.setAttribute("width",GuideInfo.width+2);GuideObj.guideline.setAttribute("height",GuideInfo.height+2);GuideObj.onload_func=function(){if(EncObj.leftUrl!==""){var aaa=FileInfo.cimgFilePath(PageInfo.currentPage,"s","","*");GuideObj.leftUrl=aaa[0],GuideObj.leftName=aaa[1],GuideObj.leftDir=aaa[2];if(GuideObj.leftUrl!=="")GuideObj.loadto++;} if(EncObj.rightUrl!==""){var bbb=FileInfo.cimgFilePath(PageInfo.currentPage+1,"s","","*");GuideObj.rightUrl=bbb[0],GuideObj.rightName=bbb[1],GuideObj.rightDir=bbb[2];if(GuideObj.rightUrl!=""){GuideObj.loadto++;if(Action.togetherEnlarge===true)GuideObj.width=GuideInfo.width*2;}} GuideObj.svgobj.style.width=(GuideObj.width+10+GuideObj.ctrlWidth)+"px";GuideObj.svgobj.style.height=(GuideInfo.height+10)+"px";if(GuideObj.leftUrl!==""){if(ServerInfo.applyCipher===true)load_cataImageCipher('guide',0,GuideObj.leftUrl,9);else GuideObj.load_imageLeft(GuideObj.leftUrl);} if(GuideObj.rightUrl!==""){if(ServerInfo.applyCipher===true)load_cataImageCipher('guide',0,GuideObj.rightUrl,10);else GuideObj.load_imageRight(GuideObj.rightUrl);} if(Action.mouseTouch===false){GuideObj.guideGrp.addEventListener("touchstart",GuideObj.touchStartThis,false);}} GuideObj.load_imageLeft=function(urlsrc){GuideObj.leftImg=document.createElementNS("http://www.w3.org/2000/svg","image");GuideObj.leftImg.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",urlsrc);GuideObj.leftImg.setAttribute("load",GuideObj.after_leftImgLoaded());GuideObj.leftImg.setAttribute("preserveAspectRatio","none");GuideObj.leftImg.setAttribute("x",GuideObj.startX);GuideObj.leftImg.setAttribute("y",GuideObj.startY);GuideObj.leftImg.setAttribute("width",GuideInfo.width);GuideObj.leftImg.setAttribute("height",GuideInfo.height);if(Action.mouseTouch===true)GuideObj.leftImg.setAttribute("onmousedown","GuideObj.mouseDownThis(evt)");GuideObj.guideGrp.appendChild(GuideObj.leftImg);} GuideObj.load_imageRight=function(urlsrc){GuideObj.rightImg=document.createElementNS("http://www.w3.org/2000/svg","image");GuideObj.rightImg.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",urlsrc);GuideObj.rightImg.setAttribute("load",GuideObj.after_rightImgLoaded());GuideObj.rightImg.setAttribute("preserveAspectRatio","none");GuideObj.rightImg.setAttribute("x",GuideObj.startX);GuideObj.rightImg.setAttribute("y",GuideObj.startY);GuideObj.rightImg.setAttribute("width",GuideInfo.width);GuideObj.rightImg.setAttribute("height",GuideInfo.height);if(Action.mouseTouch===true)GuideObj.rightImg.setAttribute("onmousedown","GuideObj.mouseDownThis(evt)");GuideObj.guideGrp.appendChild(GuideObj.rightImg);if(Action.togetherEnlarge===true){GuideObj.guideback.setAttribute("width",GuideInfo.width*2+10);GuideObj.guideline.setAttribute("width",GuideInfo.width*2+2);GuideObj.rightImg.setAttribute("x",GuideObj.startX+GuideInfo.width);}} GuideObj.after_leftImgLoaded=function(){console.log("GuideObj(cipher:"+ServerInfo.applyCipher+") : "+GuideObj.leftUrl+" : left image loaded");GuideObj.load_completed();} GuideObj.after_rightImgLoaded=function(){console.log("GuideObj(cipher:"+ServerInfo.applyCipher+") : "+GuideObj.rightUrl+" : right image loaded");GuideObj.load_completed();} GuideObj.load_completed=function(){GuideObj.loaded++;if(GuideObj.loaded!==GuideObj.loadto)return;GuideObj.befX=cataRect.x+50;GuideObj.befY=cataRect.y+50;GuideObj.set_linemap();GuideObj.loc_mapFromEnc(EncObj.encX,EncObj.encY);if(MoveInfo.enlarge2Step===true&&MenuInfo.sizeMenuType==="guide"){GuideObj.ctrlGrp.setAttribute('transform','translate('+(GuideObj.width+10)+','+0+')');GuideObj.ctrlGrp.setAttribute('visibility','visible');} if(Action.mouseTouch===true){GuideObj.svgobj.addEventListener("mousemove",GuideObj.mouseMove,false);GuideObj.svgobj.addEventListener("mouseup",GuideObj.mouseUp,false);} else{guideDiv.addEventListener("touchmove",GuideObj.touchMove,true);guideDiv.addEventListener("touchend",GuideObj.touchEnd,false);} guideDiv.style.visibility="visible";} GuideObj.set_linemap=function(){GuideObj.mapWidth=(cataRect.widthcataRect.width){var nx=Math.floor((cataRect.x-encX)*GuideInfo.ratioGB);tx=((nx+GuideObj.mapWidth)>GuideObj.width)?GuideObj.width-GuideObj.mapWidth:nx;if(tx<0)tx=0;} var ty=0;if(ScreenInfo.bigImageHeight>cataRect.height){var ny=Math.floor((cataRect.y-encY)*GuideInfo.ratioGB);ty=(ny+GuideObj.mapHeight>GuideInfo.height)?GuideInfo.height-GuideObj.mapHeight:ny;if(ty<0)ty=0;} GuideObj.mapbefX=GuideObj.startX+tx;GuideObj.mapbefY=GuideObj.startY+ty;GuideObj.linemap.setAttribute("x",GuideObj.startX+tx+0.5);GuideObj.linemap.setAttribute("y",GuideObj.startY+ty+0.5);} GuideObj.mouseDownThis=function(e){e.preventDefault();GuideObj.downKind=1;clickX=e.clientX;clickY=e.clientY;} GuideObj.touchStartThis=function(e){e.preventDefault();GuideObj.downKind=1;clickX=e.touches[0].clientX;clickY=e.touches[0].clientY;} GuideObj.mouseDownLinemap=function(e,bool){e.preventDefault();GuideObj.downKind=2;clickX=(bool===true)?e.clientX:e.touches[0].clientX;clickY=(bool===true)?e.clientY:e.touches[0].clientY;} GuideObj.mouseDownCtrlBtn=function(e,bool){e.preventDefault();GuideObj.downKind=3;clickX=(bool===true)?e.clientX:e.touches[0].clientX;clickY=(bool===true)?e.clientY:e.touches[0].clientY;} GuideObj.mouseMove=function(e){e.preventDefault();GuideObj.unifyMove(e.clientX,e.clientY);} GuideObj.touchMove=function(e){e.preventDefault();GuideObj.unifyMove(e.touches[0].clientX,e.touches[0].clientY);} GuideObj.unifyMove=function(tx,ty){if(GuideObj.downKind===1){if(GuideObj.mouseDragged===false)GuideObj.mouseDragged=true;GuideObj.curX=tx-clickX+GuideObj.befX;GuideObj.curY=ty-clickY+GuideObj.befY;if(GuideObj.curXcataRect.right-GuideObj.width-10-GuideObj.ctrlWidth)GuideObj.curX=cataRect.right-GuideObj.width-10-GuideObj.ctrlWidth;if(GuideObj.curYcataRect.bottom-GuideInfo.height-10)GuideObj.curY=cataRect.bottom-GuideInfo.height-10;guideDiv.style.left=GuideObj.curX+"px";guideDiv.style.top=GuideObj.curY+"px";} else if(GuideObj.downKind===2){if(GuideObj.mouseDragged===false)GuideObj.mouseDragged=true;GuideObj.mapX=tx-clickX+GuideObj.mapbefX;GuideObj.mapY=ty-clickY+GuideObj.mapbefY;if(GuideObj.mapXGuideObj.startX+GuideObj.width-GuideObj.mapWidth)GuideObj.mapX=GuideObj.startX+GuideObj.width-GuideObj.mapWidth;if(GuideObj.mapYGuideObj.startY+GuideInfo.height-GuideObj.mapHeight)GuideObj.mapY=GuideObj.startY+GuideInfo.height-GuideObj.mapHeight;GuideObj.linemap.setAttribute('x',GuideObj.mapX+0.5);GuideObj.linemap.setAttribute('y',GuideObj.mapY+0.5);EncObj.loc_encFromMap(GuideObj.mapX-GuideObj.startX,GuideObj.mapY-GuideObj.startY);} else if(GuideObj.downKind===3){if(GuideObj.mouseDragged===false)GuideObj.mouseDragged=true;GuideObj.ctrlY=ty-clickY+GuideObj.ctrlbefY;if(GuideObj.ctrlYGuideObj.ctrlDragTugY&&GuideObj.ctrlY<=GuideObj.ctrlBottomY)go_downsize();} GuideObj.mouseDragged=false;GuideObj.downKind=0;} GuideObj.touchEnd=function(e){e.preventDefault();if(GuideObj.downKind===1&&GuideObj.mouseDragged===true){GuideObj.befX=GuideObj.curX;GuideObj.befY=GuideObj.curY;} else if(GuideObj.downKind===2&&GuideObj.mouseDragged===true){GuideObj.mapbefX=GuideObj.mapX;GuideObj.mapbefY=GuideObj.mapY;} else if(GuideObj.downKind===3&&GuideObj.mouseDragged===true){GuideObj.ctrlbefY=GuideObj.ctrlY;if(GuideObj.ctrlY>GuideObj.ctrlDragTugY&&GuideObj.ctrlY<=GuideObj.ctrlBottomY)go_downsize();} GuideObj.mouseDragged=false;GuideObj.downKind=0;} GuideObj.set_nextStep=function(){if(MoveInfo.enlarge2Step===true&&MenuInfo.sizeMenuType==="smc"){if(ScreenInfo.bigImageWidth===ScreenInfo.midImageWidth&&GuideObj.befWidth===1)GuideObj.nextStep="max";else if(ScreenInfo.bigImageWidth===ScreenInfo.bigImageOriWidth&&GuideObj.befWidth===ScreenInfo.midImageWidth)GuideObj.nextStep="mid";else GuideObj.nextStep="smc";} else{GuideObj.nextStep="smc";}} GuideObj.onload_func();} function load_guide(n){var gwidth=GuideInfo.width*n+10;if(MoveInfo.enlarge2Step===true&&MenuInfo.sizeMenuType==="guide")gwidth+=25;init_guide();guideDiv.style.width=gwidth+"px";guideDiv.style.height=(GuideInfo.height+10)+"px";guideDiv.style.left=(cataRect.x+50)+"px";guideDiv.style.top=(cataRect.y+50)+"px";}