////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//   This computer program is protected by copyright law and international treaties.                                                      //
//   Unauthorized reproduction or distribution of the program, or any portion of it, may result in severe civil and criminal penalties,   //
//   and will be prosecuted to the maximum extent possible under law.                                                                     //
//   Copyright(c) Digitomi Corp. All Right Reserved.                                                                                      //
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//   Last Update 2005_02_21 09:44:19 by tews                                                                                              //
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 function MgrLevel(arg_ParentDiv,arg_oBasicLevelDiv){this.id="MgrLevel";this.oLevelBaseDiv=arg_ParentDiv;this.oBasicLevelDiv=arg_oBasicLevelDiv;this.LevelInfo=oBookInfo.aLevelInfo;this.Levels=new Array(this.LevelInfo.length);this.InitMgrLevel=InitMgrLevel;this.ItemIndex=null;this.esStatus="esReady";this.oEnLargeShrinkPos=new Point();this.DragClickPos=new Point();this.DragMoveDivPos=new Point();this.ClickLR=0;this.LimitPos=new Limit();this.SpiralTiles=null;this.iTL_Delaytime=40;this.iTS_DelayTime=40;this.SpiralArea=new Limit();this.DoEnLarge=DoEnLarge;this.BeginEnLarge=BeginEnLarge;this.EnLarge=EnLarge;this.EndEnLarge=EndEnLarge;this.DoShrink=DoShrink;this.BeginShrink=BeginShrink;this.Shrink=Shrink;this.EndShrink=EndShrink;this.SetTileImg=SetTileImg;this.GetClickedTilePos=GetClickedTilePos;this.GetSpiralTiles=GetSpiralTiles;this.SetSpiralArea=SetSpiralArea;this.SetEnLargePos=SetEnLargePos;this.SetDragValue=SetDragValue;this.DragLevelDiv=DragLevelDiv;this.DoMoveLevelLeft=DoMoveLevelLeft;this.DoMoveLevelTop=DoMoveLevelTop;this.DoMoveLevelRight=DoMoveLevelRight;this.DoMoveLevelBottom=DoMoveLevelBottom;this.DoContinueMoveLevelLeft=DoContinueMoveLevelLeft;this.DoContinueMoveLevelTop=DoContinueMoveLevelTop;this.DoContinueMoveLevelRight=DoContinueMoveLevelRight;this.DoContinueMoveLevelBottom=DoContinueMoveLevelBottom;this.StopScroll=StopScroll;this.DoReposition=DoRePosition;this.GetCurrLevel=GetCurrLevel;this.OnLoadEffectImg=OnLoadEffectImg;this.OnReadyStateChangeEffectImg=OnReadyStateChangeEffectImg;this.InitMgrLevel();}function InitMgrLevel(){for(zIdx=0;zIdx < this.LevelInfo.length;zIdx++){this.LevelInfo[zIdx][4]=GetTileCount(this.LevelInfo[zIdx][2],this.LevelInfo[zIdx][0]);this.LevelInfo[zIdx][5]=GetTileCount(this.LevelInfo[zIdx][3],this.LevelInfo[zIdx][1]);this.Levels[zIdx]=new Level(this,zIdx);}this.ItemIndex=0;}function Level(arg_Parent,arg_iIdx){this.id="oLevel_"+arg_iIdx;this.index=arg_iIdx;this.Parent=arg_Parent;this.ParentDiv=arg_Parent.oLevelBaseDiv;this.LR=0;this.aTile=new Array();this.aTimer=new Array();this.xTileCount=(oBook.iDouble==0)? this.Parent.LevelInfo[this.index][4] * 2 : this.Parent.LevelInfo[this.index][4];this.yTileCount=this.Parent.LevelInfo[this.index][5];this.oLevelDiv;this.oL_EffectImg;this.oR_EffectImg;this.oL_TileDiv;this.oR_TileDiv;this.oC_TileDiv;this.InitLevel=InitLevel;this.InitTile=InitTile;this.LevelHide=LevelHide;this.LevelShow=LevelShow;this.InitLevel();}function LevelHide(arg_LR){var xIdx,yIdx;if(String(arg_LR)=="undefined"){arg_LR=0;}for(yIdx=0;yIdx < this.yTileCount;yIdx++){for(xIdx=0;xIdx < this.xTileCount;xIdx++){if(this.aTimer[ arg_LR ][yIdx][xIdx] !=null){clearTimeout(this.aTimer[ arg_LR ][yIdx][xIdx]);}if(this.aTile [ arg_LR ][yIdx][xIdx] !=null){this.aTile[arg_LR ][yIdx][xIdx].src=gsSkinDir+gcBlankImgFileName;}}}switch(arg_LR){case-1 : this.oL_EffectImg.style.visibility="hidden";this.oL_TileDiv.style.visibility="hidden";break;case 1 : this.oR_EffectImg.style.visibility="hidden";this.oR_TileDiv.style.visibility="hidden";break;case 0 : this.oL_EffectImg.style.visibility="hidden";this.oR_EffectImg.style.visibility="hidden";this.oC_TileDiv.style.visibility="hidden";}this.oLevelDiv.style.visibility="hidden";}function LevelShow(arg_LR){var xIdx,yIdx;switch(arg_LR){case-1 : this.oL_EffectImg.style.visibility="visible";this.oL_TileDiv.style.visibility="visible";break;case 1 : this.oR_EffectImg.style.visibility="visible";this.oR_TileDiv.style.visibility="visible";break;case 0 : this.oL_EffectImg.style.visibility="visible";this.oR_EffectImg.style.visibility="visible";this.oC_TileDiv.style.visibility="visible";break;}this.oLevelDiv.style.visibility="visible";}function InitLevel(){var tmpLevelDiv=document.createElement("DIV");var sCursorFileName="";this.ParentDiv.appendChild(tmpLevelDiv);if(this.index !=(this.Parent.LevelInfo.length-1)){sCursorFileName="Cursor_PlusMinus.gif";}else{sCursorFileName="Cursor_Minus.gif";}tmpLevelDiv.outerHTML=" <div id=\"oLevelDiv_"+this.index+"\" "+"\n"+" onmousemove=\" oMouse.OnMouseMoveforCursor()\" "+"\n"+" onmouseover=\" oMouse.OnMouseOverforCursor('"+sCursorFileName+"')\" "+"\n"+" onmouseout=\" oMouse.OnMouseOutforCursor()\" "+"\n"+"></div>";delete tmpLevelDiv;eval("this.oLevelDiv=oLevelDiv_"+this.index);with(this.oLevelDiv.style){position="absolute";width=(oBook.iDouble==0)? this.Parent.LevelInfo[this.index][2] * 2 : this.Parent.LevelInfo[this.index][2];height=this.Parent.LevelInfo[this.index][3];left=Math.round((parseInt(this.ParentDiv.style.width)-(parseInt(width)* 2))/2);top=Math.round((parseInt(this.ParentDiv.style.height)-parseInt(height))/2);zIndex=10+this.index;overflow="hidden";visibility="hidden";cursor="hand";}var sTileDivID=(oBook.iDouble==0)? "oC_TileDiv_" : "oL_TileDiv_";var tmpL_EffectImg=document.createElement("IMG");this.oLevelDiv.appendChild(tmpL_EffectImg);tmpL_EffectImg.outerHTML="<img id=\"oL_EffectImg_"+this.index+"\" "+"\n"+" onload=\" "+"MgrLevel"+"."+"OnLoadEffectImg(this)\" "+"\n"+" onreadystatechange=\" "+"MgrLevel"+"."+"OnReadyStateChangeEffectImg(this)\" "+"\n"+" onmousedown=\" "+"oMouse.OnMouseDownLevel()\" "+"\n"+" onmousemove=\" "+"oMouse.OnMouseMoveLevel("+sTileDivID+this.index+")\" "+"\n"+" onmouseup=\" "+"oMouse.OnMouseUpLevel("+sTileDivID+this.index+")\" "+"\n"+">";delete tmpL_EffectImg;eval("this.oL_EffectImg=oL_EffectImg_"+this.index);this.oL_EffectImg.tabindex=-2;with(this.oL_EffectImg.style){position="absolute";right=null;left=0;top=0;zIndex=10;border=" 0 green solid";visibility="hidden";}var sTileDivID=(oBook.iDouble==0)? "oC_TileDiv_" : "oR_TileDiv_";var tmpR_EffectImg=document.createElement("IMG");this.oLevelDiv.appendChild(tmpR_EffectImg);tmpR_EffectImg.outerHTML="<img id=\"oR_EffectImg_"+this.index+"\" "+"\n"+" onload=\" "+"MgrLevel"+"."+"OnLoadEffectImg(this)\" "+"\n"+" onreadystatechange=\" "+"MgrLevel"+"."+"OnReadyStateChangeEffectImg(this)\" "+"\n"+" onmousedown=\" "+"oMouse.OnMouseDownLevel()\" "+"\n"+" onmousemove=\" "+"oMouse.OnMouseMoveLevel("+sTileDivID+this.index+")\" "+"\n"+" onmouseup=\" "+"oMouse.OnMouseUpLevel("+sTileDivID+this.index+")\" "+"\n"+">";delete tmpR_EffectImg;eval("this.oR_EffectImg=oR_EffectImg_"+this.index);this.oR_EffectImg.tabindex=2;with(this.oR_EffectImg.style){position="absolute";left=null;right=0;top=0;zIndex=10;visibility="hidden";}switch(oBook.iDouble){case 0 : var tmpC_TileDiv=document.createElement("DIV");this.oLevelDiv.appendChild(tmpC_TileDiv);tmpC_TileDiv.outerHTML=" <div id=\"oC_TileDiv_"+this.index+"\" "+"\n"+" onmousedown=\" "+"oMouse.OnMouseDownLevel()\" "+"\n"+" onmousemove=\" "+"oMouse.OnMouseMoveLevel("+"oC_TileDiv_"+this.index+")\" "+"\n"+" onmouseup=\" "+"oMouse.OnMouseUpLevel("+"oC_TileDiv_"+this.index+")\" "+"\n"+" onclick=\" "+"oMouse.OnClickLevel(this)\" > "+"\n"+" </div> ";delete tmpC_TileDiv;eval("this.oC_TileDiv=oC_TileDiv_"+this.index);this.oC_TileDiv.tabindex=0;with(this.oC_TileDiv.style){position="absolute";left=0;top=0;width=(oBook.iDouble==0)? this.Parent.LevelInfo[this.index][2] * 2 : this.Parent.LevelInfo[this.index][2];height=this.Parent.LevelInfo[this.index][3];zIndex=15;overflow="hidden";visibility="hidden";}this.InitTile(this.oC_TileDiv,this.index);break;default : var tmpL_TileDiv=document.createElement("DIV");this.oLevelDiv.appendChild(tmpL_TileDiv);tmpL_TileDiv.outerHTML=" <div id=\"oL_TileDiv_"+this.index+"\" "+"\n"+" onmousedown=\" "+"oMouse.OnMouseDownLevel()\" "+"\n"+" onmousemove=\" "+"oMouse.OnMouseMoveLevel("+"oL_TileDiv_"+this.index+")\" "+"\n"+" onmouseup=\" "+"oMouse.OnMouseUpLevel("+"oL_TileDiv_"+this.index+")\" "+"\n"+" onclick=\" "+"oMouse.OnClickLevel(this)\" > "+"\n"+" </div> ";delete tmpL_TileDiv;eval("this.oL_TileDiv=oL_TileDiv_"+this.index);this.oL_TileDiv.tabindex=-1;with(this.oL_TileDiv.style){position="absolute";left=0;top=0;width=this.Parent.LevelInfo[this.index][2];height=this.Parent.LevelInfo[this.index][3];zIndex=15;overflow="hidden";visibility="hidden";}var tmpR_TileDiv=document.createElement("DIV");this.oLevelDiv.appendChild(tmpR_TileDiv);tmpR_TileDiv.outerHTML=" <div id=\"oR_TileDiv_"+this.index+"\" "+"\n"+" onmousedown=\" "+"oMouse.OnMouseDownLevel()\" "+"\n"+" onmousemove=\" "+"oMouse.OnMouseMoveLevel("+"oR_TileDiv_"+this.index+")\" "+"\n"+" onmouseup=\" "+"oMouse.OnMouseUpLevel("+"oR_TileDiv_"+this.index+")\" "+"\n"+" onclick=\" "+"oMouse.OnClickLevel(this)\" > "+"\n"+" </div> ";delete tmpR_TileDiv;eval("this.oR_TileDiv=oR_TileDiv_"+this.index);this.oR_TileDiv.tabindex=1;with(this.oR_TileDiv.style){position="absolute";left=0;top=0;width=this.Parent.LevelInfo[this.index][2];height=this.Parent.LevelInfo[this.index][3];zIndex=15;visibility="hidden";overflow="hidden";}this.InitTile(this.oL_TileDiv,this.index);this.InitTile(this.oR_TileDiv,this.index);break;}}function InitTile(arg_Parent,arg_iIdx){var TileWidth=this.Parent.LevelInfo[arg_iIdx][0];var TileHeight=this.Parent.LevelInfo[arg_iIdx][1];var xTileCap=0;var LR=(oBook==0)? 0 : arg_Parent.tabindex;if(this.Parent.LevelInfo[arg_iIdx][2] % TileWidth !=0){xTileCap=this.Parent.LevelInfo[arg_iIdx][0]-this.Parent.LevelInfo[arg_iIdx][2] % TileWidth;}this.aTile[LR]=new Array();this.aTimer[LR]=new Array();for(yIdx=0;yIdx < this.yTileCount;yIdx++){this.aTile[LR][yIdx]=new Array();this.aTimer[LR][yIdx]=new Array();for(xIdx=0;xIdx < this.xTileCount;xIdx++){var tmpImg=document.createElement("IMG");arg_Parent.appendChild(tmpImg);tmpImg.outerHTML=" <img id=\"oImg_"+(LR+1)+"_"+arg_iIdx+"_"+yIdx+"_"+xIdx+"\" src=\""+gsSkinDir+gcBlankImgFileName+"\">";delete tmpImg;eval("var testImg=oImg_"+(LR+1)+"_"+arg_iIdx+"_"+yIdx+"_"+xIdx);with(testImg.style){position="absolute";visibility="hidden";left=(xIdx >=this.Parent.LevelInfo[arg_iIdx][4])? xIdx * TileWidth-xTileCap :(xIdx * TileWidth);top=yIdx * TileHeight;}this.aTile[LR][yIdx][xIdx]=testImg;}}}function DoEnLarge(arg_Obj){if(oBook.iStatus !="bsReadyDefault"){return;}if(this.esStatus !="esReady"){return;}clearTimeout(oBook.ID_Auto_Leaf);oBook.bAutoLeaf=false;if((this.ItemIndex)==(this.Levels.length-1)){return;}var iTargetLevelIdx=this.ItemIndex+1;var iTargetPageNum;var LR;switch(oBook.iDouble * arg_Obj.tabindex){case 2 :;case 1 : LR=1;break;case 0 : LR=0;break;case-2 :;case-1 : LR=-1;break;}this.ClickLR=LR;var Click_X=0;var Click_Y=0;if(this.ItemIndex==0){var iLeft=oBook.PosDetail.x-(parseInt(oBook.oCurrLevelDiv.style.left)+(parseInt(oBook.oCurrLevelDiv.style.left)* oBook.BLScale));var iTop=oBook.PosDetail.y-(parseInt(oBook.oCurrLevelDiv.style.top)+(parseInt(oBook.oCurrLevelDiv.style.top)* oBook.BLScale));}else{var iLeft=oBook.PosDetail.x-parseInt(oBook.oCurrLevelDiv.style.left);var iTop=oBook.PosDetail.y-parseInt(oBook.oCurrLevelDiv.style.top);}this.SetEnLargePos(parseInt(arg_Obj.style.left),iTargetLevelIdx,iLeft,iTop);var iScale=this.LevelInfo[iTargetLevelIdx][3] / this.LevelInfo[this.ItemIndex][3];if(this.ItemIndex==0){Click_X=oBook.PosDetail.x;Click_Y=oBook.PosDetail.y;}else{Click_X=oBook.PosDetail.x-parseInt(oBook.oCurrLevelDiv.style.left);Click_Y=oBook.PosDetail.y-parseInt(oBook.oCurrLevelDiv.style.top);}var ClicedTilePos=this.GetClickedTilePos(iTargetLevelIdx,Math.ceil(Click_X * iScale),Math.ceil(Click_Y * iScale));if(this.SpiralTiles !=null){this.SpiralTiles.length=0;}this.SpiralTiles=this.GetSpiralTiles(this.Levels[iTargetLevelIdx].aTile[LR],ClicedTilePos.x,ClicedTilePos.y);this.esStatus="esEnLarge";switch(LR){case-1 : iTargetPageNum=oBook.iCurrPageNo-(0.5 * giLeafDirect);if(this.Levels[iTargetLevelIdx].oL_EffectImg.src !=oDecoder2.cdeGetTileName(0,iTargetPageNum,0,0)){this.Levels[iTargetLevelIdx].oL_EffectImg.src=oDecoder2.cdeGetTileName(0,iTargetPageNum,0,0);}else{this.OnLoadEffectImg(this.Levels[iTargetLevelIdx].oL_EffectImg);this.OnReadyStateChangeEffectImg(this.Levels[iTargetLevelIdx].oL_EffectImg);}break;case 1 : iTargetPageNum=oBook.iCurrPageNo+(0.5 * giLeafDirect);if(this.Levels[iTargetLevelIdx].oR_EffectImg.src !=oDecoder2.cdeGetTileName(0,iTargetPageNum,0,0)){this.Levels[iTargetLevelIdx ].oR_EffectImg.src=oDecoder2.cdeGetTileName(0,iTargetPageNum,0,0);}else{this.OnLoadEffectImg(this.Levels[iTargetLevelIdx ].oR_EffectImg);this.OnReadyStateChangeEffectImg(this.Levels[iTargetLevelIdx].oR_EffectImg);}break;default : iTargetPageNum=oBook.iCurrPageNo-(0.5 * giLeafDirect);if(this.Levels[iTargetLevelIdx].oL_EffectImg.src !=oDecoder2.cdeGetTileName(0,iTargetPageNum,0,0)){this.Levels[iTargetLevelIdx].oL_EffectImg.src=oDecoder2.cdeGetTileName(0,iTargetPageNum,0,0);}else{this.OnLoadEffectImg(this.Levels[iTargetLevelIdx].oL_EffectImg);this.OnReadyStateChangeEffectImg(this.Levels[iTargetLevelIdx].oL_EffectImg);}iTargetPageNum=oBook.iCurrPageNo+(0.5 * giLeafDirect);if(this.Levels[iTargetLevelIdx].oR_EffectImg.src !=oDecoder2.cdeGetTileName(0,iTargetPageNum,0,0)){this.Levels[iTargetLevelIdx].oR_EffectImg.src=oDecoder2.cdeGetTileName(0,iTargetPageNum,0,0);}else{this.OnLoadEffectImg(this.Levels[iTargetLevelIdx].oR_EffectImg);this.OnReadyStateChangeEffectImg(this.Levels[iTargetLevelIdx].oR_EffectImg);}iTargetPageNum=oBook.iCurrPageNo;break;}if(oController2 !=null){oController2.ccoAfterEnLarge(iTargetPageNum,arg_Obj.tabindex,iTargetLevelIdx,40000,-this.oEnLargeShrinkPos.x,-this.oEnLargeShrinkPos.y);}}function DoShrink(arg_Obj){if(this.esStatus !="esReady"){return;}if(this.ItemIndex==0){return;}if(oBook.bDetail !=true){oBook.PosDetail.x=event.x;oBook.PosDetail.y=event.y;oBook.bDetail=false;}var iTargetPageNum;var LR;var iLeft=oBook.PosDetail.x-parseInt(this.Levels[this.ItemIndex].oLevelDiv.style.left);var iTop=oBook.PosDetail.y-parseInt(this.Levels[this.ItemIndex].oLevelDiv.style.top);switch(oBook.iDouble){case 1 : if(arg_Obj.tabindex > 0){LR=1;}else if(arg_Obj.tabindex < 0){LR=-1;}break;case 0 : LR=0;break;}var iTargetLevelIdx=this.ItemIndex-1;this.SetEnLargePos(parseInt(arg_Obj.style.left),iTargetLevelIdx,iLeft,iTop);var iScale=this.LevelInfo[iTargetLevelIdx][3] / this.LevelInfo[this.ItemIndex][3];var Click_X=0;var Click_Y=0;if(this.ItemIndex !=0){Click_X=oBook.PosDetail.x-parseInt(oBook.oCurrLevelDiv.style.left);Click_Y=oBook.PosDetail.y-parseInt(oBook.oCurrLevelDiv.style.top);}var ClicedTilePos=this.GetClickedTilePos(iTargetLevelIdx,Math.ceil(Click_X * iScale),Math.ceil(Click_Y * iScale));if(this.SpiralTiles !=null){this.SpiralTiles.length=0;}this.SpiralTiles=this.GetSpiralTiles(this.Levels[iTargetLevelIdx].aTile[LR],ClicedTilePos.x,ClicedTilePos.y);this.esStatus="esShrink";switch(LR){case-1 : iTargetPageNum=oBook.iCurrPageNo-(0.5 * giLeafDirect);if(this.Levels[iTargetLevelIdx].oL_EffectImg.src !=oDecoder2.cdeGetTileName(0,iTargetPageNum,0,0)){this.Levels[iTargetLevelIdx].oL_EffectImg.src=oDecoder2.cdeGetTileName(0,iTargetPageNum,0,0);}else{this.OnLoadEffectImg(this.Levels[iTargetLevelIdx].oL_EffectImg);this.OnReadyStateChangeEffectImg(this.Levels[iTargetLevelIdx].oL_EffectImg);}break;case 1 : iTargetPageNum=oBook.iCurrPageNo+(0.5 * giLeafDirect);if(this.Levels[iTargetLevelIdx].oR_EffectImg.src !=oDecoder2.cdeGetTileName(0,iTargetPageNum,0,0)){this.Levels[iTargetLevelIdx].oR_EffectImg.src=oDecoder2.cdeGetTileName(0,iTargetPageNum,0,0);}else{this.OnLoadEffectImg(this.Levels[iTargetLevelIdx].oR_EffectImg);this.OnReadyStateChangeEffectImg(this.Levels[iTargetLevelIdx].oR_EffectImg);}break;default : iTargetPageNum=oBook.iCurrPageNo-(0.5 * giLeafDirect);if(this.Levels[iTargetLevelIdx].oL_EffectImg.src !=oDecoder2.cdeGetTileName(0,iTargetPageNum,0,0)){this.Levels[iTargetLevelIdx].oL_EffectImg.src=oDecoder2.cdeGetTileName(0,iTargetPageNum,0,0);}else{this.OnLoadEffectImg(this.Levels[iTargetLevelIdx].oL_EffectImg);this.OnReadyStateChangeEffectImg(this.Levels[iTargetLevelIdx].oL_EffectImg);}iTargetPageNum=oBook.iCurrPageNo+(0.5 * giLeafDirect);if(this.Levels[iTargetLevelIdx].oR_EffectImg.src !=oDecoder2.cdeGetTileName(0,iTargetPageNum,0,0)){this.Levels[iTargetLevelIdx].oR_EffectImg.src=oDecoder2.cdeGetTileName(0,iTargetPageNum,0,0);}else{this.OnLoadEffectImg(this.Levels[iTargetLevelIdx].oR_EffectImg);this.OnReadyStateChangeEffectImg(this.Levels[iTargetLevelIdx].oR_EffectImg);}iTargetPageNum=oBook.iCurrPageNo;break;}if(oController2 !=null){if((iTargetLevelIdx==0)||(giDouble==0)){iTargetPageNum=oBook.iCurrPageNo;}oController2.ccoAfterShrink(iTargetPageNum,arg_Obj.tabindex,iTargetLevelIdx,40000,-this.oEnLargeShrinkPos.x,-this.oEnLargeShrinkPos.y);}}function BeginEnLarge(arg_Obj){var LR;switch(oBook.iDouble){case 1 : if(arg_Obj.tabindex > 0){LR=1;}else if(arg_Obj.tabindex < 0){LR=-1;}break;case 0 : LR=0;break;}this.Levels[this.ItemIndex].LR=LR;oBook.oCurrLevelDiv.style.left=this.oEnLargeShrinkPos.x;oBook.oCurrLevelDiv.style.top=this.oEnLargeShrinkPos.y;switch(LR){case-1 : tmpImg=this.Levels[this.ItemIndex].oL_EffectImg;with(tmpImg.style){width=this.LevelInfo[this.ItemIndex][2];height=this.LevelInfo[this.ItemIndex][3];visibility="visible";}break;case 1 : tmpImg=this.Levels[this.ItemIndex].oR_EffectImg;with(tmpImg.style){width=this.LevelInfo[this.ItemIndex][2];height=this.LevelInfo[this.ItemIndex][3];visibility="visible";}break;default : tmpImgL=this.Levels[this.ItemIndex].oL_EffectImg;tmpImgR=this.Levels[this.ItemIndex].oR_EffectImg;with(tmpImgL.style){width=this.LevelInfo[this.ItemIndex][2];height=this.LevelInfo[this.ItemIndex][3];visibility="visible";}with(tmpImgR.style){width=this.LevelInfo[this.ItemIndex][2];height=this.LevelInfo[this.ItemIndex][3];visibility="visible";}break;}if(oController2 !=null){oController2.ccoBeginEnLarge(oBook.oCurrLevelDiv,(oBook.iCurrPageNo+LR *(0.5 * giLeafDirect)),this.ItemIndex);}setTimeout(this.id+".EnLarge("+arg_Obj.id+")",1);}function BeginShrink(arg_Obj){var LR;switch(oBook.iDouble){case 1 : if(arg_Obj.tabindex > 0){LR=1;}else if(arg_Obj.tabindex < 0){LR=-1;}break;case 0 : LR=0;break;}this.Levels[this.ItemIndex].LR=LR;this.Levels[this.ItemIndex].oLevelDiv.style.left=this.oEnLargeShrinkPos.x;this.Levels[this.ItemIndex].oLevelDiv.style.top=this.oEnLargeShrinkPos.y;switch(LR){case-1 : tmpImg=this.Levels[this.ItemIndex].oL_EffectImg;with(tmpImg.style){width=this.LevelInfo[this.ItemIndex ][2];height=this.LevelInfo[this.ItemIndex ][3];if(this.ItemIndex==0){visibility="hidden";}else{visibility="visible";}}break;case 1 : tmpImg=this.Levels[this.ItemIndex].oR_EffectImg;with(tmpImg.style){width=this.LevelInfo[this.ItemIndex ][2];height=this.LevelInfo[this.ItemIndex ][3];if(this.ItemIndex==0){visibility="hidden";}else{visibility="visible";}}break;default : with(tmpImgL.style){width=this.LevelInfo[this.ItemIndex][2];height=this.LevelInfo[this.ItemIndex][3];if(this.ItemIndex==0){visibility="hidden";}else{}}with(tmpImgR.style){width=this.LevelInfo[this.ItemIndex][2];height=this.LevelInfo[this.ItemIndex][3];if(this.ItemIndex==0){visibility="hidden";}else{}}break;}if(this.ItemIndex==0){ShowObj(oBook.oCurrLevelDiv);this.Levels[this.ItemIndex].LevelHide(LR);setTimeout(this.id+".EndShrink("+this.ItemIndex+")",1);MgrSkin.ShowHideScrollBar(this.Levels[this.ItemIndex].oLevelDiv);this.esStatus="esReady";oBook.oCurrLevelDiv=oBook.oBasicLevelDiv;if(this.ItemIndex==0){MgrSkin.oLeafLeft.tgTable.style.left=iBorder_L_Bg_Width;MgrSkin.oLeafLeft.tgTable.style.bottom=iBorder_B_Bg_Height;MgrSkin.oLeafRight.tgTable.style.right=iBorder_L_Bg_Width;MgrSkin.oLeafRight.tgTable.style.bottom=iBorder_B_Bg_Height;oBook.oBasicLevelDiv.appendChild(MgrSkin.oLeafLeft.tgTable);oBook.oBasicLevelDiv.appendChild(MgrSkin.oLeafRight.tgTable);}}else{ShowObj(this.Levels[this.ItemIndex].oLevelDiv);}if(oController2 !=null){if(this.ItemIndex==0){oController2.ccoBeginShrink(oBook.oCurrLevelDiv,(oBook.iCurrPageNo+LR *(0.5 * giLeafDirect)),this.ItemIndex);}else{oController2.ccoBeginShrink(this.Levels[this.ItemIndex].oLevelDiv,(oBook.iCurrPageNo+LR *(0.5 * giLeafDirect)),this.ItemIndex);}}if(this.ItemIndex !=0){setTimeout(this.id+".Shrink("+arg_Obj.id+")",1);}}function EnLarge(arg_Obj){var iTargetPageNum;var LR=0;var tmpStr="";if(arg_Obj.tabindex > 0){LR=1;}else if(arg_Obj.tabindex < 0){LR=-1;}if(oBook.iDouble==0){LR=0;for(iIdx=0;iIdx < this.SpiralTiles.length;iIdx++){var Tile_Y=this.SpiralTiles[iIdx][0];var Tile_X=this.SpiralTiles[iIdx][1];if(Tile_X > this.LevelInfo[this.ItemIndex][4]-1){iTargetPageNum=oBook.iCurrPageNo+(0.5 * giLeafDirect);}else{iTargetPageNum=oBook.iCurrPageNo-(0.5 * giLeafDirect);};if(Tile_Y < 0 || Tile_Y >(this.Levels[this.ItemIndex].yTileCount-1)|| Tile_X < 0 || Tile_X >(this.xTileCount-1)){continue;}try{this.Levels[this.ItemIndex].aTimer[LR][Tile_Y][Tile_X ]=setTimeout(this.id+".SetTileImg("+this.ItemIndex+","+iTargetPageNum+","+LR+","+Tile_Y+","+Tile_X+")",iIdx * this.iTL_Delaytime);}catch(e){}}}else{iTargetPageNum=oBook.iCurrPageNo+(0.5 * LR* giLeafDirect);for(iIdx=0;iIdx < this.SpiralTiles.length;iIdx++){var Tile_Y=this.SpiralTiles[iIdx][0];var Tile_X=this.SpiralTiles[iIdx][1];if(Tile_Y < 0 || Tile_Y >(this.Levels[this.ItemIndex].yTileCount-1)|| Tile_X < 0 || Tile_X >(this.xTileCount-1))continue;try{this.Levels[this.ItemIndex].aTimer[LR][Tile_Y][Tile_X]=setTimeout(this.id+".SetTileImg("+this.ItemIndex+","+iTargetPageNum+","+LR+","+Tile_Y+","+Tile_X+")",iIdx * this.iTL_Delaytime);}catch(e){}}}MgrSkin.ShowHideScrollBar(this.Levels[this.ItemIndex].oLevelDiv);oBook.oCurrLevelDiv=this.Levels[this.ItemIndex].oLevelDiv;this.esStatus="esReady";if(this.ItemIndex !=0){MgrSkin.oLeafLeft.tgTable.style.left=0;MgrSkin.oLeafLeft.tgTable.style.bottom=0;MgrSkin.oLeafRight.tgTable.style.right=0;MgrSkin.oLeafRight.tgTable.style.bottom=0;oBook.oBookBaseDiv.appendChild(MgrSkin.oLeafLeft.tgTable);oBook.oBookBaseDiv.appendChild(MgrSkin.oLeafRight.tgTable);}setTimeout(this.id+".EndEnLarge("+this.ItemIndex+")",10 * yIdx * xIdx);}function SetTileImg(arg_LevelIdx,arg_TargetPage,arg_LR,arg_Y,arg_X){var iNewX=arg_X;if(this.Levels[arg_LevelIdx].aTile[arg_LR][arg_Y][arg_X] !=null){if(arg_X >=this.LevelInfo[this.ItemIndex][4]){iNewX=arg_X-this.LevelInfo[this.ItemIndex][4];};var sDscTileName=oDecoder2.cdeGetTileName(arg_LevelIdx,arg_TargetPage,arg_Y,iNewX);var sSrcTileName=this.Levels[arg_LevelIdx].aTile[arg_LR][arg_Y][arg_X].src;if(sSrcTileName !=sDscTileName){this.Levels[arg_LevelIdx].aTile[arg_LR][arg_Y][arg_X].src=sDscTileName;}}else{}}function Shrink(arg_Obj){var iTargetPageNum;var LR=0;if(arg_Obj.tabindex > 0){LR=1;}else if(arg_Obj.tabindex < 0){LR=-1;}if(oBook.iDouble==0){LR=0;for(iIdx=0;iIdx < this.SpiralTiles.length;iIdx++){var Tile_Y=this.SpiralTiles[iIdx][0];var Tile_X=this.SpiralTiles[iIdx][1];if(Tile_X > this.LevelInfo[this.ItemIndex][4]-1){iTargetPageNum=oBook.iCurrPageNo+(0.5 * giLeafDirect);}else{iTargetPageNum=oBook.iCurrPageNo-(0.5 * giLeafDirect);};if(Tile_Y < 0 || Tile_Y >(this.Levels[this.ItemIndex].yTileCount-1)|| Tile_X < 0 || Tile_X >(this.xTileCount-1)){continue;}try{this.Levels[this.ItemIndex].aTimer[LR][Tile_Y][Tile_X]=setTimeout(this.id+".SetTileImg("+this.ItemIndex+","+iTargetPageNum+","+LR+","+Tile_Y+","+Tile_X+")",iIdx * this.iTL_Delaytime);}catch(e){}finally{}}}else{iTargetPageNum=oBook.iCurrPageNo+(0.5 * LR* giLeafDirect);for(iIdx=0;iIdx < this.SpiralTiles.length;iIdx++){var Tile_Y=this.SpiralTiles[iIdx][0];var Tile_X=this.SpiralTiles[iIdx][1];try{this.Levels[this.ItemIndex].aTimer[LR][Tile_Y][Tile_X]=setTimeout(this.id+".SetTileImg("+this.ItemIndex+","+iTargetPageNum+","+LR+","+Tile_Y+","+Tile_X+")",iIdx * this.iTL_Delaytime);}catch(e){}finally{}}}if(this.ItemIndex !=0){MgrSkin.ShowHideScrollBar(this.Levels[this.ItemIndex].oLevelDiv);}oBook.oCurrLevelDiv=this.Levels[this.ItemIndex].oLevelDiv;this.esStatus="esReady";setTimeout(this.id+".EndShrink("+this.ItemIndex+")",10 * yIdx * xIdx);}var ifileSize;function EndEnLarge(arg_LevelIndex){var iIdx;ifileSize=0;if(arg_LevelIndex !=this.ItemIndex)return;for(iIdx=0;iIdx < this.SpiralTiles.length;iIdx++){var Tile_Y=this.SpiralTiles[iIdx][0];var Tile_X=this.SpiralTiles[iIdx][1];if(Tile_Y < 0 || Tile_Y >(this.Levels[arg_LevelIndex].yTileCount-1)|| Tile_X < 0 || Tile_X >(this.Levels[arg_LevelIndex].xTileCount-1))continue;setTimeout("ShowObj("+this.id+".Levels["+arg_LevelIndex+"].aTile["+this.ClickLR+"]["+Tile_Y+"]["+Tile_X+"])",this.iTS_DelayTime * iIdx);}if(arg_LevelIndex==(this.LevelInfo.length-1)){sTitle=GetRes("Shrink",gaRes_Core);}else{sTitle=GetRes("EnLarge",gaRes_Core)+"/"+GetRes("Shrink",gaRes_Core);}this.oLevelBaseDiv.title=sTitle;}function EndShrink(arg_LevelIndex){var iIdx;if(arg_LevelIndex !=this.ItemIndex)return;for(iIdx=0;iIdx < this.SpiralTiles.length;iIdx++){var Tile_Y=this.SpiralTiles[iIdx][0];var Tile_X=this.SpiralTiles[iIdx][1];if(Tile_Y < 0 || Tile_X < 0)continue;if(this.ItemIndex==0 || this.ClickLR==0){this.ClickLR=0;return;}setTimeout("ShowObj("+this.id+".Levels["+arg_LevelIndex+"].aTile["+this.ClickLR+"]["+Tile_Y+"]["+Tile_X+"])",this.iTS_DelayTime * iIdx);}}function SetSpiralArea(){}function SetEnLargePos(arg_Obj_style_left,arg_Dsc_Idx,arg_Click_XPos,arg_Click_YPos){var iDispWidth=(oBook.iDouble==0)? this.LevelInfo[arg_Dsc_Idx][2] * 2 : this.LevelInfo[arg_Dsc_Idx][2];var iDispHeight=this.LevelInfo[arg_Dsc_Idx][3];var iBaseWidth=parseInt(this.oLevelBaseDiv.style.width);var iBaseHeight=parseInt(this.oLevelBaseDiv.style.height);if((oBook.iDouble !=0)&&(arg_Click_XPos > this.LevelInfo[this.ItemIndex][2])){arg_Click_XPos-=this.LevelInfo[this.ItemIndex][2];}var iDispClickXPoint=iDispWidth *(arg_Click_XPos /((oBook.iDouble==0)? this.LevelInfo[this.ItemIndex][2] * 2 : this.LevelInfo[this.ItemIndex][2]));var iDispClickYPoint=iDispHeight *(arg_Click_YPos /(this.LevelInfo[this.ItemIndex][3]));var iDispWidthHalf=iDispWidth / 2;var iBaseWidthHalf=iBaseWidth / 2;var iDispHeightHalf=iDispHeight / 2;var iBaseHeightHalf=iBaseHeight / 2;var iAdjustHeight;var iAdjustWidth;this.oEnLargeShrinkPos.x=0;if(iBaseWidth >=iDispWidth){this.oEnLargeShrinkPos.x=Math.round((iBaseWidth-iDispWidth)/ 2);}else{if(iDispClickXPoint < iDispWidthHalf){if(iDispClickXPoint < iBaseWidthHalf){if(arg_Obj_style_left==0){this.oEnLargeShrinkPos.x=0;}else{iAdjustWidth=(iBaseWidthHalf-iDispClickXPoint);this.oEnLargeShrinkPos.x=this.oEnLargeShrinkPos.x;}}else{iAdjustWidth=iBaseWidthHalf-iDispClickXPoint;this.oEnLargeShrinkPos.x=Math.round(iAdjustWidth);}}else{if((iDispWidth-iDispClickXPoint)< iBaseWidthHalf){this.oEnLargeShrinkPos.x=Math.round(iBaseWidth-iDispWidth);}else{iAdjustWidth=iDispWidth-iDispClickXPoint-iBaseWidthHalf;this.oEnLargeShrinkPos.x=Math.round((iBaseWidth-iDispWidth)+iAdjustWidth);}}}if(iBaseHeight >=iDispHeight){this.oEnLargeShrinkPos.y=Math.round((iBaseHeight-iDispHeight)/ 2);}else{if(iDispClickYPoint < iDispHeightHalf){if(iDispClickYPoint < iBaseHeightHalf){this.oEnLargeShrinkPos.y=0;}else{iAdjustHeight=iBaseHeightHalf-iDispClickYPoint;this.oEnLargeShrinkPos.y=Math.round(iAdjustHeight);}}else{if((iDispHeight-iDispClickYPoint)< iBaseHeightHalf){this.oEnLargeShrinkPos.y=Math.round(iBaseHeight-iDispHeight);}else{iAdjustHeight=iDispHeight-iDispClickYPoint-iBaseHeightHalf;this.oEnLargeShrinkPos.y=Math.round((iBaseHeight-iDispHeight)+iAdjustHeight);}}}}function SetDragValue(arg_X,arg_Y){this.DragClickPos.x=arg_X;this.DragClickPos.y=arg_Y;this.DragMoveDivPos.x=parseInt(this.Levels[this.ItemIndex].oLevelDiv.style.left);this.DragMoveDivPos.y=parseInt(this.Levels[this.ItemIndex].oLevelDiv.style.top);}function DragLevelDiv(arg_x,arg_y){var iVariation_X=arg_x;var iVariation_Y=arg_y;if(parseInt(this.oLevelBaseDiv.style.width)< parseInt(this.Levels[this.ItemIndex].oLevelDiv.style.width)){var iMinLimit_X=parseInt(this.oLevelBaseDiv.style.width)-parseInt(this.Levels[this.ItemIndex].oLevelDiv.style.width);var iMaxLimit_X=0;}else{var iMinLimit_X=Math.ceil((parseInt(this.oLevelBaseDiv.style.width)-parseInt(this.Levels[this.ItemIndex].oLevelDiv.style.width))/ 2);var iMaxLimit_X=iMinLimit_X;}if(parseInt(this.oLevelBaseDiv.style.height)< parseInt(this.Levels[this.ItemIndex].oLevelDiv.style.height)){var iMinLimit_Y=parseInt(this.oLevelBaseDiv.style.height)-parseInt(this.Levels[this.ItemIndex].oLevelDiv.style.height);var iMaxLimit_Y=0;}else{var iMinLimit_Y=Math.ceil((parseInt(this.oLevelBaseDiv.style.height)-parseInt(this.Levels[this.ItemIndex].oLevelDiv.style.height))/ 2);var iMaxLimit_Y=0;}var ResultDragLeft=this.DragMoveDivPos.x+iVariation_X-this.DragClickPos.x;var ResultDragTop=this.DragMoveDivPos.y+iVariation_Y-this.DragClickPos.y;if(ResultDragLeft > iMaxLimit_X){ResultDragLeft=iMaxLimit_X;}if(ResultDragTop > iMaxLimit_Y){ResultDragTop=iMaxLimit_Y;}if(ResultDragLeft < iMinLimit_X){ResultDragLeft=iMinLimit_X;}if(ResultDragTop < iMinLimit_Y){ResultDragTop=iMinLimit_Y;}this.Levels[this.ItemIndex].oLevelDiv.style.left=ResultDragLeft;this.Levels[this.ItemIndex].oLevelDiv.style.top=ResultDragTop;if(oController2 !=null){oController2.ccoDoScroll(-ResultDragLeft,-ResultDragTop);}if(MgrSkin !=null){MgrSkin.ShowHideScrollBar(this.Levels[this.ItemIndex].oLevelDiv);}}function DoMoveLevelLeft(){var iTop=parseInt(this.Levels[this.ItemIndex].oLevelDiv.style.top);var iLeft=parseInt(this.Levels[this.ItemIndex].oLevelDiv.style.left)-MgrSkin.iScrollSize;var iBaseWidth=parseInt(this.oLevelBaseDiv.style.width);var iMoveWidth=parseInt(this.Levels[this.ItemIndex].oLevelDiv.style.width);if(iBaseWidth > iMoveWidth){this.LimitPos.MinLeft=Math.ceil((iBaseWidth-iMoveWidth)/ 2);}else{this.LimitPos.MinLeft=iBaseWidth-iMoveWidth;}if(iLeft < this.LimitPos.MinLeft){iLeft=this.LimitPos.MinLeft;}this.Levels[this.ItemIndex].oLevelDiv.style.left=iLeft;if(oController2 !=null){oController2.ccoDoScroll(-iLeft,-iTop);}if(MgrSkin !=null){MgrSkin.ShowHideScrollBar(this.Levels[this.ItemIndex].oLevelDiv);}}function DoMoveLevelTop(){var iTop=parseInt(this.Levels[this.ItemIndex].oLevelDiv.style.top)-MgrSkin.iScrollSize;var iLeft=parseInt(this.Levels[this.ItemIndex].oLevelDiv.style.left);var iBaseHeight=parseInt(this.oLevelBaseDiv.style.height);var iMoveHeight=parseInt(this.Levels[this.ItemIndex].oLevelDiv.style.height);if(iBaseHeight > iMoveHeight){this.LimitPos.MinTop=Math.ceil((iBaseHeight-iBaseHeight)/ 2);}else{this.LimitPos.MinTop=iBaseHeight-iMoveHeight;}if(iTop < this.LimitPos.MinTop){iTop=this.LimitPos.MinTop;}this.Levels[this.ItemIndex].oLevelDiv.style.top=iTop;if(oController2 !=null){oController2.ccoDoScroll(-iLeft,-iTop);}if(MgrSkin !=null){MgrSkin.ShowHideScrollBar(this.Levels[this.ItemIndex].oLevelDiv);}}function DoMoveLevelRight(){var iTop=parseInt(this.Levels[this.ItemIndex].oLevelDiv.style.top);var iLeft=parseInt(this.Levels[this.ItemIndex].oLevelDiv.style.left)+MgrSkin.iScrollSize;var iBaseWidth=parseInt(this.oLevelBaseDiv.style.width);var iMoveWidth=parseInt(this.Levels[this.ItemIndex].oLevelDiv.style.width);if(iBaseWidth > iMoveWidth){this.LimitPos.MaxLeft=Math.ceil((iBaseWidth-iMoveWidth)/ 2);}else{this.LimitPos.MaxLeft=0;}if(iLeft > this.LimitPos.MaxLeft){iLeft=this.LimitPos.MaxLeft;}this.Levels[this.ItemIndex].oLevelDiv.style.left=iLeft;if(oController2 !=null){oController2.ccoDoScroll(-iLeft,-iTop);}if(MgrSkin !=null){MgrSkin.ShowHideScrollBar(this.Levels[this.ItemIndex].oLevelDiv);}}function DoMoveLevelBottom(){var iTop=parseInt(this.Levels[this.ItemIndex].oLevelDiv.style.top)+MgrSkin.iScrollSize;var iLeft=parseInt(this.Levels[this.ItemIndex].oLevelDiv.style.left);var iBaseHeight=parseInt(this.oLevelBaseDiv.style.height);var iMoveHeight=parseInt(this.Levels[this.ItemIndex].oLevelDiv.style.height);if(iBaseHeight > iMoveHeight){this.LimitPos.MaxTop=Math.ceil((iBaseHeight-iBaseHeight)/ 2);}else{this.LimitPos.MaxTop=0;}if(iTop > this.LimitPos.MaxTop){iTop=this.LimitPos.MaxTop;}this.Levels[this.ItemIndex].oLevelDiv.style.top=iTop;if(oController2 !=null){oController2.ccoDoScroll(-iLeft,-iTop);}if(MgrSkin !=null){MgrSkin.ShowHideScrollBar(this.Levels[this.ItemIndex].oLevelDiv);}}function DoContinueMoveLevelLeft(){clearTimeout(MgrSkin.ID_Scroll);this.DoMoveLevelLeft();MgrSkin.ID_Scroll=setTimeout(this.id+"."+"DoContinueMoveLevelLeft()",MgrSkin.iScrollDelay);}function DoContinueMoveLevelTop(){clearTimeout(MgrSkin.ID_Scroll);this.DoMoveLevelTop();MgrSkin.ID_Scroll=setTimeout(this.id+"."+"DoContinueMoveLevelTop()",MgrSkin.iScrollDelay);}function DoContinueMoveLevelRight(){clearTimeout(MgrSkin.ID_Scroll);this.DoMoveLevelRight();MgrSkin.ID_Scroll=setTimeout(this.id+"."+"DoContinueMoveLevelRight()",MgrSkin.iScrollDelay);}function DoContinueMoveLevelBottom(){clearTimeout(MgrSkin.ID_Scroll);this.DoMoveLevelBottom();MgrSkin.ID_Scroll=setTimeout(this.id+"."+"DoContinueMoveLevelBottom()",MgrSkin.iScrollDelay);}function StopScroll(){clearInterval(MgrSkin.ID_Scroll);}function DoRePosition(arg_X,arg_Y){this.Levels[this.ItemIndex].oLevelDiv.style.left=arg_X;this.Levels[this.ItemIndex].oLevelDiv.style.top=arg_Y;}function GetCurrLevel(){return this.ItemIndex;}function OnLoadEffectImg(arg_Obj){var LR=0;if(oBook.iDouble==0){oBook.iDoubleCount-=1;}if(arg_Obj.tabindex > 0){arg_Obj.tabindex-=1;LR=1;}else if(arg_Obj.tabindex < 0){arg_Obj.tabindex+=1;LR=-1;}if(arg_Obj.tabindex==0){if((oBook.iDouble==0)&&(oBook.iDoubleCount !=0)){return;}oBook.iDoubleCount=4;arg_Obj.tabindex=2*LR;if(oBook.iDouble==0){LR=0;}switch(this.esStatus){case "esShrink" : var TargetIdx=this.ItemIndex-1;if(TargetIdx==0){oBook.oCurrLevelDiv=oBook.oBasicLevelDiv;ShowObj(oBook.oCurrLevelDiv);}else{oBook.oCurrLevelDiv=this.Levels[TargetIdx].oLevelDiv;this.Levels[TargetIdx].LevelShow(LR);}this.Levels[this.ItemIndex ].LevelHide(LR);this.ItemIndex=TargetIdx;this.BeginShrink(arg_Obj);break;case "esEnLarge" : var TargetIdx=this.ItemIndex+1;oBook.oCurrLevelDiv=this.Levels[TargetIdx ].oLevelDiv;ShowObj(oBook.oCurrLevelDiv);this.Levels[this.ItemIndex].LevelHide(LR);this.ItemIndex=TargetIdx;this.BeginEnLarge(arg_Obj);break;default : if(this.ItemIndex==0){oBook.oCurrLevelDiv=oBook.oBasicLevelDiv;}else{oBook.oCurrLevelDiv=this.Levels[this.ItemIndex].oLevelDiv;}this.Levels[this.ItemIndex ].LevelHide(LR);break;}}}function OnReadyStateChangeEffectImg(arg_Obj){if(arg_Obj.readyState!="complete")return;var LR=0;if(oBook.iDouble==0){oBook.iDoubleCount-=1;}if(arg_Obj.tabindex > 0){arg_Obj.tabindex-=1;LR=1;}else if(arg_Obj.tabindex < 0){arg_Obj.tabindex+=1;LR=-1;}if(arg_Obj.tabindex==0){arg_Obj.tabindex=2*LR;if((oBook.iDouble==0)&&(oBook.iDoubleCount !=0)){return;}oBook.iDoubleCount=4;if(oBook.iDouble==0){LR=0;}switch(this.esStatus){case "esShrink" : var TargetIdx=this.ItemIndex-1;if(TargetIdx==0){oBook.oCurrLevelDiv=oBook.oBasicLevelDiv;ShowObj(oBook.oCurrLevelDiv);}else{oBook.oCurrLevelDiv=this.Levels[TargetIdx].oLevelDiv;this.Levels[TargetIdx].LevelShow(LR);}this.Levels[this.ItemIndex ].LevelHide(LR);this.ItemIndex=TargetIdx;this.BeginShrink(arg_Obj);break;case "esEnLarge" : var TargetIdx=this.ItemIndex+1;oBook.oCurrLevelDiv=this.Levels[TargetIdx ].oLevelDiv;ShowObj(oBook.oCurrLevelDiv);this.Levels[this.ItemIndex ].LevelHide(LR);this.ItemIndex=TargetIdx;this.BeginEnLarge(arg_Obj);break;default : this.Levels[this.ItemIndex ].LevelHide(LR);break;}}}function GetClickedTilePos(arg_Level,arg_x,arg_y){var ClickedPos=new Point();var iMod;var iDiv;iMod=0;if(((arg_x+1)% this.LevelInfo[arg_Level][0])!=0){iMod=1;}if(oBook.iDouble==0){if((arg_x+1)> this.LevelInfo[arg_Level][2]){iDiv=this.LevelInfo[arg_Level][4]+Math.floor(((arg_x+1)-this.LevelInfo[arg_Level][2])/ this.LevelInfo[arg_Level][0]);}else{iDiv=Math.floor((arg_x+1)/ this.LevelInfo[arg_Level][0]);}}else{if((arg_x+1)> this.LevelInfo[arg_Level][2]){iDiv=Math.floor(((arg_x+1)-this.LevelInfo[arg_Level][2])/ this.LevelInfo[arg_Level][0]);}else{iDiv=Math.floor((arg_x+1)/ this.LevelInfo[arg_Level][0]);}}ClickedPos.x=iDiv+iMod-1;iMod=0;if(((arg_y+1)% this.LevelInfo[arg_Level][1])!=0){iMod=1;}iDiv=Math.floor((arg_y+1)/ this.LevelInfo[arg_Level][1]);ClickedPos.y=iDiv+iMod-1;return ClickedPos;}function GetSpiralTiles(arg_aBlock,arg_X,arg_Y){var aResult=new Array();var iLimit_Y_Max=0;var iLimit_X_Max=0;var iLimit_Y_Min=0;var iLimit_X_Min=0;var yIdx=arg_Y;var xIdx=arg_X;var aVector=Array("L","T","R","B");var iVectorIdx=0;var iLimit_Block=1;var iBlockCount=0;var sSpiralNodePath="";if(arg_Y >=arg_aBlock.length / 2){iLimit_Y_Max=arg_Y * 2;iLimit_Y_Min=0;}else{iLimit_Y_Max=arg_aBlock.length-1;iLimit_Y_Min=arg_Y-((arg_aBlock.length-1)-arg_Y);}if(arg_X >=(arg_aBlock[0].length)/ 2){iLimit_X_Max=arg_X * 2;iLimit_X_Min=0;}else{iLimit_X_Max=arg_aBlock[0].length-1;iLimit_X_Min=arg_X-((arg_aBlock[0].length-1)-arg_X);}sSpiralNodePath=sSpiralNodePath+"["+yIdx+","+xIdx+"]"+"\n";aResult[aResult.length ]=new Array(yIdx,xIdx);while(((yIdx <=iLimit_Y_Max)||(xIdx <=iLimit_X_Max))&&((yIdx >=iLimit_Y_Min)||(xIdx >=iLimit_X_Min))){iBlockCount=0;while(((yIdx <=iLimit_Y_Max)||(xIdx <=iLimit_X_Max))&&((yIdx >=iLimit_Y_Min)||(xIdx >=iLimit_X_Min))&&(iBlockCount < iLimit_Block)){iBlockCount++;switch(aVector[iVectorIdx]){case "L" : xIdx--;break;case "T" : yIdx--;break;case "R" : xIdx++;break;case "B" : yIdx++;break;}if((yIdx >=0)&&(xIdx >=0)&&(yIdx < arg_aBlock.length)&&(xIdx < arg_aBlock[0].length)){aResult[aResult.length ]=new Array(yIdx,xIdx);}}switch(aVector[iVectorIdx]){case "B" : iLimit_Block++;break;case "T" : iLimit_Block++;break;}if(iVectorIdx==aVector.length-1){iVectorIdx=0;}else{iVectorIdx++;}}return aResult;}function ShowSpiralImg(){var aTmp=undefined;var iIdx;aTmp=GetSpiralTiles(aBlock,oY.value,oX.value);for(iIdx=0;iIdx < aTmp.length;iIdx++){setTimeout("ShowBlockImg("+aTmp[iIdx][1]+","+aTmp[iIdx][0]+")",iIdx * 50);}}function ShowBlockImg(arg_yIdx,arg_xIdx){eval("oImg_"+arg_xIdx+"_"+arg_yIdx+".style.visibility='visible';");}

