//All global onload events $(document).ready( function() { initialiseHoverButtons(); formatListLinks(); initCollapseExpandNest(); initHideAndSeek(); //Function to add warning to external links addExternalLinkWarnings(); truncateNewsLinkAndRemoveQuicklinks(); } ); // IE6 hover flicker fix try { document.execCommand("BackgroundImageCache", false, true); } catch(err) {} function truncateNewsLinkAndRemoveQuicklinks() { var body = document.getElementsByTagName('body'); if (body[0].className=='homepage'){ var newsMenu = document.getElementById('NewsUL'); if (newsMenu) { var moreThanTwoLines = true; var twoLinesHeight = 55; var newsArray = new Array(); newsArray = newsMenu.getElementsByTagName('a'); var newsLinkText = newsArray[0].firstChild.data; var pdfText = ''; if (newsLinkText.lastIndexOf(' (PDF')!=-1) { pdfText=newsLinkText.substring(newsLinkText.lastIndexOf(' (PDF')); } var newsLinkTitle = newsLinkText; if (newsLinkTitle.indexOf(' (PDF')!=-1) { newsLinkTitle = newsLinkText.substring(0,newsLinkTitle.indexOf(' (PDF')); } var newsMenuHeight=newsMenu.offsetHeight; if (newsMenuHeight > twoLinesHeight) { while (moreThanTwoLines) { newsMenuHeight=newsMenu.offsetHeight; if (newsMenuHeight > twoLinesHeight) { newsLinkTitle = newsLinkTitle.substring(0,newsLinkTitle.length-1); newsArray[0].firstChild.data=newsLinkTitle; } else { moreThanTwoLines = false; var pdfTextSpace = 3; if (pdfText!='') { pdfTextSpace = 9; } newsLinkText = newsLinkTitle.substring(0,newsLinkTitle.length-pdfTextSpace)+'...'; if (pdfText!=''){ newsLinkText+=pdfText; } newsArray[0].firstChild.data=newsLinkText; moreThanTwoLines = true; while (moreThanTwoLines) { if (newsMenu.offsetHeight > twoLinesHeight){ pdfTextSpace++; newsLinkText = newsLinkTitle.substring(0,newsLinkTitle.length-pdfTextSpace)+'...'; if (pdfText!=''){ newsLinkText+=pdfText; } newsArray[0].firstChild.data=newsLinkText; } else { moreThanTwoLines = false; } } } } } var quicklinksList = document.getElementById('QuicklinksUL'); if (quicklinksList) { var quicklinksArray = new Array(); quicklinksArray = quicklinksList.getElementsByTagName('li'); while (quicklinksArray.length>8){ quicklinksList.removeChild(quicklinksList.lastChild); } } } } } function openPopupWindow(url, name, width, height, returnWindow) { var horizontalOffset, verticalOffset, offsetAmount, windowToReturn, closethiswindow; offsetAmount = 0; if(width == -1) { if ((screen.Height >= 0) && (screen.Width >= 0)) { width = screen.Width - 10; } else if ((screen.availHeight >= 0) && (screen.availWidth >= 0)) { width = screen.availWidth - 10; } } if(height == -1) { if ((screen.Height >= 0) && (screen.Width >= 0)) { height = screen.Height - 75; } else if ((screen.availHeight >= 0) && (screen.availWidth >= 0)) { height = screen.availHeight - 45; } } if(navigator.appName == "Microsoft Internet Explorer") { horizontalOffset = window.screenLeft + offsetAmount; verticalOffset = window.screenTop + offsetAmount; } else { horizontalOffset = window.screenX + offsetAmount; verticalOffset = window.screenY + offsetAmount; } if(horizontalOffset + width > screen.availWidth || verticalOffset + height > screen.availHeight) { horizontalOffset = 0; verticalOffset = 0; } windowToReturn = window.open(url, name, "toolbar=0,location=0,directories=0,status=yes,menubar=no,scrollbars=1,resizable=yes,screenX=" + horizontalOffset + ",screenY=" + verticalOffset + ",left=" + horizontalOffset + ",top=" + verticalOffset + ",width=" + width + ",height=" + height); //Please do not publish with the return window statement //if(returnWindow) //{ // return(windowToReturn); //} } function openPopupLocator(country,url) { //Passing the URL as argument is optional. However country is compulsory var height,width; if(!(country==null)&&!(country=="")) country=country.toUpperCase(); switch(country) { case 'AUS': width="900";height="700"; if ((url==null)||(url=="")) url='http://www.anz.com.au/australia/aboutanz/anzservices/anzlocator/'; break; case 'NZ': width="760";height="645"; if ((url==null)||(url=="")) url='http://www.anz.co.nz/tools/nzlocator/'; break; default: width="600";height="500"; } if (!(url==null)&&!(url=="")) openPopupWindow(url,'locator',width,height,false); } //Function to add external link warnings to links with a class of external links function addExternalLinkWarnings(){ var currentTag; var strLinkClass = "external-link"; var allTags = getElementsByClassName(strLinkClass, "a", document); for(i=0; i0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i (curitemlevel*1)){ newul = document.createElement("ul"); ulclass = strhidenav; //Update the class to display drop down image and append onclick event curitem.className = strExpandable + curitem.className; allATags = curitem.getElementsByTagName("a"); for (var r=0; r=0; n--){ curparent = allitems.item(n); curparentclass = curparent.className; curparentlevel = curparentclass.substring(curparentclass.indexOf(strnavclass) + strnavclass.length, curparentclass.length); if (((curparentlevel*1) + 1) == (curitemlevel*1)){ //get lower level ul curparentuls = curparent.getElementsByTagName("ul"); for (var w=0; w= 0) && (screen.Width >= 0)) { width = screen.Width - 10; } else if ((screen.availHeight >= 0) && (screen.availWidth >= 0)) { width = screen.availWidth - 10; } } if(height == -1){ if ((screen.Height >= 0) && (screen.Width >= 0)) { height = screen.Height - 75; } else if ((screen.availHeight >= 0) && (screen.availWidth >= 0)) { height = screen.availHeight - 45; } } if(navigator.appName == "Microsoft Internet Explorer"){ horizontalOffset = window.screenLeft + offsetAmount; verticalOffset = window.screenTop + offsetAmount; } else { horizontalOffset = window.screenX + offsetAmount; verticalOffset = window.screenY + offsetAmount; } if(horizontalOffset + width > screen.availWidth || verticalOffset + height > screen.availHeight) { horizontalOffset = 0; verticalOffset = 0; } newWin = window.open(s, "ANZWIN2", "toolbar=yes,status=yes,location=yes,menubar=yes,directories=yes,scrollbars=yes,resizable=yes,screenX=0,screenY=0,left=0,top=0,width=" + width + ",height=" + height); } function OpenWindowSecure(s) { var width = 750; var height = 500; s = "https://www.anz.com/" + s; newWin = window.open(s, "ANZIBLOGON", "toolbar=0,status=1,location=no,menubar=no,directories=no,scrollbars=yes,resizable=yes,screenX=0,screenY=0,left=0,top=0,width=" + width + ",height=" + height); } function OpenWindow(s) { if ((screen.Height >= 0) && (screen.Width >= 0)) { var height = screen.Height - 75; var width = screen.Width - 10; } else if ((screen.availHeight >= 0) && (screen.availWidth >= 0)) { var height = screen.availHeight - 45; var width = screen.availWidth - 10; } newWin = window.open(s, "ANZWIN2", "toolbar=0,status=1,location=no,menubar=no,directories=no,scrollbars=yes,resizable=yes,screenX=0,screen=0,left=0,top=0,width=" + width + ",height=" + height); } function OpenMoneyManager(s) { width = 940; height = 600; newWin = window.open(s, "ANZMM", "toolbar=yes,status=yes,location=yes,menubar=yes,directories=yes,scrollbars=yes,resizable=yes,screenX=0,screenY=0,left=0,top=0,width=" + width + ",height=" + height); } function OpenMoneyManagerDemo(s) { width = 950; height = 600; newWin = window.open(s, "ANZMM", "toolbar=no,status=1,location=no,menubar=no,directories=no,scrollbars=yes,resizable=yes,screenX=0,screenY=0,left=0,top=0,width=" + width + ",height=" + height); } function openPopupWindow(url, name, width, height, returnWindow) { var horizontalOffset, verticalOffset, offsetAmount, windowToReturn, closethiswindow; offsetAmount = 0; if(width == -1) { if ((screen.Height >= 0) && (screen.Width >= 0)) { width = screen.Width - 10; } else if ((screen.availHeight >= 0) && (screen.availWidth >= 0)) { width = screen.availWidth - 10; } } if(height == -1){ if ((screen.Height >= 0) && (screen.Width >= 0)) { height = screen.Height - 75; } else if ((screen.availHeight >= 0) && (screen.availWidth >= 0)) { height = screen.availHeight - 45; } } if(navigator.appName == "Microsoft Internet Explorer") { horizontalOffset = window.screenLeft + offsetAmount; verticalOffset = window.screenTop + offsetAmount; } else { horizontalOffset = window.screenX + offsetAmount; verticalOffset = window.screenY + offsetAmount; } if(horizontalOffset + width > screen.availWidth || verticalOffset + height > screen.availHeight) { horizontalOffset = 0; verticalOffset = 0; } windowToReturn = window.open(url, name, "toolbar=0,location=0,directories=0,status=yes,menubar=no,scrollbars=1,resizable=yes,screenX=" + horizontalOffset + ",screenY=" + verticalOffset + ",left=" + horizontalOffset + ",top=" + verticalOffset + ",width=" + width + ",height=" + height); //Please do not publish with the return window statement //if(returnWindow) //{ // return(windowToReturn); //} } function OpenFAQWindow(s) { newWin = window.open(s,"ANZFAQWin","toolbar=0,location=0,directories=0,status=yes,menubar=no,scrollbars=1,resizable=no,width=380,height=302"); } function populateSelectListWithBookmarks(containerId,containerType) { /* containerType = 'tableSummary' or 'divId' and refers to the html element you are searching within; containerID will either be div id, or table summary text. */ var actionstrip = document.getElementById('actionstrip'); actionstrip.className='actionstrip'; var selBookmarks = document.getElementById("selBookmarks"); if (containerType=='tableSummary') { container = document.getElementsByTagName('table'); for (x = 0; x Total_Tabs) tab = 'tab01'; if(url_verification == "none") { //fetch current URL Current_URL = location.href; // get the position of the string '#bmTab0' from the current URL stringposition = Current_URL.search('#tab_tab0'); //get the position of Tab value from the url Tabvalue_position = (stringposition-0)+9; //get Tab value Tabvalue = Current_URL.charAt(Tabvalue_position); if((isNaN(Tabvalue)) || Tabvalue == "" || Tabvalue > Total_Tabs) { tab = 'tab01'; } else{ tab = 'tab0'+Tabvalue; } url_verification = "done" } for (var i=0; iClick to expand or contract'; strHTMLClose='' allth = item.getElementsByTagName("th"); strTHText=allth[0].innerHTML; allth[0].innerHTML = strHTMLOpen + strTHText + strHTMLClose } function hideAndSeek(title) { var ctl = title.parentNode; if(ctl.parentNode.parentNode.parentNode.className == "hidecontent") { ctl.parentNode.parentNode.parentNode.className = "showcontent" title.childNodes[0].attributes["class"].value = "arrow-hide-and-seek-down" } else { ctl.parentNode.parentNode.parentNode.className = "hidecontent" title.childNodes[0].attributes["class"].value = "arrow-hide-and-seek-more" } } function RHNLogonImageMM_findObj(n, d) { var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p); } if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i0; w--){ curul = allChildItems.item(w-1); if (curul.nodeName){ curulnodename = curul.nodeName.toUpperCase(); if(curulnodename == "UL"){ newul = curul; //hide lower levels newul.className = "hide"; } else if (curulnodename == "#TEXT"){ if (curulnodename != ""){ linktext = curul.nodeValue; } } } liitem.removeChild(allChildItems.item(w-1)); } //create span for accessibility newspan = document.createElement("span"); newspantext = document.createTextNode("Click to expand or contract"); newspan.className = "hide"; newspan.appendChild(newspantext); //create new link liitem.className+="topLink"; newlink = document.createElement("a"); newtext = document.createTextNode(linktext); newlink.setAttribute("href", "javascript:toggleclasses(this)"); newlink.appendChild(newspan); newlink.title = "Click to expand or contract"; newlink.appendChild(newtext); newlink.className = "anznav_closewidget"; newlink.onclick = function() { toggleclasses(this); } //replace nodes liitem.appendChild(newlink); liitem.appendChild(newul); } function toggleclasses(item){ var topli, allChildItems, curul, strClassName; var backImage = new Array(); backImage[0] = "/base/Resources/resources/3/f/3f0ab3804d2fa1cd9ad9be766a918285/minus.gif"; backImage[1] = "/base/Resources/resources/0/2/028b87804d2fa1ce9addbe766a918285/plus.gif"; topli = item.parentNode; if (!topli){ return; } if (topli.nodeName.toUpperCase() == "LI"){ allChildItems = topli.childNodes; for (var w=0; w 768) x = 718; if (screen.availWidth > 1024) y = 1024; ChildWindow = window.open(url, name, "height=" + x + ",width=" + y + ",directories=no,scrollbars=yes,status=yes,resizable=yes,location=no,menubar=no,titlebar=no,toolbar=no,top=0,left=0"); if (browserName!="Microsoft Internet Explorer"){ ChildWindow.onunload = distroyChild; } ChildWindow.focus(); return true; } function distroyChild(){ ChildWindow = null; } /**Project Satellite login Area End**/ /**Format Links within a List **/ function formatListLinks() { var mainContent = document.getElementById('contentWrapper'); // Get the contentWrapper ID if(!mainContent){ // if there is no contentWrapper ID dont continue. return; } var listItem = mainContent.getElementsByTagName('li'); // Get all the
  • tags for(i=0; i < listItem.length; i++) { var thisListItem = listItem[i]; thisListItem.className='BulletNormal'; // Apply the nomal Bullet class so image is used } // to fix alignment issues //Now override the nomal Bullet if necessary with an arrow or pdf icon var links = mainContent.getElementsByTagName('a'); // Get all the tags within the contentWrapper ID for(i=0; i < links.length; i++) { // Loop thru all the tags to style accordingly var thisLink = links[i]; var linkHREF = thisLink.href.toLowerCase(); // Grab the HREF in the tag convert to lowercase var linkLocation = thisLink.getAttribute("href", 2); // Grab the HREF to check if bookmark if(thisLink.parentNode.tagName == "LI"){ // Check if the tag is part of a list var linkHTML = thisLink.parentNode.innerHTML.toLowerCase(); // grab the HTML and convert to lowercase if (linkHTML.indexOf(" tag is first in the HTML //Apply PDF class if (linkHREF.indexOf(".pdf") != -1){ thisLink.parentNode.className = 'PDFLink'; } else if (linkLocation.indexOf("#") == 0) { thisLink.parentNode.className = 'ArrowLinkDown'; //Find Bookmark links } else { //Apply Arrow class thisLink.parentNode.className = 'ArrowLink'; } } } } } /**End of Format Links within a List **/