/* SOME COMMON GOBAL VARIABLES FOR SCOPING OF THE FLYOUT MENU FAMILY : jsFlyout */ var g_ContextMenuOwner; var g_ContextMenuItem; var g_ContextMenuPreserveFunc; var a_TabMenu = new Array; var g_CurrentStatus = "off"; var g_LastMenu = ""; var g_IsTabMenuClick = 0; /* THIS FUNCTION DRAWS THE TAB FLYOUT MENU FAMILY : jsFlyout */ function showTabMenu(Owner, TabPosition) { g_IsTabMenuClick = 0; if(g_LastMenu!=Owner.id){ var oTab = document.getElementById(Owner.id.replace("tbAnchor","tb")); var iTabBoxOffset = 96; var iTabWidth = oTab.width; var iTabCountLvlA = 5; var iTabLvlAStart = iTabWidth/2; var iTabLvlBStart = 0; var iTabLvlAHeight = 30; var iTabLvlBHeight = 26; var iTabBoxWidth = document.getElementById("tbParent")?document.getElementById("tbParent").width:-1; var sMenuLinks = oTab.id.replace("tb","tbMenu"); //Only draw the submenu when: // a) the submenu division for the current tab exists // AND // b) the length of all the HTML in the submenu division is bigger than 0 if(document.getElementById(sMenuLinks)!=null&&document.getElementById(sMenuLinks).innerHTML.length>0&&iTabBoxWidth>=0){ var iTabPosX = (TabPosition>iTabCountLvlA?((TabPosition-iTabCountLvlA)*iTabWidth)-(iTabWidth-iTabLvlBStart):((TabPosition)*iTabWidth)-(iTabWidth-iTabLvlAStart)); g_LastMenu = Owner.id; document.getElementById("NFMenu").style.display = "block"; document.getElementById("NFMenuSpace").innerHTML = document.getElementById(sMenuLinks).innerHTML; document.getElementById("NFMenu").style.left = ((document.body.scrollWidth-document.getElementById("tbParent").width)/2)+iTabPosX-5; document.getElementById("NFMenu").style.top = iTabBoxOffset+Owner.offsetParent.offsetTop+iTabLvlAHeight+(TabPosition>iTabCountLvlA?iTabLvlBHeight:0); document.getElementById("NFMenu").style.width = document.getElementById(oTab.id).offsetWidth+10; if(this.ie4 || this.ie5 || this.ie6 || this.ie7){ document.getElementById("NFMenu").focus(); } } else //there is no links, so just go to hyperlink on the anchor { if(TabPosition==3){ location.href=Owner.href.replace("&cwShowJump=2","&cwShowJump=0"); } else { location.href=Owner.href; } } } else { document.getElementById("NFMenu").style.display = "none"; g_LastMenu = ""; } return false; } function hideFlyout(){ if(g_IsTabMenuClick==0){ document.getElementById("NFMenu")!=null?document.getElementById("NFMenu").style.display = "none":1; g_LastMenu = ""; } return true; } function ReadyClick(){ g_IsTabMenuClick = 1; } function UnreadyClick(){ g_IsTabMenuClick = 0; } /* THIS FUNCTION IS USED FOR GENERAL BROWSER CHECKING FAMILY : jsCommon */ /* THIS FUNCTION IS USED FOR GENERAL BROWSER CHECKING FAMILY : jsCommon */ function gdBrowserType() { this.name = navigator.appName; this.version = navigator.appVersion; //Version string this.dom=document.getElementById?1:0 //w3-dom this.op5=(this.name.indexOf("Opera") > -1 && (this.dom))?1:0 //Opera Browser this.ie4=(document.all && !this.dom)?1:0 //ie4 this.ie5=(this.dom && this.version.indexOf("MSIE 5") > -1)?1:0 //IE5 this.ie6=(this.dom && this.version.indexOf("MSIE 6") > -1)?1:0 //IE6 this.ie7=(this.dom && this.version.indexOf("MSIE 7") > -1)?1:0 //IE7 this.ns4=(document.layers && !this.dom)?1:0 //NS4 this.ns5=(this.dom && this.version.indexOf("MSIE ") == -1)?1:0 //NS6, Mozilla5 // if (this.ie4 || this.ie5) { if (this.ie4) { document.write(''); if (document.all['testOpera'].style.clip=='rect()') { this.ie4=0; this.ie5=0; this.op5=1; } } this.ok=(this.ie4 || this.ie5 || this.ie6 || this.ie7 || this.ns4 || this.ns5 || this.op5) //any DHTML eval ("bt=this"); } gdBrowserType(); function cNFProvinces(iBx) { var sI0 = "hmBulletPlus.gif"; var sI1 = "hmBulletMinus.gif"; var sC0 = "categoryBoxOff"; var sC1 = "categoryBoxOn"; var oBy = document.getElementById("listCatIcon"+iBx); var oBz = document.getElementById("listCat"+iBx); var oBx = document.getElementById("listCatContainer"+iBx); if(oBz.style.display=="none") { oBz.style.display="block"; oBy.src=oBy.src.replace(sI0, sI1); } else { oBz.style.display="none"; oBy.src=oBy.src.replace(sI1, sI0); } } function openStep() { var iStp=''*1; if(iStp>0&&iStp<8){ cCn(iStp); } else { cCn(0); } } var b_JumpMethodCurrent = "A"; function JumpMethodToggle(){ var o_JumpMethodA = document.getElementById("JumpMethodA"); var o_JumpMethodB = document.getElementById("JumpMethodB"); var o_JumpMethodToggleLink = document.getElementById("JumpMethodToggleLink"); if(b_JumpMethodCurrent=="A"){ //switch to B o_JumpMethodA?o_JumpMethodA.style.display="none":null; o_JumpMethodB?o_JumpMethodB.style.display="block":null; o_JumpMethodToggleLink?o_JumpMethodToggleLink.innerText="View by province":null; b_JumpMethodCurrent = "B"; } else //switch to A { o_JumpMethodB?o_JumpMethodB.style.display="none":null; o_JumpMethodA?o_JumpMethodA.style.display="block":null; o_JumpMethodToggleLink?o_JumpMethodToggleLink.innerText="View all":null; b_JumpMethodCurrent = "A"; } }