////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//   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:45:09 by tews                                                                                              //
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 function Controller2(){this.id="oController2";this.iLR_Page=0;this.cOnShowContents=cOnShowContents;this.cOnWriteRCMail=cOnWriteRCMail;this.cOnScrollLeftThumbnail=cOnScrollLeftThumbnail;this.cOnScrollRightThumbnail=cOnScrollRightThumbnail;this.cOnMaximize=cOnMaximize;this.cOnRestore=cOnRestore;this.cOnMinimize=cOnMinimize;this.cOnAddBookMark=cOnAddBookMark;this.cOnAddTabBookMark=cOnAddTabBookMark;this.cOnShowBookMark=cOnShowBookMark;this.cOnPrint=cOnPrint;this.cOnRefresh=cOnRefresh;this.cOnClose=cOnClose;this.cOnGotoPage=cOnGotoPage;this.cOnFirstPage=cOnFirstPage;this.cOnRightPage=cOnRightPage;this.cOnLeftPage=cOnLeftPage;this.cOnLastPage=cOnLastPage;this.cOnAddTabBM=cOnAddTabBM;this.ccoAfterEnLarge=ccoAfterEnLarge;this.ccoAfterShrink=ccoAfterShrink;this.ccoDoEnLarge=ccoDoEnLarge;this.ccoDoShrink=ccoDoShrink;this.ccoDoLinkClick=ccoDoLinkClick;this.ccoDoScroll=ccoDoScroll;this.ccoInvalidPage=ccoInvalidPage;this.ccoToggle=ccoToggle;this.ccoToggleRestore=ccoToggleRestore;this.ccoDoResizeLinks=ccoDoResizeLinks;this.ccoAfterResize=ccoAfterResize;this.ccoAfterDoLeaf=ccoAfterDoLeaf;this.ccoBeforeDoLeaf=ccoBeforeDoLeaf;this.ccoShowWebLinkOperUI=ccoShowWebLinkOperUI;this.ccoHideWebLinkOperUI=ccoHideWebLinkOperUI;this.ccoConfirmWebLinkEditUI=ccoConfirmWebLinkEditUI;this.ccoCancelWebLinkEditUI=ccoCancelWebLinkEditUI;this.ccoAddWebLink=ccoAddWebLink;this.ccoDelWebLink=ccoDelWebLink;this.ccoModWebLink=ccoModWebLink;this.ccoPostChangedLinkData=ccoPostChangedLinkData;this.ccoBeginEnLarge=ccoBeginEnLarge;this.ccoBeginShrink=ccoBeginShrink;this.ccoShowScrap=ccoShowScrap;this.ccoShowSearch=ccoShowSearch;}


function ccoAfterEnLarge(arg_Page,arg_LR,arg_Level,arg_Byte,arg_X,arg_Y){
try{
			if(arg_Level == 1){
				var zoomPage = arg_Page;
				zoomInPageCRM(zoomPage);
			}
		}catch(e){}

if(!gbAllLoaded){return false;}var itmpPageNo=0;var iPageNo=arg_Page;if(Math.floor(arg_Page)!=arg_Page){iPageNo=Math.floor(arg_Page);}if(typeof(oPageStatus2)!="undefined"){oPageStatus2.dpsSetPageNo(iPageNo);}if(typeof(oBookMark2)!="undefined"){oBookMark2.dbmSetPageNo(iPageNo);}if(typeof(oThumbNail2)!="undefined"){oThumbNail2.dthSetPageNo(iPageNo);}if(typeof(oStatistics2)!="undefined"){this.iLR_Page=arg_LR;oStatistics2.dstSetPageView(arg_Page,arg_Level,arg_Byte);}if(typeof(oMiniMap2)!="undefined"){oMiniMap2.dmiDoShow();oMiniMap2.dmiDoRescale(arg_Page,arg_Level,arg_X,arg_Y);}if(typeof(oSearchPDF)!="undefined"){if(giDouble){oSearchPDF.dspReDelSearchLink(MgrLevel.Levels[arg_Level].oLevelDiv,arg_Level,arg_Page);if(Divstatus){oSearchPDF.dspReSizeSearchLink(MgrLevel.Levels[arg_Level].oLevelDiv,arg_Level,arg_Page);}}else{oSearchPDF.dspDeldoubleSearchLink(MgrLevel.Levels[arg_Level].oLevelDiv,arg_Page);		 oSearchPDF.dspDelSearchLink(MgrLevel.Levels[arg_Level].oLevelDiv,arg_Page);if(Divstatus){oSearchPDF.dspLdoubleReSizeSearchLink(MgrLevel.Levels[arg_Level].oLevelDiv,arg_Level,arg_Page);oSearchPDF.dspRdoubleReSizeSearchLink(MgrLevel.Levels[arg_Level].oLevelDiv,arg_Level,arg_Page);}}}}


