// Copyright 2009, BMT Defence Services Ltd, All rights reserved.
var lmDefaultSection=-1;var omDefaultContentFrame;var omDefaultDivMainContent;var lmDefaultDragBarWidth;var bmDefaultDragBarMouseDown;var lmDefaultUserAccessLevel;var lmDefaultNavigationIndex=0;var omNewUserAdmin;var omDefaultSectionNode=new Object();var omDefaultSectionText=new Object();var omDefaultTrail=new Object();var omTreeview=new Object();var omDefaultNavigation;var zmDefaultTreeviewCutCopyNodeID=null;var zmDefaultTreeviewPasteNodeID=null;var zmDefaultCatalogueNavigate=null;
function pageLoad(){if(!bmtWebIECheck(6)){document.getElementById("divNonIE").style.display="block";return;}var opSponser=document.getElementById('divContentSection6').firstChild.cells[1].firstChild.cells[0];opSponser.childNodes[6].nodeValue='Birch 2a #3220';opSponser.childNodes[15].nodeValue='Telephone: 030679 32479';bmtAjaxSetDataService("LoginService");bmtWebFormLoad(-1);bmtWebBeforeUnload();defaultDragBarLoad();$addHandler(document.frmMain,"resize",function(){messageScreenSize();});$addHandler(document.getElementById("aLogout"),"click",function(){defaultLogout();});$addHandler(document.getElementById("aAdmin"),"click",function(){defaultAdmin();});defaultSearchLoad();var lpLastSection=9;for(var lpSection=1;lpSection<=lpLastSection;lpSection++){defaultSectionSetUp(lpSection);}omDefaultDivMainContent=document.getElementById("divMainContent");var lpSectionNo=parseInt(defaultGetParameter("Section"));var zpNodeID=defaultGetParameter("NodeID");if(isNaN(lpSectionNo)==false){if(lpSectionNo==7){omDefaultSectionNode[lpSectionNo]=defaultGetParameter("NodeID");omDefaultSectionText[lpSectionNo]=defaultGetParameter("NodeText");if(zpNodeID!="")defaultSectionLoad(lpSectionNo,zpNodeID);else defaultSectionLoad(lpSectionNo);}else defaultSectionLoad(lpSectionNo);}else{defaultSectionLoad(1);}var zpLatestBook=defaultGetParameter("LatestBook").split("_");if(zpLatestBook.length==2)defaultCatalogueLoad(zpLatestBook[0],zpLatestBook[1],true);messageScreenHide();}
function defaultLogout(){window.iframeContent7.adminLogout();}
function defaultAdmin(){defaultChangeSection(7);}
function defaultGetCatalogueStructureID(){if(window.iframeContent1.catalogueGetParameter("ucCatalogue","ParentID"))return window.iframeContent1.catalogueGetParameter("ucCatalogue","ParentID");else return-2;}
function defaultSectionLoad(lpSection){document.getElementById("divDefault").style.display="block";if(lmDefaultSection==-1){defaultChangeSection(lpSection);}window.status="Done";}
function defaultSectionSetUp(lSection){var opAnchor=document.getElementById("aSection"+lSection);$addHandler(opAnchor,"mouseover",function(){defaultSectionMouseOver(lSection);});$addHandler(opAnchor,"mouseout",function(){defaultSectionMouseOut(lSection);});$addHandler(opAnchor,"mousedown",function(){defaultSectionMouseDown(lSection);});$addHandler(opAnchor,"focus",function(){defaultSectionMouseOver(lSection);});$addHandler(opAnchor,"blur",function(){defaultSectionMouseOut(lSection);});$addHandler(opAnchor,"click",function(){defaultChangeSection(lSection);event.returnValue=false;});}
function defaultSetTablePaging(){var lmPagingCount=document.getElementById("hidCurrentUserPagingCount").value;var lmPagingType=document.getElementById("hidCurrentUserPagingType").value;var bpPaging=(lmPagingType==PagingType.Paging);}
function defaultMainLoad(lSectionID){var zpNodeID=defaultGetParameter("NodeID");if(lSectionID==1){defaultCatalogueLoad(-2,-2);}else if(lSectionID==3){document.getElementById("iframeContent3").style.display="block";if(document.getElementById("iframeContent3").src==""){messageScreenShow(MessageScreenType.Progress,"Loading...",document.getElementById("divMainContent"));document.getElementById("iframeContent3").src="JNE/SubmitArticle/SubmitArticle.aspx?lArticleID=-1";}omDefaultContentFrame=document.getElementById("iframeContent3");omDefaultDivMainContent=document.getElementById("iframeContent3");}else if(lSectionID==9){document.getElementById("iframeContent9").style.display="block";messageScreenShow(MessageScreenType.Progress,"Loading...",document.getElementById("divMainContent"));if(document.getElementById("iframeContent9").src=="JNE/Comment/DisplayComments.aspx"){document.getElementById("iframeContent9").contentWindow.location.reload(true);}else{document.getElementById("iframeContent9").src="JNE/Comment/DisplayComments.aspx";}omDefaultContentFrame=document.getElementById("iframeContent9");omDefaultDivMainContent=document.getElementById("iframeContent9");}else if(lSectionID==7){document.getElementById("iframeContent7").style.display="block";if(document.getElementById("iframeContent7").src==""){messageScreenShow(MessageScreenType.Progress,"Loading...",document.getElementById("divMainContent"));document.getElementById("iframeContent7").src="JNE/AdminLogin/AdminLogin.aspx";}omDefaultContentFrame=document.getElementById("iframeContent7");omDefaultDivMainContent=document.getElementById("iframeContent7");}else if(lSectionID==8){document.getElementById("iframeContent8").style.display="block";if(document.getElementById("iframeContent8").src==""){messageScreenShow(MessageScreenType.Progress,"Loading...",document.getElementById("divMainContent"));document.getElementById("iframeContent8").src="JNE/LegalInfo/LegalInfo.aspx";}omDefaultContentFrame=document.getElementById("iframeContent8");omDefaultDivMainContent=document.getElementById("iframeContent8");}}
function defaultCatalogueLoad(lEntityTypeID,lID,bpRepopulate){defaultChangeSection(1);if(document.getElementById("iframeContent1").src=="")document.getElementById("iframeContent1").src="JNE/CatalogueBrowse/CatalogueBrowse.aspx?lEntityTypeID="+lEntityTypeID+"&lEntityID="+lID;else{if(bpRepopulate){var zpParentID=lEntityTypeID+"_"+lID;if(document.iframeContent1.location.href=="about:blank")zmDefaultCatalogueNavigate=zpParentID;else document.iframeContent1.catalogueNavigate("ucCatalogue",zpParentID);}}}
function defaultCatalogueRefreshPage(zBookID){if(document.getElementById("iframeContent1").src!=""){if(document.iframeContent1.location.href!="about:blank"){var zpParentID=document.iframeContent1.catalogueGetParameter("ucCatalogue","ParentID");if(zBookID==zpParentID)document.iframeContent1.catalogueNavigate("ucCatalogue",zpParentID);}}}
function defaultCatalogueBrowseDisplayItem(){var zpID=event.srcElement.getAttribute("DataID");var lpEntityType=parseInt(zpID.substr(0,zpID.indexOf("_")));var lpID=parseInt(zpID.slice(zpID.indexOf("_")+1));defaultChangePage(lpEntityType,lpID);}
function defaultSearchLoad(){controlLoad("txtPaperText");controlLoad("cboArticleType");controlLoad("cboCriteria");controlLoad("cboTitlesOnly");controlLoad("cboYearFrom");controlLoad("cboYearTo");selectSetFirstItem("cboYearFrom");selectSetFirstItem("cboYearTo");toolbarLoad("tbarSearch");toolbarSetOnClick("btnSearch",function(){defaultSearch();},"tbarSearch");toolbarSetOnClick("btnReset",function(){defaultSearchReset();},"tbarSearch");$addHandler(document.getElementById("txtPaperText_txtTextbox"),"keydown",function(){if(event.keyCode==13){defaultSearch();return false;}});}
function defaultSearchResultsListClick(oRow){var zpNodeID=oRow.key;var zpIDs=zpNodeID.split("_");var lpEntityTypeID=parseInt(zpIDs[0]);var lpEntityID=parseInt(zpIDs[1]);defaultChangeSection(1);window.iframeContent1.catalogueBrowseOpenItemForEdit.call(null,lpEntityTypeID,lpEntityID);}var zpPaperText;var zpPaperTitle;var lpSearchType;var lpTitlesOnly
var lpCriteria;var lpYearFrom;var lpYearTo;
function defaultSearch(){zpPaperText=bmtStringPrepForSearch(controlGetValue("txtPaperText"));zpPaperTitle=controlGetValue("txtPaperTitle");lpSearchType=controlGetValue("cboArticleType");lpTitlesOnly=controlGetValue("cboTitlesOnly");lpCriteria=controlGetValue("cboCriteria");lpYearFrom=controlGetValue("cboYearFrom");lpYearTo=controlGetValue("cboYearTo");if(lpYearTo==-1){var d=new Date();lpYearTo=""+d.getFullYear();}if(lpYearFrom>lpYearTo){controlGetElement("trYearsValidation").style.display="block";controlGetElement("tdYearsValidation").innerText="Error.  'From' year must be less than 'To' year";}else{controlGetElement("trYearsValidation").style.display="none";defaultPageSearch(1);}}
function defaultPageSearch(lPage){var opIframe;messageScreenShow(MessageScreenType.Progress,"Searching...",document.getElementById("divContentSection2"));opIframe=document.getElementById("iframeSearch");zpSearchText=zpPaperText.replace(/</g,"");zpSearchText=zpSearchText.replace(/>/g,"");zpSearchText=bmtStringPrepForSearch(zpSearchText);bmtWebNavigateIframe(opIframe,"JNE/Search/search.aspx?Text="+zpSearchText+"&Title="+zpPaperTitle+"&Type="+lpSearchType+"&Criteria="+lpCriteria+"&YearFrom="+lpYearFrom+"&YearTo="+lpYearTo+"&Page="+lPage+"&TitlesOnly="+lpTitlesOnly);}
function defaultSearchReset(){controlSetValue("txtPaperText","");controlSetValue("cboArticleType","-1")
controlSetValue("cboCriteria","-1")
controlSetValue("cboTitlesOnly","-1")
controlSetValue("cboYearFrom","-1")
controlSetValue("cboYearTo","-1")}var lmPageControlPosition=1;
function defaultCreatePaging(lCurrentPage,lTotalRows,lPageSelected){if(isNaN(lTotalRows))lTotalRows=0;var lpPageControlLength=20;var lpPageControlPosition=parseInt((lCurrentPage-1)/lpPageControlLength)+1;var lpCurrentPage=lPageSelected;lmPageControlPosition=lpPageControlPosition;var opTDTableListPaging=document.getElementById("tdPaging");opTDTableListPaging.innerHTML="";var lpTotalRows=lTotalRows;document.getElementById("tdRecordCount").innerHTML="Number of Search Results: <b>"+lTotalRows+"</b>";var lpPageSize=20;var lpStart=((lpPageControlPosition-1)*lpPageControlLength)+1;var lpEnd=(lpPageControlLength*lpPageControlPosition);var lpLastPage=parseInt((lpTotalRows-1)/lpPageSize)+1;if(lpEnd>lpLastPage)lpEnd=lpLastPage;var opAnchor;if(lpStart!=1){opAnchor=document.createElement("a");opAnchor.id="PagingBack";opAnchor.href="#";opAnchor.className="tableListPaging";$addHandler(opAnchor,"click",function(){defaultPageAnchorClick(this,lTotalRows);return false;});opAnchor.appendChild(document.createTextNode("<.."));opAnchor.title="View the previous set of pages";opTDTableListPaging.appendChild(opAnchor);opTDTableListPaging.appendChild(document.createTextNode(" "));}if(lpEnd>1){opTDTableListPaging.style.display="block";for(var lpPageLoop=lpStart;lpPageLoop<=lpEnd;lpPageLoop++){if(lpPageLoop==lpCurrentPage){opTDTableListPaging.style.cursor="default";opTDTableListPaging.appendChild(document.createTextNode(lpPageLoop));}else{opAnchor=document.createElement("a");opAnchor.id="Page_"+lpPageLoop;opAnchor.page=lpPageLoop;opAnchor.href="#";opAnchor.className="tableListPaging";$addHandler(opAnchor,"click",function(){defaultPageAnchorClick(this,lTotalRows);return false;});opAnchor.appendChild(document.createTextNode(lpPageLoop));opAnchor.title="View the next set of pages";opTDTableListPaging.appendChild(opAnchor);}if(lpPageLoop<lpEnd||lpLastPage>lpEnd)opTDTableListPaging.appendChild(document.createTextNode(" "));}}else opTDTableListPaging.style.display="none";if(lpLastPage>lpEnd){opAnchor=document.createElement("a");opAnchor.id="PagingNext";opAnchor.href="#";opAnchor.className="tableListPaging";$addHandler(opAnchor,"click",function(){defaultPageAnchorClick(this,lTotalRows);return false;});opAnchor.appendChild(document.createTextNode("..>"));opAnchor.title="View the next set of pages";opTDTableListPaging.appendChild(opAnchor);}}
function defaultPageAnchorClick(oAnchor,lTotalRows){if(oAnchor.id=="PagingNext"||oAnchor.id=="PagingBack"){var lpAdjust;if(oAnchor.id=="PagingNext")lpAdjust=0;else lpAdjust=-2;var lpPageControlLength=20;if(!lpPageControlLength)lpPageControlLength=20;var lpPageSelected=window.frames["iframeSearch"].searchPageSelected();var lpCurrentPage=(lmPageControlPosition+lpAdjust)*lpPageControlLength+1;defaultCreatePaging(lpCurrentPage,lTotalRows,lpPageSelected);}else{defaultPageSearch(oAnchor.page);}}
function defaultContact(zpEmailAddress){var zpHREF=new String(document.location.href);if(zpHREF.slice(zpHREF.length-1,zpHREF.length)=="#")zpHREF=zpHREF.slice(0,zpHREF.length-1);var opReg=/\&/g;zpHREF=zpHREF.replace(opReg,"%26");document.location.href="MailTo:"+zpEmailAddress+"?subject=JNE Web System";event.returnValue=false;}
function defaultNavigateSuccess(lNavigationIndex){lmDefaultNavigationIndex+=lNavigationIndex;}
function defaultNavigateCancel(lNavigationIndex){if(lNavigationIndex<0){while(lNavigationIndex++!=0){omDefaultNavigation.contentWindow.history.forward();}}else{while(lNavigationIndex--!=0){omDefaultNavigation.contentWindow.history.back();}}}
function defaultNavigationUnload(){window.status="Loading ...";controlGetElement("divMain").style.display="none";controlGetElement("divLoading").style.display="block";}
function defaultNavigation(lSection,zNodeID,zNodeText,lIndex){var bpSame=false;if(lIndex!=lmDefaultNavigationIndex){var lpNavigationIndex;lpNavigationIndex=lIndex-lmDefaultNavigationIndex;defaultSetHREF(lSection,zNodeID,zNodeText);if(zNodeID=="")defaultChangeSection(lSection,lpNavigationIndex);else defaultFavourite(lpNavigationIndex);defaultSetTitle(zNodeText);}}
function defaultStoreNavigation(lSection,zNodeID,zNodeText){var bpNew=false;if(!omDefaultNavigation){bpNew=true;omDefaultNavigation=document.createElement("iframe");omDefaultNavigation.style.display="none";document.body.appendChild(omDefaultNavigation);}else{var opForm=omDefaultNavigation.contentWindow.document.frmMain;try{omDefaultNavigation.contentWindow.navigationPageChange();if(parseInt(opForm.txtSection.value)==lSection&&parseInt(opForm.txtView.value)==lView&&opForm.txtNodeID.value==zNodeID)return;}catch(opCatch){}}var zpText=defaultGetSectionText(lSection);if(!zpText)zpText="";if(zNodeText&&zNodeText!='')zpText+=' - '+zNodeText;if(!bpNew){var opForm=omDefaultNavigation.contentWindow.document.frmMain;try{if(lSection==parseInt(opForm.txtSection.value)&&lView==parseInt(opForm.txtView.value)&&zNodeID==opForm.txtNodeID.value)return;}catch(opCatch){}}if(zNodeID)zNodeID="&zNodeID="+zNodeID;omDefaultNavigation.src="Navigation.aspx?lSection="+lSection+zNodeID+"&zTitle="+zpText+"&lIndex="+ ++lmDefaultNavigationIndex;}
function defaultChangeSection(lSection,lNavigationIndex){if(lSection!=lmDefaultSection){var zpNodeID=omDefaultSectionNode[lSection];var zpNodeText=omDefaultSectionText[lSection];if(!zpNodeText)zpNodeText=defaultGetSectionText(lSection);if(!lNavigationIndex&&lSection!=4)defaultStoreNavigation(lSection,zpNodeID);if(lSection!=4)defaultSetHREF(lSection,zpNodeID,zpNodeText);if(messageScreenCount()>0){if(messageScreenGetType()==MessageScreenType.Progress)return;else{document.getElementById("divHome"+lmDefaultSection).style.display="block";bmtWebNavigateIframe(omDefaultContentFrame,"");omDefaultContentFrame.style.display="none";messageScreenHide();}}var lpOldSection=lmDefaultSection;lmDefaultSection=lSection;if(lpOldSection!=-1&&lpOldSection!=lSection){if(lSection==4){if(confirm("Are you sure you want to navigate to the Home Page?"))window.location="login.aspx";else{lmDefaultSection=lpOldSection;defaultSectionMouseOut(lSection);return;}}defaultSectionMouseOut(lpOldSection);document.getElementById("divSection"+lpOldSection).style.display="none";document.getElementById("divContentSection"+lpOldSection).style.display="none";}var opRow=document.getElementById("trSection"+lSection);defaultSectionMouseOut(lSection);var opContentSection=document.getElementById("divContentSection"+lSection);opContentSection.style.display="block";opRow.clicked="true";document.getElementById("sectionTitle").innerHTML=opRow.title;if(lSection==2){document.getElementById("tdSideBar2").className="defaultSideMenu";document.getElementById("tdTreeviewMove").style.display="block";document.getElementById("divSection"+lSection).style.display="block";controlGetElement("trYearsValidation").style.display="none";}else{document.getElementById("tdSideBar2").className="defaultSideMenuHide";document.getElementById("tdTreeviewMove").style.display="none";}defaultMainLoad(lSection);omDefaultContentFrame=document.getElementById("iframeContent"+lmDefaultSection);omDefaultDivMainContent=document.getElementById("iframeContent"+lmDefaultSection);}if(lNavigationIndex)defaultNavigateSuccess(lNavigationIndex);}
function defaultIconClicked(lpSectionNo){document.getElementById("divHomePage").style.display="none";document.getElementById("divDefault").style.display="block";if(lmDefaultSection==-1){defaultChangeSection(lpSectionNo);}var zpNodeID=defaultFavourite();window.status="Done";}
function defaultChangePage(lEntityType,lID,zNodeText,zNodeID,lNavigationIndex){if(messageScreenCount()>0&&messageScreenGetType()==MessageScreenType.Progress)return;var zpPage;var zpParameters;var lpParentID;var lpParentTypeID;var lpUserType=-1;var bpLoad=false;var bpPageFound=true;if(!zNodeID)zNodeID=lEntityType+"_"+lID;if(!isNaN(lID))lID=parseInt(lID);var opSection=document.getElementById("divContentSection"+lmDefaultSection);omDefaultContentFrame=document.getElementById("iframeContent"+lmDefaultSection);omDefaultDivMainContent=document.getElementById("iframeContent"+lmDefaultSection);if(opSection.view=="1"){if(omDefaultContentFrame.style.display!="block")omDefaultContentFrame.style.display="block";var bpLoad;if(omDefaultContentFrame)bpLoad=controlNavigateCheck(omDefaultContentFrame.contentWindow);else bpLoad=true;}if(bpLoad){if(lNavigationIndex)defaultNavigateSuccess(lNavigationIndex);else defaultStoreNavigation(lmDefaultSection,zNodeID);var zpSrc="";try{zpSrc=String(document.getElementById("iframeContent"+lmDefaultSection).contentWindow.location.href);}catch(opCatch){}if(zpSrc.indexOf(zpPage)==-1){messageScreenShow(MessageScreenType.Progress,"Loading Data...",omDefaultContentFrame);bmtWebNavigateIframe(document.getElementById("iframeContent"+lmDefaultSection),zpPage+zpParameters);}else{try{switch(lEntityType){case EntityType.CatalogueContent:case EntityType.CatalogueFolder:omDefaultContentFrame.contentWindow.linkCatalogueContentReload.call(null,lID,zNodeID);break;case EntityType.Comments:omDefaultContentFrame.contentWindow.commentAuthorisationReload.call(null);break;}}catch(opCatch){}}}}
function defaultTreeviewGetPath(EntityType,EntityID,TreeviewID,SectionID,ViewID,TableListID){defaultChangeSection(SectionID);if(TreeviewID!=-1)treeviewExecuteTrail("ucTree"+TreeviewID,EntityType+"_"+EntityID,0,defaultTreeviewGetPathResponse);else defaultRefreshTableList(EntityType,EntityID);}
function defaultTreeviewGetPathResponse(zTreeviewID,zNodeID,lNavigationIndex){var lpEntityType=parseInt(zNodeID.substr(0,zNodeID.indexOf("_")));var lpID=parseInt(zNodeID.slice(zNodeID.indexOf("_")+1));setTimeout(function(){treeviewSelectNode(zTreeviewID,zNodeID);window.status="Done";},1);defaultChangePage(lpEntityType,lpID,treeviewGetNodeText(zTreeviewID,zNodeID),zNodeID,lNavigationIndex);}
function defaultTreeviewOnClick(zTreeviewID,zNodeID){var lpEntityType=parseInt(zNodeID.substr(0,zNodeID.indexOf("_")));var lpID;if(zNodeID.indexOf(",")!=-1)lpID=zNodeID.slice(zNodeID.indexOf("_")+1,zNodeID.indexOf(","));else lpID=zNodeID.slice(zNodeID.indexOf("_")+1);if(defaultChangePage(lpEntityType,lpID,-1,zNodeID)==false){treeviewToggleNode(zTreeviewID,zNodeID);}}
function defaultSectionMouseOver(lpSection){var opRow=document.getElementById("trSection"+lpSection);if(lpSection==lmDefaultSection){opRow.className="defaultSectionButtonSelectedHover";}else{opRow.className="defaultSectionButtonHover";}return true;}
function defaultSectionMouseOut(lpSection){var opRow=document.getElementById("trSection"+lpSection);if(lpSection==lmDefaultSection){opRow.className="defaultSectionButtonSelected";}else{opRow.className="defaultSectionButtonUnselected";}return true;}
function defaultSectionMouseDown(lpSection){var opRow=document.getElementById("trSection"+lpSection);opRow.className="defaultSectionButtonSelectedHover";}
function defaultContentFrame(){return omDefaultContentFrame;}
function defaultContentDiv(){return omDefaultDivMainContent;}
function defaultDragBarLoad(){var opAnchorDragBarShowHide=document.getElementById("aDragBarShowHide");$addHandler(opAnchorDragBarShowHide,"click",function(){defaultDragBarDoubleClick();event.returnValue=false;});$addHandler(opAnchorDragBarShowHide,"mousedown",function(){defaultDragBarHideMouseDown();});$addHandler(opAnchorDragBarShowHide,"mouseover",function(){defaultDragBarHideBar(false,event);});$addHandler(opAnchorDragBarShowHide,"mouseout",function(){defaultDragBarHideBar(true,event);});$addHandler(opAnchorDragBarShowHide,"focus",function(){defaultDragBarHideBar(false,event);});$addHandler(opAnchorDragBarShowHide,"blur",function(){defaultDragBarHideBar(true,event);});$addHandler(opAnchorDragBarShowHide,"keydown",function(){defaultDragBarKeyDown(this,event);});$addHandler(document.body,"mousemove",function(){defaultDragBarMouseMove(event);});$addHandler(document.body,"mouseup",function(){defaultDragBarMouseUp(event);});var opDivBorder=document.getElementById("divBorder");$addHandler(opDivBorder,"mousedown",function(){defaultDragBarMouseDown(event);});$addHandler(opDivBorder,"dblclick",function(){defaultDragBarDoubleClick();});}
function defaultDragBarMouseDown(oEvent){if(oEvent.srcElement.id!="imgDragBarShowHide"){document.getElementById("divBorder").style.backgroundImage="url('Images/DragBarBorderMove.jpg')";document.getElementById("divBorder").style.position="absolute";document.getElementById("divBorder").style.left=oEvent.x-5;bmDefaultDragBarMouseDown=true;}return true;}
function defaultDragBarHideMouseDown(){var opImgShowHide=document.getElementById("imgDragBarShowHide");if(document.getElementById("tdSideBar2").className=="defaultSideMenu"){opImgShowHide.src="Images/DragBarHideBarClick.gif";}else{opImgShowHide.src="Images/DragBarShowBarClick.gif";}}
function defaultDragBarDoubleClick(){if(document.getElementById("tdSideBar2").className=="defaultSideMenu")defaultDragBarHide();else defaultDragBarShow();}
function defaultDragBarShow(){var opImgShowHide=document.getElementById("imgDragBarShowHide");document.getElementById("tdSideBar2").className="defaultSideMenu";document.getElementById("tdSideBar2").style.width=lmDefaultDragBarWidth;document.getElementById("tdSideBarSpacer").style.display="block";opImgShowHide.src="Images/DragBarHideBar.gif";}
function defaultDragBarHide(){var opImgShowHide=document.getElementById("imgDragBarShowHide");lmDefaultDragBarWidth=parseInt(document.getElementById("tdSideBar2").style.width);document.getElementById("tdSideBar2").className="defaultSideMenuHide";document.getElementById("tdSideBarSpacer").style.display="none";opImgShowHide.src="Images/DragBarShowBar.gif";}
function defaultDragBarMouseMove(oEvent){if(bmDefaultDragBarMouseDown==true){document.getElementById("divSliderBackground").style.display="block";document.getElementById("divBorder").style.left=oEvent.x-5;}return true;}
function defaultDragBarMouseUp(oEvent){if(bmDefaultDragBarMouseDown==true){var lpWidth;lpWidth=oEvent.clientX-document.getElementById("tdSideBar").clientWidth-12;defaultDragBarMove(lpWidth);document.getElementById("divBorder").style.backgroundImage="";document.getElementById("divBorder").style.position="";document.getElementById("divSliderBackground").style.display="none";bmDefaultDragBarMouseDown=false;}return true;}
function defaultDragBarMove(lWidth){if(lWidth<280&&lWidth>140)lWidth=280;if(lWidth<=140)lWidth=0;if(lWidth==0){defaultDragBarDoubleClick();}else{lmDefaultDragBarWidth=lWidth;document.getElementById("tdSideBar2").className="defaultSideMenu";document.getElementById("tdSideBar2").style.width=lWidth;document.getElementById("divDefault").style.paddingLeft="2px";document.getElementById("imgDragBarShowHide").src="Images/DragBarHideBar.gif";}}
function defaultDragBarHideBar(bOriginal,oEvent){var opImage=document.getElementById("imgDragBarShowHide");if(document.getElementById("tdSideBar2").className=="defaultSideMenu"){if(bOriginal){opImage.src="Images/DragBarHideBar.gif";}else{opImage.src="Images/DragBarHideBarHover.gif";}opImage.style.cursor="Images/DragBarLeftArrow.cur";opImage.title="Hide left panel";}else{if(bOriginal){opImage.src="Images/DragBarShowBar.gif";}else{opImage.src="Images/DragBarShowBarHover.gif";}opImage.style.cursor="Images/DragBarRightArrow.cur";opImage.title="Show left panel";}oEvent.returnValue=false;}
function defaultDragBarKeyDown(oAnchor,oEvent){switch(oEvent.keyCode){case 37:if(!lmDefaultDragBarWidth)lmDefaultDragBarWidth=parseInt(document.getElementById("tdSideBar2").style.width);var lpWidth=lmDefaultDragBarWidth;if(lpWidth<=280)lpWidth=0;defaultDragBarMove(lpWidth-5);oEvent.returnValue=false;break;case 39:if(!lmDefaultDragBarWidth)lmDefaultDragBarWidth=parseInt(document.getElementById("tdSideBar2").style.width);if(lmDefaultDragBarWidth==0)defaultDragBarDoubleClick();else defaultDragBarMove(lmDefaultDragBarWidth+5);oEvent.returnValue=false;break;}}
function defaultSetHelpPage(){switch(lmDefaultSection){case 1:zmDefaultHelpPage="Data.htm";break;case 2:zmDefaultHelpPage="LinkDoc.htm";break;case 3:zmDefaultHelpPage="View.htm";break;case 4:zmDefaultHelpPage="Search.htm";break;case 5:zmDefaultHelpPage="Administration.htm";break;}}
function defaultSetHREF(lSection,zNodeID,zNodeText){if(lSection)defaultSetParameter("Section",lSection);else defaultClearParameter("Section");if(!zNodeID)zNodeID=omDefaultSectionNode[lSection];if(zNodeID){defaultSetParameter("NodeID",zNodeID);omDefaultSectionNode[lSection]=zNodeID;}else defaultClearParameter("NodeID");if(!zNodeText)zNodeText=omDefaultSectionText[lSection];if(zNodeText){defaultSetParameter("NodeText",zNodeText);omDefaultSectionText[lSection]=zNodeText;}else defaultClearParameter("NodeText");}
function defaultFavourite(lNavigationIndex){var zpSection=defaultGetParameter("Section");var zpNodeID="";if(zpSection!=""){zpNodeID=defaultGetParameter("NodeID");var zpText=defaultGetParameter("NodeText");omDefaultSectionNode[zpSection]=zpNodeID;omDefaultSectionText[zpSection]=zpText;defaultChangeSection(parseInt(zpSection));if(parseInt(zpSection)==lmDefaultSection){defaultSetTitle(zpText);var lpEntityType=parseInt(zpNodeID.substr(0,zpNodeID.indexOf("_")));var lpID=parseInt(zpNodeID.slice(zpNodeID.indexOf("_")+1));if(parseInt(zpSection)!=1){if(lmDefaultSection==7)controlGetElement("iframeContent7").contentWindow.adminChangePage(lpEntityType,lpID,zpNodeID,lNavigationIndex);var opArray=zpNodeID.split("_");}else{oFrame=controlGetElement("iframeContent1");oFrame.contentWindow.catalogueNavigate("ucCatalogue",zpNodeID);if(lNavigationIndex)defaultNavigateSuccess(lNavigationIndex);}}else{defaultChangeSection(1);zpNodeID="";}}if(zpNodeID=="")document.getElementById("divHome").style.display="block";return zpNodeID;}
function defaultSetParameter(zParameter,zValue){var lpHashIndex;var lpIndex;var zpHREF=document.location.href;var zpStart;if(zpHREF.lastIndexOf("#")==(zpHREF.length-1))zpHREF=zpHREF.slice(0,zpHREF.length-1);lpIndex=zpHREF.indexOf("#"+zParameter+"=");if(lpIndex==-1){lpIndex=zpHREF.indexOf("&"+zParameter+"=");zpStart="&";}else zpStart="#";if(lpIndex==-1){var lpHashIndex=zpHREF.indexOf("#");if(lpHashIndex==-1)zpHREF+="#";else zpHREF+="&";zpHREF+=zParameter+"="+zValue;}else{var zpHREFStart=zpHREF.slice(0,lpIndex);var zpHREFEnd=zpHREF.slice(lpIndex+1,zpHREF.length);lpEndIndex=zpHREFEnd.indexOf("&");if(lpEndIndex==-1)zpHREFEnd="";else zpHREFEnd=zpHREFEnd.slice(lpEndIndex,zpHREFEnd.length);zpHREF=zpHREF.slice(0,lpIndex)+zpStart+zParameter+"="+zValue+zpHREFEnd;}document.location.href=zpHREF;}
function defaultGetParameter(zParameter){var zpLocation=document.location.href;var lpStartIndex;var lpEndIndex;var zpParameterValue="";lpStartIndex=zpLocation.lastIndexOf("#"+zParameter);if(lpStartIndex==-1)lpStartIndex=zpLocation.lastIndexOf("&"+zParameter);if(lpStartIndex!=-1){zpLocation=zpLocation.slice(lpStartIndex+zParameter.length+2,zpLocation.length);lpEndIndex=zpLocation.indexOf("&");if(lpEndIndex==-1)lpEndIndex=zpLocation.length;zpParameterValue=zpLocation.slice(0,lpEndIndex);}return zpParameterValue;}
function defaultClearParameter(zParameter){var lpHashIndex;var lpIndex;var zpHREF=document.location.href;var zpStart;lpIndex=zpHREF.indexOf("#"+zParameter+"=");if(lpIndex==-1){lpIndex=zpHREF.indexOf("&"+zParameter+"=");zpStart="&";}else zpStart="#";if(lpIndex!=-1){var zpHREFStart=zpHREF.slice(0,lpIndex);var zpHREFEnd=zpHREF.slice(lpIndex+1,zpHREF.length);lpEndIndex=zpHREFEnd.indexOf("&");if(lpEndIndex==-1)zpHREFEnd="";else zpHREFEnd=zpHREFEnd.slice(lpEndIndex,zpHREFEnd.length);if(zpStart=="#"&&zpHREFEnd!=""){zpHREFEnd="#"+zpHREFEnd.slice(1,zpHREFEnd.length);}zpHREF=zpHREF.slice(0,lpIndex)+zpHREFEnd;}if(zpHREF.indexOf("#")==-1)zpHREF+="#";document.location.href=zpHREF;}
function defaultGetIDFromString(NodeID,TypeID){var lpID=-1;var lpStart;var lpEnd;var lpTypeLength;if(NodeID.indexOf(","+String(TypeID)+"_")!=-1){lpTypeLength=(String(TypeID).length)+2;lpStart=NodeID.indexOf(","+TypeID+"_")+lpTypeLength;lpEnd=NodeID.indexOf(",",lpStart);lpID=NodeID.substring(lpStart,lpEnd);}else if(NodeID.indexOf(TypeID+"_")!=-1){lpTypeLength=(String(TypeID).length)+1;lpStart=NodeID.indexOf(TypeID+"_")+lpTypeLength;lpEnd=NodeID.indexOf(",",lpStart);lpID=NodeID.substring(lpStart,lpEnd);}return lpID;}
function defaultGetSectionText(lSection){var zpHomeText;switch(lSection){case 1:zpHomeText="Browse";break;case 2:zpHomeText="Search";break;case 3:zpHomeText="Submit Article";break;case 5:zpHomeText="Author's Guide";break;case 6:zpHomeText="Contact Info";break;case 7:zpHomeText="Administration";break;case 4:zpHomeText="Home";break;case 8:zpHomeText="Legal Info";break;case 9:zpHomeText="Comments";break;}return zpHomeText;}
function defaultSetTitle(zText){if(!zText)zText="";omDefaultSectionText[lmDefaultSection]=zText;controlGetElement("tdSectionTitle").innerText=zText;}