function ccoAfterShrink(arg_Page,arg_LR,arg_Level,arg_Byte,arg_X,arg_Y){
try{
			if(arg_Level == 0){
				var zoomPage = arg_Page;
				zoomOutPageCRM(zoomPage);
			}
		}catch(e){}

if(!gbAllLoaded){return false;}var itmpPageNo=0;var iPageNo=Math.floor(arg_Page);if(typeof(oPageStatus2)!="undefined"){oPageStatus2.dpsSetPageNo(iPageNo);}if(typeof(oBookMark2)!="undefined"){oBookMark2.dbmSetPageNo(iPageNo);}if(typeof(oThumbNail2)!="undefined"){oThumbNail2.dthSetPageNo(iPageNo);}if(typeof(oStatistics2)!="undefined"){this.iLR_Page=arg_LR;if(oBook.cobIsDouble()==true){itmpPageNo=-(arg_LR * 0.5);}if(oBook.cobGetCurrLevelIdx()==0){itmpPageNo=0.5;}oStatistics2.dstSetPageView(iPageNo+itmpPageNo,arg_Level,arg_Byte);}if(typeof(oMiniMap2)!="undefined"){if(arg_Level==0){this.iLR_Page=0;oMiniMap2.dmiDoHide();}oMiniMap2.dmiDoRescale(arg_Page,arg_Level,arg_X,arg_Y);}if(typeof(oSearchPDF)!="undefined"){if(Divstatus){oSearchPDF.dspDelSearchLink(oBook.oCurrLevelDiv,oBook.cobGetCurrPage());if(arg_Level==0){oSearchPDF.dspLDivOn(oBook.oCurrLevelDiv,oBook.cobGetCurrPage());oSearchPDF.dspRDivOn(oBook.oCurrLevelDiv,oBook.cobGetCurrPage());}}else{oSearchPDF.dspDelSearchLink(oBook.oCurrLevelDiv,oBook.cobGetCurrPage());}}}function ccoDoEnLarge(arg_LR){oBook.cobDoEnLarge(arg_LR);}function ccoDoShrink(){oBook.cobDoShrink();}function ccoDoLinkClick(arg_Page,arg_LinkInfo,arg_Level){if(!gbAllLoaded){return false;}if(typeof(oStatistics2)!="undefined"){oStatistics2.dstSetLinkClick(arg_Page,arg_LinkInfo,arg_Level);}}function ccoDoScroll(arg_Left,arg_Top){if(!gbAllLoaded){return false;}if(typeof(oMiniMap2)!="undefined"){oMiniMap2.dmiDoScroll(arg_Left,arg_Top);}}function cOnShowContents(){if(!gbAllLoaded){return false;}}function cOnMaximize(){if(!gbAllLoaded){return false;}if(typeof(oMinMax2)!="undefined"){oMinMax2.dmmDoMaximize();}oBook.OnResize();}function cOnRestore(){if(!gbAllLoaded){return false;}if(typeof(oMinMax2)!="undefined"){oMinMax2.dmmDoRestore();}oBook.OnResize();if(typeof(oMiniMap2)!="undefined"){oMiniMap2.dmiDoReposition();}if(typeof(oScrap2)!="undefined"){oScrap2.dscDoReposition();}}function cOnMinimize(){if(!gbAllLoaded){return false;}if(typeof(oMinMax2)!="undefined"){oMinMax2.dmmDoMinimize();}}function cOnAddBookMark(arg_LR){if(!gbAllLoaded){return false;}if(typeof(oBookMark2)!="undefined"){oBookMark2.dbmDoAdd(oBook.cobGetCurrPage(),arg_LR);}}function cOnAddTabBookMark(arg_LR){if(!gbAllLoaded){return false;}if(typeof(oTabBookMark2)!="undefined"){oTabBookMark2.dbmDoAdd(oBook.cobGetCurrPage(),arg_LR);}}function cOnShowBookMark(){if(!gbAllLoaded){return false;}}function cOnPrint(){if(!gbAllLoaded){return false;}var iCurrPageNo=oBook.cobGetCurrPage();var iCurrLevel=oBook.cobGetCurrLevelIdx();if(typeof(oPrinter2)!="undefined"){oPrinter2.dprDoPrint(iCurrPageNo,iCurrLevel);}if(typeof(oStatistics2)!="undefined"){oStatistics2.dstSetPrint(iCurrPageNo,iCurrLevel);}}function cOnClose(){if(!gbAllLoaded){return false;}window.close();}function cOnRefresh(){if(!gbAllLoaded){return false;}if(typeof(oStatistics2)!="undefined"){var iCurrPageNo=oBook.cobGetCurrPage();var iCurrLevel=oBook.cobGetCurrLevelIdx();var itmpPageNo=0;if(oBook.cobIsDouble()==true){itmpPageNo=-(this.iLR_Page * 0.5);}oStatistics2.dstSetPageView(iCurrPageNo+itmpPageNo,iCurrLevel,80000);oStatistics2.dstDoSubmit();}}function cOnWriteRCMail(){if(!gbAllLoaded){return false;}if(typeof(oRCMail2)!="undefined"){oRCMail2.drmDoWriteRCMail();}}function cOnScrollLeftThumbnail(){if(!gbAllLoaded){return false;}if(typeof(oThumbnail2)!="undefined"){oThumbnail2.dthDoScrollLeft();}}function cOnScrollRightThumbnail(){if(!gbAllLoaded){return false;}if(typeof(oThumbnail2)!="undefined"){oThumbnail2.dthDoScrollRight();}}function cOnGotoPage(arg_Page){if(!gbAllLoaded){return false;}if(String(event)=="null"){oBook.GotoPage(arg_Page);}else{if(event.keyCode !=0){if(event.keyCode==13){oBook.GotoPage(arg_Page);}}else{oBook.GotoPage(arg_Page);}}}function cOnFirstPage(){if(!gbAllLoaded){return false;}oBook.LLeftPage();}function cOnRightPage(){if(!gbAllLoaded){return false;}oBook.RightPage();}function cOnLeftPage(){if(!gbAllLoaded){return false;}oBook.LeftPage();}function cOnLastPage(){if(!gbAllLoaded){return false;}oBook.RRightPage();}function ccoInvalidPage(arg_Page){if(!gbAllLoaded){return false;}if(typeof(oPageStatus2)!="undefined"){oPageStatus2.dpsInvalidPage(arg_Page);}}function ccoToggle(){if(!gbAllLoaded){return false;}if(typeof(oTabBookMark2)!="undefined"){oTabBookMark2.dtbToggle(arguments[0],arguments[1]);}}function ccoToggleRestore(){if(typeof(oMinMax2)!="undefined"){if(oMinMax2.dmnIsRestore()){this.cOnRestore();}else{this.cOnMaximize();}}}function ccoDoResizeLinks(){if(typeof(oLinker2)!="undefined"){if(gbWebLink !=true){oLinker2.ResizeLinks(arguments[0],arguments[1],arguments[2]);}}if(typeof(oWebLinker)!="undefined"){if(gbWebLink==true){oWebLinker.wlResizeLinks(arguments[0],arguments[1],arguments[2]);}}}function ccoAfterResize(){if(typeof(oMiniMap2)!="undefined"){oMiniMap2.dmiDoRescale(arguments[0],arguments[1],arguments[2],arguments[3]);}}function cOnAddTabBM(arg_LR){if(!gbAllLoaded){return false;}var iCurrPageNo=oBook.cobGetCurrPage();if(typeof(oTabBookMark2)!="undefined"){oTabBookMark2.dTabDoAdd(iCurrPageNo,arg_LR);}}function ccoBeforeDoLeaf(){if(!gbAllLoaded){return false;}if(MgrLevel.ItemIndex !=0){MgrLevel.Levels[MgrLevel.ItemIndex].LevelHide(MgrLevel.ClickLR);MgrSkin.HideScrollBar();if(gbWebLink !=true){if(typeof(oLinker2)!="undefined"){oLinker2.DestroyPageLinkObj(oBook.oCurrLevelDiv);}}else{if(typeof(oWebLinker)!="undefined"){oWebLinker.wlDestroyPageLinkObj(oBook.oCurrLevelDiv);}}MgrLevel.ItemIndex=0;}HideObj(MgrSkin.oToolTipDiv.tgTable);if(typeof(oMiniMap2)!="undefined"){oMiniMap2.dmiDoHide();}if(gbWebLink !=true){if(typeof(oLinker2)!="undefined"){oLinker2.DestroyPageLinkObj(oBook.oBasicLevelDiv);}}else{if(typeof(oWebLinker)!="undefined"){oWebLinker.wlDestroyPageLinkObj(oBook.oBasicLevelDiv);}}}

function ccoAfterDoLeaf(arg_Page,arg_Level,arg_Byte,arg_X,arg_Y){
try{
			nextPageCRM();
		}catch(e){}
if(!gbAllLoaded){return false;}this.iLR_Page=0;if(typeof(oLinker2)!="undefined"){if(gbWebLink !=true){var LeftPageNo=arg_Page-(0.5 * giLeafDirect);oBook.ID_Create_Left_Link_Obj=setTimeout("oLinker2.CreatePageLinkObj("+oBook.oCurrLevelDiv.id+","+LeftPageNo+","+MgrLevel.ItemIndex+")",10);var RightPageNo=arg_Page+(0.5 * giLeafDirect);oBook.ID_Create_Right_Link_Obj=setTimeout("oLinker2.CreatePageLinkObj("+oBook.oCurrLevelDiv.id+","+RightPageNo+","+MgrLevel.ItemIndex+")",10);}}if(typeof(oWebLinker)!="undefined"){if(gbWebLink==true){var LeftPageNo=arg_Page-(0.5 * giLeafDirect);oBook.ID_Create_Left_Link_Obj=setTimeout("oWebLinker.wlCreatePageLinkObj("+oBook.oCurrLevelDiv.id+","+LeftPageNo+","+MgrLevel.ItemIndex+")",20);var RightPageNo=arg_Page+(0.5 * giLeafDirect);oBook.ID_Create_Right_Link_Obj=setTimeout("oWebLinker.wlCreatePageLinkObj("+oBook.oCurrLevelDiv.id+","+RightPageNo+","+MgrLevel.ItemIndex+")",20);}}var iPageNo=Math.floor(oBook.cobGetCurrPage());if(typeof(oPageStatus2)!="undefined"){oPageStatus2.dpsSetPageNo(iPageNo);}if(typeof(oBookMark2)!="undefined"){oBookMark2.dbmSetPageNo(iPageNo);}if(typeof(oThumbNail2)!="undefined"){oThumbNail2.dthSetPageNo(iPageNo);}if(typeof(oStatistics2)!="undefined"){oStatistics2.dstSetPageView(arg_Page,0,arg_Byte);}if(typeof(oLLPageNo)!="undefined"){oLLPageNo.dpnSetPageNo(arg_Page-(0.5 * giLeafDirect));}if(typeof(oLRPageNo)!="undefined"){oLRPageNo.dpnSetPageNo(arg_Page+(0.5 * giLeafDirect));}if(typeof(oTabBookMark2)!="undefined"){oTabBookMark2.dtbUpdate();}if(typeof(oNavigator2)!="undefined"){oNavigator2.RePosition(arg_Page);}if(typeof(oSearchPDF)!="undefined"){if(Divstatus){oSearchPDF.dspDelSearchLink(oBook.oCurrLevelDiv,oBook.cobGetCurrPage());if(arg_Level==0){oSearchPDF.dspLDivOn(oBook.oCurrLevelDiv,oBook.cobGetCurrPage());oSearchPDF.dspRDivOn(oBook.oCurrLevelDiv,oBook.cobGetCurrPage());}}else{oSearchPDF.dspDelSearchLink(oBook.oCurrLevelDiv,oBook.cobGetCurrPage());}}}function ccoShowWebLinkOperUI(){if(!gbAllLoaded){return false;}if(oBook.cobGetCurrLevelIdx()!=0){return;}if(typeof(oOperUI)!="undefined"){gbWebLink=true;if(oBook.cobGetCurrLevelIdx()==0){if(typeof(oLinker2)!="undefined"){oLinker2.DestroyPageLinkObj(oBook.oBasicLevelDiv);}}else{if(typeof(oLinker2)!="undefined"){oLinker2.DestroyPageLinkObj(oBook.oCurrLevelDiv);}}oWebLinker.wlInitial();oOperUI.ouShow();}}function ccoHideWebLinkOperUI(){if(!gbAllLoaded){return false;}if(typeof(oOperUI)!="undefined"){gbWebLink=false;if(oBook.cobGetCurrLevelIdx()==0){oWebLinker.wlDestroyPageLinkObj(oBook.oBasicLevelDiv);}else{oWebLinker.wlDestroyPageLinkObj(oBook.oCurrLevelDiv);}if(typeof(oLinker2)!="undefined"){oLinker2.dlInitial();}oEditUI.euHide();oOperUI.ouHide();}}function ccoConfirmWebLinkEditUI(){if(oWebLinker.SelectedWebLink==null)return;oWebLinker.wlSetFromEditUI();oLinkUpdater.luImmigration(oWebLinker.SelectedWebLink,"mod");}function ccoCancelWebLinkEditUI(){oEditUI.euHide();}function ccoAddWebLink(){if(!gbAllLoaded){return false;}if(typeof(oEditUI)!="undefined"){if(oBook.cobGetCurrLevelIdx()==0){oWebLinker.wlAppend(-1);}else{if(oBook.iDouble==0){if((parseInt(oBook.oCurrLevelDiv.parentElement.style.width)/ 2)-(parseInt(oBook.oCurrLevelDiv.style.left))< oBookInfo.aLevelInfo[oBook.cobGetCurrLevelIdx()][2]){oWebLinker.wlAppend(-1);}else{oWebLinker.wlAppend(1);}}else{oWebLinker.wlAppend(MgrLevel.ClickLR);}}oEditUI.euSetToEditUI(oWebLinker.SelectedWebLink);oEditUI.euShow();oWebLinker.wlUpdateOrginLinkData();oLinkUpdater.luUpdateLinkData(oWebLinker.SelectedWebLink,"add");}}function ccoDelWebLink(){if(!gbAllLoaded){return false;}if(typeof(oEditUI)!="undefined"){oWebLinker.wlDelete(oWebLinker.SelectedWebLink);oWebLinker.wlUpdateOrginLinkData();oLinkUpdater.luUpdateLinkData(oWebLinker.SelectedWebLink,"del");oEditUI.euHide();oWebLinker.SelectedWebLink=null;}}function ccoModWebLink(){if(!gbAllLoaded){return false;}if(typeof(oWebLinker)!="undefined"){oEditUI.euShow();}}function ccoPostChangedLinkData(){oLinkUpdater.luPostChangedLinkData();this.ccoHideWebLinkOperUI();}function ccoBeginEnLarge(){if(typeof(oLinker2)!="undefined"){if(gbWebLink !=true){setTimeout("oLinker2.ResizeLinks("+arguments[0].id+","+arguments[1]+","+arguments[2]+")",20);}}if(typeof(oWebLinker)!="undefined"){if(gbWebLink==true){setTimeout("oWebLinker.wlResizeLinks("+arguments[0].id+","+arguments[1]+","+arguments[2]+")",20);}}}function ccoBeginShrink(){if(typeof(oLinker2)!="undefined"){if(gbWebLink !=true){oLinker2.ResizeLinks(arguments[0],arguments[1],arguments[2]);}}if(typeof(oWebLinker)!="undefined"){if(gbWebLink==true){oWebLinker.wlResizeLinks(arguments[0],arguments[1],arguments[2]);}}}function ccoShowScrap(){if(typeof(oScrap2)!="undefined"){oScrap2.dscShowScrap();}}function ccoShowSearch(){if(typeof(oSearchPDF)!="undefined"){oSearchPDF.dspShowSearchDiv();}}
