/* --- Org Chart Error Message --- */

function loadOrgChart(pageid){
    testForFlash(pageid);
}
function testForFlash(pageid) {
    //var errorMsg = document.getElementById('orgChartErrorMsg').innerHTML;
    if( flashEnabled == 1 ) {
        // Flash present, act normally
        setCookieflash('orgchart');
        orgchart(50,pageid);
    }
        else {getheight(50);    
    }
}

/* --- Tabbed Navigation --- */

    function loadTabList() {
        // Loads all divs inside #tabs-contacts-1 into an array, filtering out all RedDot menus
        
        var divs = document.getElementById('tabs-contacts-1').getElementsByTagName('div');
        var divs2 = new Array();
        var d2Inx = 0;
        
        for (var inx = 0; inx < divs.length; inx++) {
            if (divs[inx].className != 'rd_Body' && divs[inx].className != 'rd_Title') {
                divs2[d2Inx] = divs[inx];
                d2Inx++;
            }
        }
        return divs2;
    }
    function showActiveTab(tab) {
        //var tabs = document.getElementById('tabs-contacts-1').getElementsByTagName('li');
        var tabs = $("#tabs-contacts-1 .tabs-contacts-headings li"); 
        //var tabPanes = document.getElementById('tabs-contacts-1').getElementsByTagName('div');
        var tabPanes = loadTabList();
        if (tabs.length < tab) {
            tab = 0;
        }
        setCookie('tabbedNav', tab, 1);
        for (tInd = 0; tInd < tabs.length; tInd++) {
            if (tInd == tab) {
                tabs[tInd].setAttribute("class", "tabs-links-active");
                tabs[tInd].setAttribute("className", "tabs-links-active");
                tabPanes[tInd+1].style.display = "block";
            }
            else {
                tabs[tInd].setAttribute("class", "tabs-contact-title");
                tabs[tInd].setAttribute("className", "tabs-contact-title");
                tabPanes[tInd+1].style.display = "none";
            }
        }
    }

    // This function used to set tab cookie then jump to page with tabs in it so
    // can be assured which tab is visible.
    function loadPageWithActiveTab(tab, page){
        setCookie('tabbedNav', tab, 1);
        window.location = page;
    }

/* --- News Article List Pagination Controls --- */

    function buildPaginationMenus() {
        var articles = document.getElementById('newsList').getElementsByTagName('ul');
        var numPages = Math.ceil(articles.length/10);
        //var numPages = (articles.length/10)|0;
        //if (articles.length%10 > 0) {
            //numPages++;
        //}
        if (numPages > 1) {
            document.getElementById('topPaginationMenu').style.display = "block";
            document.getElementById('bottomPaginationMenu').style.display = "block";
        }
        else {
            document.getElementById('topPaginationMenu').style.display = "none";
            document.getElementById('bottomPaginationMenu').style.display = "none";
        }
        //Add previous menu button
        var prevMenuHTML = '<span id="prev"><a href="javascript:switchNewsPagePrev();">Prev</a></span>';
        //Build page links
        var pageMenus = '';
        for (var pX = 1; pX <= numPages; pX++) {
            pageMenus = pageMenus + '<span><a href="javascript:switchNewsPage(' + pX + ');"> ' + pX + '</a></span>';
        }
        //Add next menu button
        var nextMenuHTML = '<span id="next"><a href="javascript:switchNewsPageNext();">Next</a></span>';
        
        //Combine all menu items
        var menuHTML = prevMenuHTML + pageMenus + nextMenuHTML;
        var topMenu = document.getElementById("topPaginationMenu");
        var botMenu = document.getElementById("bottomPaginationMenu");
        topMenu.innerHTML = menuHTML;
        botMenu.innerHTML = menuHTML;
    }
    function switchNewsPage(num) {
        try {
        var topMenuSpans = document.getElementById('topPaginationMenu').getElementsByTagName('span');
        var botMenuSpans = document.getElementById('bottomPaginationMenu').getElementsByTagName('span');
        
        setCookie('newsList', num, 1);
        //Mark #prev and #next items as ""
        topMenuSpans[0].setAttribute("class", "");
        topMenuSpans[0].setAttribute("className", "");
        botMenuSpans[0].setAttribute("class", "");
        botMenuSpans[0].setAttribute("className", "");
        topMenuSpans[topMenuSpans.length-1].setAttribute("class", "");
        topMenuSpans[topMenuSpans.length-1].setAttribute("className", "");
        botMenuSpans[botMenuSpans.length-1].setAttribute("class", "");
        botMenuSpans[botMenuSpans.length-1].setAttribute("className", "");
        if (num == 1) {
            //Show #prev as disabled
            topMenuSpans[0].setAttribute("class", "innactive");
            topMenuSpans[0].setAttribute("className", "innactive");
            botMenuSpans[0].setAttribute("class", "innactive");
            botMenuSpans[0].setAttribute("className", "innactive");
        }
        
        if (num == topMenuSpans.length-2) {
            //Show #next as disabled
            topMenuSpans[topMenuSpans.length-1].setAttribute("class", "innactive");
            topMenuSpans[topMenuSpans.length-1].setAttribute("className", "innactive");
            botMenuSpans[botMenuSpans.length-1].setAttribute("class", "innactive");
            botMenuSpans[botMenuSpans.length-1].setAttribute("className", "innactive");
        }
        for (var sInd = 1; sInd < topMenuSpans.length-1; sInd++) {
            var newsPane = "page_"+sInd;
            if (sInd == num) {
                topMenuSpans[sInd].setAttribute("class", "active");
                topMenuSpans[sInd].setAttribute("className", "active");
                botMenuSpans[sInd].setAttribute("class", "active");
                botMenuSpans[sInd].setAttribute("className", "active");
                document.getElementById(newsPane).setAttribute("class", "nlActive");
                document.getElementById(newsPane).setAttribute("className", "nlActive");
            }
            else {
                topMenuSpans[sInd].setAttribute("class", "");
                topMenuSpans[sInd].setAttribute("className", "");
                botMenuSpans[sInd].setAttribute("class", "");
                botMenuSpans[sInd].setAttribute("className", "");
                document.getElementById(newsPane).setAttribute("class", "nlNormal");
                document.getElementById(newsPane).setAttribute("className", "nlNormal");
            }
        }
        } catch(e) {}
    }
    function switchNewsPagePrev() {
        if (parseInt(getCookie('newsList')) > 1) {
            switchNewsPage(parseInt(getCookie('newsList'))-1);
        }
    }
    function switchNewsPageNext() {
        var numPages = document.getElementById('topPaginationMenu').getElementsByTagName('span');
        if (parseInt(getCookie('newsList')) < numPages.length-2) {
            switchNewsPage(parseInt(getCookie('newsList'))+1);
        }
    }
    function handleNewsList() {
        try {
            var hasNewsList = document.getElementById("newsList");
            buildPaginationMenus();
        } catch(e) {}
    }

/* --- Control the display of RedDot Foundation Page menu via JavaScript --- */

    function markRDFMs(id) {
        var pageTypes = new Array('RDFM_TCHOME', 'RDFM_SITEMAP', 'RDFM_OTHER');
        for (var RDinx = 0; RDinx < pageTypes.length; RDinx++) {
            try {
                if (RDinx == id) {
                    document.getElementById(pageTypes[RDinx]).style.display = "block";
                }
                else {
                    document.getElementById(pageTypes[RDinx]).style.display = "none";
                }
            } catch(e) {}
        }
    }
    function controlRDFM() {
        // Control display of foundation page RedDot menu based on class of <body>
        
        if (document.body.className == "tc_home") {
            markRDFMs(0);
        }
        else if (document.body.className == "tc_sitemap") {
            markRDFMs(1);
        }
        else {
            markRDFMs(2);
        }
    }

/* --- Remove divider from last element in bookflap column on LP homepage and inside pages --- */
    
    function removeDivider() {
        var lastCallOut = -1;
        if (document.body.className == "lp_home") {
            try {
                var lpRightCol = document.getElementById('lpRightCol').getElementsByTagName('ul');
                for (var rc = 0; rc < lpRightCol.length; rc++) {
                    if (lpRightCol[rc].className == "callOut") {
                        lastCallOut = rc;
                    }
                }
                if (lastCallOut >= 0) {
                    lpRightCol[lastCallOut].style.borderBottom = "none";
                }
            } catch(e) {}
        }
        else {
            try {
                var bookflap = document.getElementById('rightContentSection').getElementsByTagName('ul');
                for (var bf = 0; bf < bookflap.length; bf++) {
                    if (bookflap[bf].className == "callOut") {
                        lastCallOut = bf;
                    }
                }
                if (lastCallOut >= 0) {
                    bookflap[lastCallOut].style.borderBottom = "none";
                }
            } catch(e) {}
        }
    }

/* --- Emergency Responce System --- */
    
    function getERSSettings() {
        var settings = document.getElementById('ERSSettings').getElementsByTagName('span');
        return settings;
    }
    
    function cloudPage(val) {
      if (val == 0){
        document.getElementById('overlay').style.display = "none";
      } else {
        var x,y;
        try {
            if( window.innerHeight && window.scrollMaxY ) { // Firefox
                pageWidth = window.innerWidth + window.scrollMaxX;
                pageHeight = window.innerHeight + window.scrollMaxY;
            }
            else if( document.body.scrollHeight > document.body.offsetHeight ) { // all but Explorer Mac
                pageWidth = document.body.scrollWidth;
                pageHeight = document.body.scrollHeight;
            }
            else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari
                pageWidth = document.body.offsetWidth + document.body.offsetLeft;
                pageHeight = document.body.offsetHeight + document.body.offsetTop;
            }
            document.getElementById('overlay').style.height = pageHeight+"px";
        } catch(e) {}
        
        document.getElementById('overlay').style.display = "block";
        document.getElementById('overlay').style.opacity = val/100;
        document.getElementById('overlay').style.filter = 'alpha(opacity=' +val+ ')';
        document.getElementById('overlay').style.MozOpacity = val/100;
        // Disable dropdown menus
        var forms = document.getElementById('navigation').getElementsByTagName('select');
        for (var fInd = 0; fInd < forms.length; fInd++) {
            forms[fInd].disabled = true;
        }
      }
    }


    
    function leaveERS() {
        document.getElementById('ERSWrapper').style.display = "none";
        document.getElementById('flyout').style.display = "block";
        document.getElementById('flyoutFooter').style.display = "block";
        document.getElementById('overlay').style.display = "none";
        // Enable dropdown menus
        var forms = document.getElementById('navigation').getElementsByTagName('select');
        for (var fInd = 0; fInd < forms.length; fInd++) {
            forms[fInd].disabled = false;
        }
    }
    function toggleERSinSmartEdit() {
        if (cookieSet('showERSinSmartEdit') == true) {
            // value for cookie is set
            var showOrHide = getCookie('showERSinSmartEdit');
            if (showOrHide == 'hide') {
                document.getElementById('ERSWrapper').style.display = "block";
                document.getElementById('flyout').style.display = "none";
                document.getElementById('flyoutFooter').style.display = "none";
                setCookie('showERSinSmartEdit', 'show', 1);
            }
            else {
                document.getElementById('ERSWrapper').style.display = "none";
                document.getElementById('flyout').style.display = "block";
                document.getElementById('flyoutFooter').style.display = "block";
                setCookie('showERSinSmartEdit', 'hide', 1);
            }
        }
        else {
            document.getElementById('ERSWrapper').style.display = "block";
            document.getElementById('flyout').style.display = "none";
            document.getElementById('flyoutFooter').style.display = "none";
            setCookie('showERSinSmartEdit', 'show', 1);
        }
    }

/* --- Printer Friendly Page --- */
    
    function getRequestVar(istr) {
        var xstr = window.location.href;
        var xloc = xstr.indexOf('?'), yloc = 0;
        istr += '=';
        if(xloc == -1) return;
        else {
            xloc = xstr.indexOf(istr, xloc) + istr.length;
            yloc = xstr.indexOf('&', xloc)!= -1? xstr.indexOf('&', xloc) : xstr.indexOf('#', xloc);
            if(yloc == -1) xstr = xstr.substring(xloc);
            else xstr = xstr.substring(xloc, yloc);
        }
        return xstr;
    }
    function pauseJS(sec) {
        var date = new Date();
        var curDate = null;
        do {
            curDate = new Date();
        }
        while (curDate-date < sec);
    }
    
    function markPrintTime() {
        // Places the current date/time into printed page's footer
        
        var setTime = new Date();
        
        var Hrs = setTime.getHours();
        var Min = setTime.getMinutes();
        var Day = setTime.getDate();
        var Mon = setTime.getMonth()+1;
        var Yr = setTime.getYear();
        var TZ = ""+setTime;
        var timeString = ""+Yr+"/"+Mon+"/"+Day+" "+Hrs+":"+Min+"h "+TZ.substring(TZ.length-8, TZ.length-5);
        document.getElementById('printTime').innerHTML = timeString;
    }
    
    function openPrintDialogue() {
        window.print();
    }
    var newwindow;
    function popNewWindow(url) {
        newwindow = window.open(url, 'newwindow');
    }
    function displayPrintWindow(url) {        
        var tmpURL = ""+url;  
        if (tmpURL.indexOf("?") == -1) {
            var printURL = url+"?print=yes";
        }
        else {
            var printURL = url+"&print=yes";
        }
        popNewWindow(printURL);
        
        //markPrintTime();
        /*var OLECMDID = 7;
        var PROMPT = 1;
        var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></ODJECT>';
        document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
        WebBrowser1.ExecWB(OLECMDID, PROMPT);
        WebBrowser1.outerHTML="";*/
    }

/* --- Table Highlighting --- */
    
    function wipeTableStyles() {
        // Wipe table of inline settings
        var tablezz = document.getElementById('middleContentSection').getElementsByTagName('table');
        for (var ixx = 0; ixx < tablezz.length; ixx++) {
            tablezz[ixx].border = "0";
            tablezz[ixx].cellPadding = "0";
            tablezz[ixx].cellSpacing = "0";
        }
        
        // Traverse all table rows on page
        var trss = document.getElementById('middleContentSection').getElementsByTagName('tr');
        for (var ixr = 0; ixr < trss.length; ixr++) {
            
            trss[ixr].bgColor = "";
            trss[ixr].style.fontFamily = "";
            trss[ixr].style.fontWeight = "";
            
            var tds = trss[ixr].getElementsByTagName('td');
            for (var ix = 0; ix < tds.length; ix++) {
                tds[ix].bgColor = "";
                tds[ix].style.fontFamily = "";
                tds[ix].style.fontWeight = "";
                if (trss[ixr].parentNode.nodeName != "THEAD") {
                    tds[ix].style.border = "none";
                }
            
                // For tables pasted from MSWord, clear inline styles
                var inlinePs = tds[ix].getElementsByTagName('p');
                if (inlinePs.length > 0) {
                    if (ix == 0) {
                        inlinePs[0].style.textAlign = "left";
                    }
                    inlinePs[0].style.padding = "0";
                    inlinePs[0].style.margin = "0";
                }
                var inlineSpans = tds[ix].getElementsByTagName('span');
                if (inlineSpans.length > 0) {
                    inlineSpans[0].style.fontSize = "12px";
                }
                
                var cH3s = tds[ix].getElementsByTagName('h3');
                var ulTDs4IE6 = 0;
                if (cH3s.length > 0) {
                    trss[ixr].setAttribute("class", "tline");
                    trss[ixr].setAttribute("className", "tline");
                    ulTDs4IE6 = 1;
                }
                
                if (ulTDs4IE6 > 0) {
                    // IE6 forces underline to be used on TDs instead of TR, set border-bottom of each TD in row to visible
                    for (var ulTD = 0; ulTD < tds.length; ulTD++) {
                        tds[ulTD].style.borderBottom = "1px solid #D9E4E8";
                    }
                }
                
                var cH4s = tds[ix].getElementsByTagName('h4');
                if (cH4s.length > 0) {
                    trss[ixr].setAttribute("class", "headline");
                    trss[ixr].setAttribute("className", "headline");
                }
                
            }
            
        }
        
    }
    
    function cleanTableRows(id) {
        // Traverses all <tr> and <td> tags in table, setting class to null
        try {
            var trs = id.getElementsByTagName('tr');
            for (var ind = 0; ind < trs.length; ind++) {
                if ((trs[ind].className != "headline") && (trs[ind].className != "tline")) {
                    trs[ind].setAttribute("class", "");
                    trs[ind].setAttribute("className", "");
                }
                trs[ind].style.padding = "0";
                trs[ind].style.margin = "0";
            }
        } catch(e) {}
    }
    
    function drillUp(id) {
        if (id.parentNode.nodeName == "TABLE") {
            if (id.parentNode.parentNode.nodeName == "TD") {
                return true;
            }
            else {
                return false;
            }
        }
        else {
            return drillUp(id.parentNode);
        }
    }
    
    function isTRTableEmbedded(id) {
        // Takes a <tr> object, traverses up the node structure until it finds first <table> node, then checks that node's parent
        
        return drillUp(id);
    }
    function drillUpToSpan(id) {
        if (id.parentNode.nodeName == "SPAN") {
            if (id.parentNode.className == "renderTablePlain") {
                return true;
            }
            else {
                return false;
            }
        }
        else {
            if (id.parentNode.nodeName != "BODY") {
                return drillUpToSpan(id.parentNode);
            }
        }
    }
    function isTableMarkedAsPlain(id) {
        // Takes a <table> object, traverses up the node structure until it finds first <span> node, then checks that node's class
        return drillUpToSpan(id);
    }
    
    function stripeTableRows(id) {
        // Mark every second <tr> with a gray background (apply class="gray")
        // do not mark <tr>s in thead or tfoot
        
        var trs = id.getElementsByTagName('tr');
        var cnt = 0;
        
        for (var ind = 0; ind < trs.length; ind++) {
            // Set class of <tr> to either "gray" or ""
            if ((trs[ind].parentNode.nodeName != "THEAD") && (trs[ind].parentNode.nodeName != "TFOOT") && (isTRTableEmbedded(trs[ind]) == false)) {
                if ((trs[ind].className != "headline") && (trs[ind].className != "tline")) {
                    if (cnt%2 != 0) {
                        trs[ind].setAttribute("class", "gray");
                        trs[ind].setAttribute("className", "gray");
                    }
                    cnt++;
                }
            }
            
            if (isTRTableEmbedded(trs[ind]) == false) {
                // Set first <td> of each <tr> to class="first"
                //trs[ind].getElementsByTagName('td')[0].setAttribute("class", "first");
                //trs[ind].getElementsByTagName('td')[0].setAttribute("className", "first");
                var theTD = trs[ind].getElementsByTagName('td');
                if (theTD.length > 0) {
                    theTD[0].setAttribute("class", "first");
                    theTD[0].setAttribute("className", "first");
                }
            }
        }
    }
    function scrubTables() {
        // Performs actions on all tables on the page
        if ((document.body.className != "tc_home") && (document.body.className != "ce_home") && (document.body.className != "lp_home")) {
            wipeTableStyles();
            
            var tblz = document.getElementById('middleContentSection').getElementsByTagName('table');
            
            for (var inx = 0; inx < tblz.length; inx++) {
                if ((tblz[inx].parentNode.nodeName != "TD")& !(isTableMarkedAsPlain(tblz[inx]))) {
                    // Table is not embedded in another table
                
                    cleanTableRows(tblz[inx]);
                    if ((tblz[inx].className != "plain") & (tblz[inx].className != "renderTablePlain")) {
                        stripeTableRows(tblz[inx]);
                    }
                }
                else {
                    var bdz = tblz[inx].getElementsByTagName('tbody');
                    for (var ibd = 0; ibd < bdz.length; ibd++) {
                        bdz[ibd].style.border = "none";
                    }
                }
            }
        }
    }

    /* --- Left Navigation Accordion --- */
    
    function leftNavTwiddle(idx) {
        try {
        var menus = document.getElementById('navigation').getElementsByTagName('ul');
        var spans = document.getElementById('navigation').getElementsByTagName('span');
        for (var ix = 0; ix < spans.length; ix++) {
            if (spans[ix].id == idx) {
                if (spans[ix].className == "") {
                    menus[ix+1].style.display = 'block';
                    spans[ix].setAttribute("class", "active");
                    spans[ix].setAttribute("className", "active");
                }
                else {
                    menus[ix+1].style.display = 'none';
                    spans[ix].setAttribute("class", "");
                    spans[ix].setAttribute("className", "");
                }
            }
            else {
                var idTag = spans[ix].id;
                if (idTag.substring(0, 4) != "hdl_") {
                    menus[ix+1].style.display = 'none';
                    spans[ix].setAttribute("class", "");
                    spans[ix].setAttribute("className", "");
                }
            }
        }
        } catch(e) {}
    }

    /* --- Drop Down Page Change --- */
    function doSel(obj) {
        nextPage = obj.options[obj.selectedIndex].value;
        if (nextPage!= "") {
            document.location.href = nextPage;
        }
    }

/* --- Format Top Nav --- */
    
    function formatTopNav() {
        try {
            var corp = document.getElementById('corporate').getElementsByTagName('li')[0];
            corp.setAttribute("class", "first");
            corp.setAttribute("className", "first");
        } catch(e) {}
        try {
            var medi = document.getElementById('media').getElementsByTagName('li')[0];
            medi.setAttribute("class", "first");
            medi.setAttribute("className", "first");
        } catch(e) {}
    }

/* --- Format Homepage Navigation Links --- */
    
    function formatHomeSNLinks() {
        // Apply styles to navigation list on homepage
        
        if (document.body.className == "tc_home") {
            var sns = document.getElementById('sectionSN').getElementsByTagName('li')[0];
            sns.setAttribute("class", "first");
            sns.setAttribute("className", "first");
        }
    }

// --- Flyouts --- //
    function setCookie(cName, cValue, cExpireDays) {
        var exDate = new Date();
        exDate.setDate(exDate.getDate()+cExpireDays);
        document.cookie=cName+"="+escape(cValue)+((cExpireDays==null) ? "" : ";expires="+exDate.toGMTString());
    }
    function getCookie(cName) {
        if (document.cookie.length > 0) {
            c_start = document.cookie.indexOf(cName + "=");
            if (c_start != -1) {
                c_start = c_start + cName.length+1; 
                c_end = document.cookie.indexOf(";", c_start);
                if (c_end == -1) c_end = document.cookie.length;
                return unescape(document.cookie.substring(c_start, c_end));
            }
        }
        return "";
    }
    function cookieSet(cName) {
        var tmp = getCookie(cName);
        if (tmp != null && tmp != "") {
            return true;
        }
        else {
            return false;
        }
    }
    function loadFlyoutList() {
        // Loads all divs inside #flyout into an array
        
        var divs = document.getElementById('flyout').getElementsByTagName('div');
        var divs2 = new Array();
        var d2Inx = 0;
        
        for (var inx = 0; inx < divs.length; inx++) {
            if (divs[inx].className != 'rd_Body' && divs[inx].className != 'rd_Title') {
                divs2[d2Inx] = divs[inx];
                d2Inx++;
            }
        }
        return divs2;
    }
    
    function switchID(id) {
        // Hide all flyouts on the page except for id
        
        try {
            var flyOuts = loadFlyoutList();
            hideAllIDs(flyOuts);
            flyOuts[id].style.display = 'block';
            setCookie('flyout', id, 1);
        } catch(e) {}
    }
        
    function hideAllIDs(items) {
        // loop through the array and hide each element by id
        
        for (var i=0; i<items.length; i++) {
            items[i].style.display = 'none';
        }
    }

// --- Key Project Code --- //

    function loadKeyProjectList(){
        var divs = document.getElementById('keyproject').getElementsByTagName('div');
        var divs2 = new Array();
        var d2Inx = 0;
        for (var inx = 0; inx < divs.length; inx++) {
            if (divs[inx].className == 'key2col') {
                divs2[d2Inx] = divs[inx];
                d2Inx++;
            }
        }
        return divs2;
    }
    function getfirstpage() {
        var pages= new Array('Status and Timelines','Maps','Regulatory Requirements','Public Involvement','Environment and Safety','Commercial Information','Contracts/Vendor Registration','Background','Careers','News Releases','Contacts');
        var ancs = document.getElementById('ancz').getElementsByTagName('a');
        for (var inc = 0; inc < pages.length; inc++) {
            if(ancs[0].innerHTML == pages[inc]){
                var firstpage = inc;
            }  
        }
        return firstpage;
    }
    function switchIDkey(id) {
        // Hide all Divs on the page except for id
        var keyProjects = loadKeyProjectList();
        var keytemp = 0;
        hideAllDIVs(keyProjects);
        for (i = 0; i < keyProjects.length; i++){
            len = keyProjects[i].id.length;
            if (keyProjects[i].id.substring(len - 2,len) == id){
                keyProjects[i].style.display = 'block';
                keytemp = keyProjects[i].id;
                setCookie('keycookie', keytemp, 1);
            }
        }
       // setCookie('keycookie', keytemp, 1);
    }
    function switchIDshow(url) {
        // show all Divs on the page
        var keyProjects = loadKeyProjectList();
        showAllDIVs(keyProjects);
        //displayPrintWindow()
        
    }

    function hideAllDIVs(stuff) {
        // loop through the array and hide each element by id
        for (var i=0; i<stuff.length; i++) {
            stuff[i].style.display = 'none';
        }
    }
    function showAllDIVs(stuff) {
        // loop through the array and hide each element by id
        for (var i=0; i<stuff.length; i++) {
            stuff[i].style.display = 'block';
        }
    }

// --- popup --- //

    function addresscheck(){
        var newhref = null;
        var linklist = document.getElementsByTagName('a');
        var address = new Array("transcanada.com","#","javascript");
        var checker;
        var finalnum;
        var dist = address.length;
        for (i = 0;i<linklist.length;i++){
            finalnum = 0;
            for (a = 0;a<dist;a++){
                checker = linklist[i].href.indexOf(address[a]);
                if (checker == -1)
                    finalnum++;
            }
            if (finalnum >= dist)
                linklist[i].onclick = function(){leave(this); return false};
        
        }
    }
    function leave(obj) {
        var newhref = obj.href;
        var answer = confirm("You are being redirected to a (web)site outside TransCanada.com");
        if (answer)
            window.open(newhref);
    }

// --- MAP LAYOVER --- //

    function mapon(){
        overlaydiv = document.getElementById('map_overlay');
        mapperdiv = document.getElementById('mapper');
        overlaydiv.style.display = 'block';
        mapperdiv.style.display = 'block';
    }
    function closeMap(){
        overlaydiv = document.getElementById('map_overlay');
        mapperdiv = document.getElementById('mapper');
        flashErr = document.getElementById('globalFlashErrorMsg');
        overlaydiv.style.display = 'none';
        mapperdiv.style.display = 'none';
        flashErr.style.display = 'none';
        document.getElementById('map_overlay').style.height = "0px";
        document.getElementById('mapper').style.height = "0px";
        // Show #navigation, hidden to keep dropdowns from floating over overlays
        try {
            document.getElementById('navigation').style.display = "block";
        } catch(e) {}
    }
    function closeOrg(){
        overlaydiv = document.getElementById('org_overlay');
        overlaydiv.style.display = 'none';
        overlaydiv.style.height = "0px";

            try {
                mapperdiv = document.getElementById('orgchart');
                mapperdiv.style.display = 'none';
                mapperdiv.style.height = "0px";
            }catch(e) {}
       
            try {
                document.getElementById('orgChartErrorMsg').style.display = "none";
                document.getElementById('orgChartErrorMsg').style.height = "0px";
            }catch(e) {}
 
        try {
            document.getElementById('globalFlashErrorMsg').style.display = "none";
        } catch(e) {}

        // Show #navigation, hidden to keep dropdowns from floating over overlays
       try {
            document.getElementById('navigation').style.display = "block";
        } catch(e) {}
        delete_cookieflash('orgchart');
        elementon();
overlaydiv = "";
mapperdiv = "";
    }
    function addressbreak(){
        flashconfigtemp = document.getElementById('flasherconfig').href;
        brokenup = flashconfigtemp.split("/");
        for (i = 0;i <= brokenup.length;i++){
            alert(brokenup[i]);
        }
    }
    function loadFlashMap(){
        getheight(50);    
    }
    function getheight(val) {
        
        var x,y;
        var flashStatus = document.getElementById('vbFlash').innerHTML;
        if( flashStatus == "Flash Disabled" ) {
            // Flash not present, show alert
            var x,y;
            try {
                if( window.innerHeight && window.scrollMaxY ) { // Firefox
                    pageWidth = window.innerWidth + window.scrollMaxX;
                    pageHeight = window.innerHeight + window.scrollMaxY;
                }
                else if( document.body.scrollHeight > document.body.offsetHeight ) { // all but Explorer Mac
                    pageWidth = document.body.scrollWidth;
                    pageHeight = document.body.scrollHeight;
                }
                else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari
                    pageWidth = document.body.offsetWidth + document.body.offsetLeft;
                    pageHeight = document.body.offsetHeight + document.body.offsetTop;
                }
                //var yy = document.body.offsetHeight;
                document.getElementById('map_overlay').style.height = pageHeight+"px";
                document.getElementById('mapper').style.height = "490px"
            } catch(e) {}

            document.getElementById('map_overlay').style.display = "block";
            document.getElementById('map_overlay').style.opacity = val/100;
            document.getElementById('map_overlay').style.filter = 'alpha(opacity=' +val+ ')';
            document.getElementById('map_overlay').style.MozOpacity = val/100;
            // Hide #navigation to kep dropdowns from floating over overlays
            try {
                document.getElementById('navigation').style.display = "none";
            } catch(e) {}
            document.getElementById('globalFlashErrorMsg').style.display = "block";
        }
        else {
            // Flash present, act normally
            try {
                /*if (self.innerHeight) { // all except Explorer
                    x = self.innerWidth;
                    y = self.innerHeight;
                }
                else if (document.documentElement && document.documentElement.clientHeight)
                    // Explorer 6 Strict Mode
                {
                    x = document.documentElement.clientWidth;
                    y = document.documentElement.clientHeight;
                }
                else if (document.body) // other Explorers
                {
                    x = document.body.clientWidth;
                    y = document.body.clientHeight;
                }*/

                if( window.innerHeight && window.scrollMaxY ) { // Firefox
                    pageWidth = window.innerWidth + window.scrollMaxX;
                    pageHeight = window.innerHeight + window.scrollMaxY;
                }
                else if( document.body.scrollHeight > document.body.offsetHeight ) { // all but Explorer Mac
                    pageWidth = document.body.scrollWidth;
                    pageHeight = document.body.scrollHeight;
                }
                else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari
                    pageWidth = document.body.offsetWidth + document.body.offsetLeft;
                    pageHeight = document.body.offsetHeight + document.body.offsetTop;
                }
                //var yy = document.body.offsetHeight;
                document.getElementById('map_overlay').style.height = pageHeight+"px";
                document.getElementById('mapper').style.height = "490px"
            } catch(e) {}
        
            document.getElementById('map_overlay').style.display = "block";
            document.getElementById('map_overlay').style.opacity = val/100;
            document.getElementById('map_overlay').style.filter = 'alpha(opacity=' +val+ ')';
            document.getElementById('map_overlay').style.MozOpacity = val/100;
            document.getElementById('mapper').style.display = "block"; 
        }
    }

function TC_validform() {
var holder = document.createElement('div');
holder.id = "holder1";
error.innerHTML = "";
document.getElementById('error').appendChild(holder); 
 if (formLogoPhoto.agree.checked){
  if (document.getElementById){
    var i,p,q,nm,test,num,min,max,errors='',args=TC_validform.arguments;
    for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
      if (val) { nm=val.name; if ((val=val.value)!="") {
        if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
          if (p<1 || p==(val.length-1)) holder.innerHTML += nm+" must contain an e-mail address.<br />";
        } else if (test!='R') { num = parseFloat(val);
          if (isNaN(val)) holder.innerHTML += nm+' must contain a number.\n';
          if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
            min=test.substring(8,p); max=test.substring(p+1);
            if (num<min || max<num) holder.innerHTML += nm+' must contain a number between '+min+' and '+max+'.\n';
                 if (form1.checker.checked) holder.innerHTML +=' please click on the agree button';
      } } } else if (test.charAt(0) == 'R') holder.innerHTML += nm +" is required<br />";
      }
    } if (holder.innerHTML) document.getElementById('holder1').appendChild(holder); document.TC_returnValue = (holder.innerHTML == '');
} 
}else{
     
     holder.innerHTML += "please adhere to the User Agreement <br />";
     if (holder.innerHTML) document.getElementById('holder1').appendChild(holder); document.TC_returnValue = (holder.innerHTML == '');
     }
 }    
function TC_validprintform() { 
var holder = document.createElement('div');
holder.id = "holder1";
error.innerHTML = "";
document.getElementById('error').appendChild(holder); 
  if (document.getElementById){
    var i,p,q,nm,test,num,min,max,errors='',args=TC_validprintform.arguments;
    for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
      if (val) { nm=val.name; if ((val=val.value)!="") {
        if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
          if (p<1 || p==(val.length-1)) holder.innerHTML += nm+" must contain an e-mail address.<br />";
        } else if (test!='R') { num = parseFloat(val);
          if (isNaN(val)) holder.innerHTML += nm+' must contain a number.\n';
          if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
            min=test.substring(8,p); max=test.substring(p+1);
            if (num<min || max<num) holder.innerHTML += nm+' must contain a number between '+min+' and '+max+'.\n';
      } } } else if (test.charAt(0) == 'R') holder.innerHTML += nm +" is required<br />";
      }
    } if (holder.innerHTML) document.getElementById('holder1').appendChild(holder); document.TC_returnValue = (holder.innerHTML == '');
} 
}
  function openclose(thediv, theblock){
      if(document.getElementById(thediv).style.visibility == "hidden" ) {
            document.getElementById(thediv).style.visibility = "visible";
            document.getElementById(thediv).style.height = "auto";
            document.getElementById(theblock).className = 'faq_blockon';
      } else {
      document.getElementById(thediv).style.visibility = "hidden";
      document.getElementById(thediv).style.height = '0px';
      document.getElementById(theblock).className = 'faq_blockoff';
      }
  }
function closefaqdivz(){
    var m = document.getElementsByTagName("div");
        for(var i=0;i<m.length;i++){
                if (m[i].className == 'faq_blockon'){
                m[i].className = 'faq_blockoff';
                }
                
                if (m[i].className == 'answer'){
                m[i].style.height = '0px';
                m[i].style.visibility = "hidden";
                }
        }
}

// --- Tabs --- //

    function switchTab(tabID) {
        var activeTab = tabID;
        setCookie('tab', id, 1);
    }

/* --- Font Adjust --- */
    
    function displayPageAtSize(siz) {
        // Applies sizing to elements in specified areas
        
        if (document.body.className != "ce_home") {
            var sections = new Array('middleContentSection', 'rightContentSection');
        }
        else {
            var sections = new Array('flyout');
        }
        
        var tags = new Array('p', 'a', 'li', 'td', 'span', 'h1', 'h2', 'h3', 'h4', 'font');
        var sizes = new Array(12, 12, 12, 12, 11, 16, 14, 12, 12, 12);
        
        for (inx0 = 0; inx0 < sections.length; inx0++) {
            for (inx1 = 0; inx1 < tags.length; inx1++) {
                try {
                    var nodez = document.getElementById(sections[inx0]).getElementsByTagName(tags[inx1]);
            
                    for (inx2 = 0; inx2 < nodez.length; inx2++) {
                        if (inx1 == 0 && nodez[inx2].className == 'strap') {
                            nodez[inx2].style.fontSize = (14+siz)+"px";
                        }
                        else if ((document.body.className == "lp_home") && (nodez[inx2].className == "intro")) {
                            //nodez[inx2].style.fontSize = (15+siz)+"px";
                        }
                        else {
                            nodez[inx2].style.fontSize = (sizes[inx1]+siz)+"px";
                        }
                    }
                } catch(e) {}
            }
        }
    }
    
    function markFontSizeLink(siz) {
        // Set active font sizing link in footer
        
        try {
            var links = document.getElementById('homeFooterSizeAdj').getElementsByTagName('a');
            for (var inx = 0; inx < links.length; inx++) {
                if (inx == siz) {
                    links[inx].setAttribute("class", "active");
                    links[inx].setAttribute("className", "active");
                }
                else {
                    links[inx].setAttribute("class", "");
                    links[inx].setAttribute("className", "");
                }
            }
        } catch(e) {}
    }
    
    function adjustFontSize(siz) {
        // Controls font sizing procedure
        setCookie('fontSize', siz, 1);
        
        var diff = 0;
        
        if (siz == 0) { 
            diff = -2;
        }
        else if (siz == 2) {
            diff = 2;
        }
        
        displayPageAtSize(diff);
        
        markFontSizeLink(siz);
    }
    
    
// --- Dropdown Menus --- //
    
    function initMenus() {
        var allLinks = document.getElementsByTagName("a");
        
        for(var i=0; i<allLinks.length; i++) {
            if (allLinks[i].className.indexOf("menuLink") > -1) {
                allLinks[i].onclick = function() {
                    return false;
                }
                allLinks[i].onmouseover = toggleMenu;
            }
        }
    }
    
    function toggleMenu() {
        var startMenu = this.href.lastIndexOf("/")+1;
        var stopMenu = this.href.lastIndexOf(".");
        var thisMenuName = this.href.substring(startMenu, stopMenu);
        
        document.getElementById(thisMenuName).style.display = "block";
        
        this.parentNode.className = thisMenuName;
        this.parentNode.onmouseout = toggleDivOff;
        this.parentNode.onmouseover = toggleDivOn;
    }
    
    function toggleDivOn() {
        document.getElementById(this.className).style.display = "block";
    }
    
    function toggleDivOff() {
        document.getElementById(this.className).style.display = "none";
    }
    
    
    sfHover = function() {
        var corULs = document.getElementById("corporate").getElementsByTagName("UL");
        for (var c1 = 0; c1 < corULs.length; c1++) {
            var tmp = corULs[c1].getElementsByTagName("LI");
            if (tmp.length == 0) {
                corULs[c1].style.display = "none";
            }
        }
        var medULs = document.getElementById("media").getElementsByTagName("UL");
        for (var m1 = 0; m1 < medULs.length; m1++) {
            var tmp = medULs[m1].getElementsByTagName("LI");
            if (tmp.length == 0) {
                medULs[m1].style.display = "none";
            }
        }
        var sfEls = document.getElementById("corporate").getElementsByTagName("LI");
        for (var i=0; i<sfEls.length; i++) {
            sfEls[i].onmouseover=function() {
                this.className+=" sfhover";
            }
            sfEls[i].onmouseout=function() {
                this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
            }
        }
        
        var sfEls2 = document.getElementById("media").getElementsByTagName("LI");
        for (var i=0; i<sfEls2.length; i++) {
            sfEls2[i].onmouseover=function() {
                this.className+=" sfhover";
                this.style.zIndex=8200;
            }
            sfEls2[i].onmouseout=function() {
                this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
            }
        }
        //switchID(0);
    }

// --- START Simple Tree Menu --- //

    /***********************************************
     * Simple Tree Menu- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
     * This notice MUST stay intact for legal use
     * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
     ***********************************************/
    /*var persisteduls = new Object()
    var ddtreemenu = new Object()
    ddtreemenu.closefolder = "" //set image path to "closed" folder image
    ddtreemenu.openfolder = "" //set image path to "open" folder image
    //////////No need to edit beyond here///////////////////////////
    ddtreemenu.createTree = function(treeid, enablepersist, persistdays){
        var ultags = document.getElementById(treeid).getElementsByTagName("ul")
        if (typeof persisteduls[treeid] == "undefined") 
            persisteduls[treeid] = (enablepersist == true && ddtreemenu.getCookie(treeid) != "") ? ddtreemenu.getCookie(treeid).split(",") : ""
        for (var i = 0; i < ultags.length; i++) 
            ddtreemenu.buildSubTree(treeid, ultags[i], i)
        if (enablepersist == true) { //if enable persist feature
            var durationdays = (typeof persistdays == "undefined") ? 1 : parseInt(persistdays)
            ddtreemenu.dotask(window, function(){
                ddtreemenu.rememberstate(treeid, durationdays)
            }, "unload") //save opened UL indexes on body unload
        }
    }
    ddtreemenu.buildSubTree = function(treeid, ulelement, index){
        ulelement.parentNode.className = "submenu"
        if (typeof persisteduls[treeid] == "object") { //if cookie exists (persisteduls[treeid] is an array versus "" string)
            if (ddtreemenu.searcharray(persisteduls[treeid], index)) {
                ulelement.setAttribute("rel", "open")
                ulelement.style.display = "block"
                ulelement.parentNode.style.backgroundImage = "url(" + ddtreemenu.openfolder + ")"
            }
            else 
                ulelement.setAttribute("rel", "closed")
        } //end cookie persist code
        else 
            if (ulelement.getAttribute("rel") == null || ulelement.getAttribute("rel") == false) //if no cookie and UL has NO rel attribute explicted added by user
                ulelement.setAttribute("rel", "closed")
            else 
                if (ulelement.getAttribute("rel") == "open") //else if no cookie and this UL has an explicit rel value of "open"
                    ddtreemenu.expandSubTree(treeid, ulelement) //expand this UL plus all parent ULs (so the most inner UL is revealed!)
        ulelement.parentNode.onclick = function(e){
            var submenu = this.getElementsByTagName("ul")[0]
            if (submenu.getAttribute("rel") == "closed") {
                submenu.style.display = "block"
                submenu.setAttribute("rel", "open")
                ulelement.parentNode.style.backgroundImage = "url(" + ddtreemenu.openfolder + ")"
            }
            else 
                if (submenu.getAttribute("rel") == "open") {
                    submenu.style.display = "none"
                    submenu.setAttribute("rel", "closed")
                    ulelement.parentNode.style.backgroundImage = "url(" + ddtreemenu.closefolder + ")"
                }
            ddtreemenu.preventpropagate(e)
        }
        ulelement.onclick = function(e){
            ddtreemenu.preventpropagate(e)
        }
    }
    ddtreemenu.expandSubTree = function(treeid, ulelement){ //expand a UL element and any of its parent ULs
        var rootnode = document.getElementById(treeid)
        var currentnode = ulelement
        currentnode.style.display = "block"
        currentnode.parentNode.style.backgroundImage = "url(" + ddtreemenu.openfolder + ")"
        while (currentnode != rootnode) {
            if (currentnode.tagName == "UL") { //if parent node is a UL, expand it too
                currentnode.style.display = "block"
                currentnode.setAttribute("rel", "open") //indicate it's open
                currentnode.parentNode.style.backgroundImage = "url(" + ddtreemenu.openfolder + ")"
            }
            currentnode = currentnode.parentNode
        }
    }
    ddtreemenu.flatten = function(treeid, action){ //expand or contract all UL elements
        var ultags = document.getElementById(treeid).getElementsByTagName("ul")
        for (var i = 0; i < ultags.length; i++) {
            ultags[i].style.display = (action == "expand") ? "block" : "none"
            var relvalue = (action == "expand") ? "open" : "closed"
            ultags[i].setAttribute("rel", relvalue)
            ultags[i].parentNode.style.backgroundImage = (action == "expand") ? "url(" + ddtreemenu.openfolder + ")" : "url(" + ddtreemenu.closefolder + ")"
        }
    }
    ddtreemenu.rememberstate = function(treeid, durationdays){ //store index of opened ULs relative to other ULs in Tree into cookie
        var ultags = document.getElementById(treeid).getElementsByTagName("ul")
        var openuls = new Array()
        for (var i = 0; i < ultags.length; i++) {
            if (ultags[i].getAttribute("rel") == "open") 
                openuls[openuls.length] = i //save the index of the opened UL (relative to the entire list of ULs) as an array element
        }
        if (openuls.length == 0) //if there are no opened ULs to save/persist
            openuls[0] = "none open" //set array value to string to simply indicate all ULs should persist with state being closed
        ddtreemenu.setCookie(treeid, openuls.join(","), durationdays) //populate cookie with value treeid=1,2,3 etc (where 1,2... are the indexes of the opened ULs)
    }
    ////A few utility functions below//////////////////////
    ddtreemenu.getCookie = function(Name){ //get cookie value
        var re = new RegExp(Name + "=[^;]+", "i"); //construct RE to search for target name/value pair
        if (document.cookie.match(re)) //if cookie found
            return document.cookie.match(re)[0].split("=")[1] //return its value
        return ""
    }
    ddtreemenu.setCookie = function(name, value, days){ //set cookei value
        var expireDate = new Date()
        //set "expstring" to either future or past date, to set or delete cookie, respectively
        var expstring = expireDate.setDate(expireDate.getDate() + parseInt(days))
        document.cookie = name + "=" + value + "; expires=" + expireDate.toGMTString() + "; path=/";
    }
    ddtreemenu.searcharray = function(thearray, value){ //searches an array for the entered value. If found, delete value from array
        var isfound = false
        for (var i = 0; i < thearray.length; i++) {
            if (thearray[i] == value) {
                isfound = true
                thearray.shift() //delete this element from array for efficiency sake
                break
            }
        }
        return isfound
    }
    ddtreemenu.preventpropagate = function(e){ //prevent action from bubbling upwards
        if (typeof e != "undefined") 
            e.stopPropagation()
        else 
            event.cancelBubble = true
    }
    ddtreemenu.dotask = function(target, functionref, tasktype){ //assign a function to execute to an event handler (ie: onunload)
        var tasktype = (window.addEventListener) ? tasktype : "on" + tasktype
        if (target.addEventListener) 
            target.addEventListener(tasktype, functionref, false)
        else 
            if (target.attachEvent) 
                target.attachEvent(tasktype, functionref)
    }*/

    // --- Redirect Popup --- //
    function addresscheck(){
        var newhref = null;
        var linklist = document.getElementsByTagName('a');
        var address = new Array("142.179.213.203", "68.151.224.166", "transcanada.com","#","javascript");
        var checker;
        var finalnum;
        var dist = address.length;
        for (i = 0;i<linklist.length;i++){
            finalnum = 0;
            for (a = 0;a<dist;a++){
                checker = linklist[i].href.indexOf(address[a]);
                if (checker == -1)
                    finalnum++;
            }
            if (finalnum >= dist)
                linklist[i].onclick = function(){leave(this); return false};
        
        }
    }
    function leave(obj) {
        var newhref = obj.href;
        var answer = confirm("You are being redirected to a (web)site outside TransCanada.com");
        if (answer)
            window.open(newhref);
    }

    function pageContains(item) {
        // Tests to see if page DOM contains structural element 'item'
        var result = false;
        try {
            var tmp = null;
            if (tmp = document.getElementById(item)) {
                result = true;
            }
        } catch(e) {}
        
        return result;
    }


//////////////////////////////
/* --- Init JavaScripts --- */
//////////////////////////////  
  
    function setup() {
        //controlRDFM();
        removeDivider();
        closefaqdivz();

        
        
        //formatHomeSNLinks();
 
        if (typeof window.formatTopNavIE6 == "function") {
            formatTopNavIE6();
            if (pageContains('sectionSN')) {
                setSNFirstLinkIE6();
            }
        }
        // Ensure Foundation Page RedDot menu shows
        
        
        if (pageContains('middleContentSection')) {
            scrubTables();
        }

        if (pageContains('newsList')) {
            handleNewsList();
        }

        if (pageContains('NAESBSitemap')) {
            try {
                var firstCol = document.getElementById('NAESBSitemap').getElementsByTagName('div');
                firstCol[0].setAttribute("class", "sitemapColFirst");
                firstCol[0].setAttribute("className", "sitemapColFirst");
            } catch(e) {}
        }

        //

        if (pageContains('keyproject')) {
            try {
                var newpage = document.getElementById('keyproject').getElementsByTagName('div');
                lenbot = getCookie('keycookie').length;
                pagebot = newpage[0].id.length;
                var oldpage = getCookie('keycookie').substring(0,lenbot - 3);
                if (oldpage == newpage[0].id.substring(0,pagebot - 3)) {
                    switchIDkey(getCookie('keycookie').substring(lenbot - 2,lenbot));
                } else {
                    //getfirstpage();
                    setCookie('keycookie', newpage[0].id, 1);
                    var firstpage = getfirstpage(); 
                    switchIDkey(firstpage);
                }
             } catch(e){}
        }

        if (cookieSet('fontSize') == true) {
            adjustFontSize(getCookie('fontSize'));
        }
        else {
            setCookie('fontSize', 1, 1);
            adjustFontSize(1);
        }
        // switch to page stored in newsList cookie if required.
        //if (pageContains('newsList')) {
            //if (cookieSet('newsList') == true) {
                //switchNewsPage(getCookie('newsList'));
            //}
            //else {
                switchNewsPage(1);
            //}
        //}
        // --- Required for Printer-Friendly Page --- //
        if (getRequestVar('print') == 'yes') {
            if (pageContains('keyproject')) {
                showAllDIVs(document.getElementById('keyproject').getElementsByTagName('div'));
            }

            // Is this a faq or presentation page?
            if (pageContains('faq_body')){
                $('div.answer').each(function(i){
                    this.style.visibility = "visible";
                    this.style.display = "block";
                    this.style.height = "auto";
                });
                $('div.faq_blockoff').each(function(i){
                    this.style.visibility = "visible";
                    this.style.display = "block";
                });            
            }


            document.body.setAttribute("class", "printable");
            document.body.setAttribute("className", "printable");
            //markPrintTime();
        }

        // --- Tabbed Navigation --- //
        if (pageContains('tabs-contacts-1')) {
            if (cookieSet('tabbedNav') == true) {
                showActiveTab(getCookie('tabbedNav'));
            }
            else {
                setCookie('tabbedNav', 0, 1);
                showActiveTab(0);
            }
        }

        if ((document.body.className == 'tc_home') || (document.body.className == 'ce_home')) {
            if (cookieSet('flyout') == true) {
                switchID(getCookie('flyout'));
            }
            else {
                setCookie('flyout', 0, 1);
                switchID(0);
            }
        }
        else {
            setCookie('flyout', 0, 1);
        }

        // Emergency Response System
        // ***************************************
        
        /*
        if (document.body.className == "ce_home") {
            var sets = getERSSettings();
            //alert(sets[0].innerHTML+", "+sets[1].innerHTML);
            if (sets[0].innerHTML == "show") {
                if (cookieSet(sets[1].innerHTML) == false) {
                    // User visiting first time for this ERS message, display
                    document.getElementById('flyout').style.display = "none";
                    document.getElementById('flyoutFooter').style.display = "none";
                    document.getElementById('ERSWrapper').style.display = "block";
                    document.getElementById('ERS').style.position = "relative";
                    setCookie(sets[1].innerHTML, 0);
                    setCookie("viewedERS", 0);
                    cloudPage(50);
                }
            }
        }
        */
        

        // Emergency Response System
        // **************************************************
        
        // ERS On Home Page
        if (document.body.className == "ce_home") {
            var sets = getERSSettings();
            //alert(sets[0].innerHTML+", "+sets[1].innerHTML);
            if (sets[0].innerHTML == "show") {
                if (cookieSet(sets[1].innerHTML) == false) {
                    // User visiting first time for this ERS message, display
                    document.getElementById('flyout').style.display = "none";
                    document.getElementById('flyoutFooter').style.display = "none";
                    document.getElementById('ERSWrapper').style.display = "block";
                    document.getElementById('ERS').style.position = "relative";
                    // setCookie(sets[1].innerHTML, 0, 1);
                    setCookie(sets[1].innerHTML, 0);  // Session Cookie
                    cloudPage(50);
                }
            }
        } else {
        // ERS On Inside Pages
            
        }
        


        
        
        // Emergency Response System END
        // ***************************************


        // Setup Google Analytics Download
        // tag documents
        $("a[href*=.pdf], a[href*=.doc], a[href*=.docx], a[href*=.xls], a[href*=.xlsx]").click(function(){
            $(this).attr({"target":"_blank"});
            _gaq.push(['_trackPageview', $(this).attr("href") ]);
        });
        // tag media/other
        $("a[href*=.mp3], a[href*=.mp4], a[href*=.zip], a[href*=.flv]").click(function(){
            $(this).attr({"target":"_blank"});
            _gaq.push(['_trackPageview', $(this).attr("href") ]);
        });
 
    
    }

/* Org Chart ontrols */

function expandContacts( id ) {
    tmp1 = document.getElementById("expand_" + id);
    tmp1.style.display = "none";
    tmp2 = document.getElementById("collapse_" + id);
    tmp2.style.display = "";
    tmp3 = document.getElementById("subcontacts_" + id);
    tmp3.style.display = "";
}
function collapseContacts( id ) {
    
    tmp1 = document.getElementById("expand_" + id);
    tmp1.style.display = "";
    tmp2 = document.getElementById("collapse_" + id);
    tmp2.style.display = "none";
    tmp3 = document.getElementById("subcontacts_" + id);
    tmp3.style.display = "none";
}
function orgChartFlashDetect() {
    if( flashEnabled == 1 )
        document.getElementById("orgchart_html").style.display = "none";
    else
        document.getElementById("orgchart_flash").style.display = "none";
}
   

function emailpopcode(emailaddy) {
    var href = "mailto:" + emailaddy;
    var wndMail = window.open(href, "_blank", "scrollbars=yes,resizable=yes,width=10,height=10");
    if( wndMail ){
        wndMail.close();
        }
    
    
}
// setup the cookie
function setCookieflash(c_name,value)
{
elementoff();
document.cookie=c_name+ "=" +escape(value)
}

//Check for the cookie
function getCookieflash(c_name)
{
if (getCookie('orgchart').length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    {
    c_start=c_start + c_name.length+1;
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    var poppertxt = unescape(document.cookie.substring(c_start,c_end));
    orgchart(50,' ',poppertxt);
    elementoff();
    window.location.href = "#focushere"
    }
  }
}

function elementoff(){
    if (document.getElementById("dropas")){
    document.getElementById("dropas").style.display = "none";
    }
}
function elementon(){
    if (document.getElementById("dropas")){
            document.getElementById("dropas").style.display = "";
    }
} 

// Delete the cookie
function delete_cookieflash ( cookie_name )
{
  var cookie_date = new Date ( );  // current date & time
  cookie_date.setTime ( cookie_date.getTime() - 1 );
  document.cookie = cookie_name += "=; expires=" + cookie_date.toGMTString();
}


// Open sized regular window
function openSizedRegularPopupWindow(urlToOpen,windowWidth,windowHeight) {
    tempw = window.open(urlToOpen,'popup','location=yes,menubar=yes,scrollbars=yes,resizable=yes,width=' + windowWidth + ',height=' + windowHeight + '');
    tempw.focus();
}
// Open minimal window
function openMinimalPopupWindow(urlToOpen,windowWidth,windowHeight) {
    tempw = window.open(urlToOpen,'popup','scrollbars=yes,resizable=yes,width=' + windowWidth + ',height=' + windowHeight + '');
    tempw.focus();
}
// Open Toll Calculator
//function openTollCalculator(){
    //openMinimalPopupWindow("http://util.transcanada.com/tollcalculator/","960","580");
//}

// main calling function for showing the flash map overlay
function openTollCalculator(sourceclick){
    openMinimalPopupWindow("http://www.transcanada.com/tollcalculator/","960","580");
    if (sourceclick == "homemap"){
        if (pageTracker){pageTracker._trackPageview("/TollCalcHomeMap/ ");}
    } else {
        if (pageTracker){pageTracker._trackPageview("/TollCalcHeader/ ");}
    }
}

// Open Conversion Tool
function openConversionTool(){
    openMinimalPopupWindow("http://www.transcanada.com/conversiontool/","920","680");
}
// Open Update Magazine
function openUpdateMagazine(){
    openSizedRegularPopupWindow("http://www.transcanada.com/Customer_Express/Update/","950","680");
}
// change teh pointer to a cursor upon rollover the flashmap (Toll calculator static)
function flashAreaMouseover(){
    document.getElementById("flashArea").style.cursor = "hand";
}
function flashAreaMouseout(){
    document.getElementById("flashArea").style.cursor = "pointer";
}

    // --- Script Controls --- //
    //if (window.attachEvent) {
    //    window.attachEvent("onload", sfHover);
    //}
 // -- sIFR Controls --//
/*    sIFR 2.0.1 Official Add-ons 1.2
    Copyright 2005 Mark Wubben
    This software is licensed under the CC-GNU LGPL <http://creativecommons.org/licenses/LGPL/2.1/>
*/
if(typeof sIFR=="function")(function(){var j=document;var h=j.documentElement;sIFR.removeDecoyClasses=function(){function a(b){if(b&&b.className!=null)b.className=b.className.replace(/\bsIFR-hasFlash\b/,"")}return function(){a(h);a(j.getElementsByTagName("body")[0])}}();sIFR.preferenceManager={storage:{sCookieId:"sifr",set:function(a){var b=new Date();b.setFullYear(b.getFullYear()+3);j.cookie=[this.sCookieId,"=",a,";expires=",b.toGMTString(),";path=/"].join("")},get:function(){var a=j.cookie.match(new RegExp(";?"+this.sCookieId+"=([^;]+);?"));if(a!=null&&a[1]=="false")return false;else return true},reset:function(){var a=new Date();a.setFullYear(a.getFullYear()-1);j.cookie=[this.sCookieId,"=true;expires=",a.toGMTString(),";path=/"].join("")}},disable:function(){this.storage.set(false)},enable:function(){this.storage.set(true)},test:function(){return this.storage.get()}};if(sIFR.preferenceManager.test()==false){sIFR.bIsDisabled=true;sIFR.removeDecoyClasses()}sIFR.rollback=function(){function a(b){var c,d,e,f,g,h;var l=parseSelector(b);var i=l.length-1;var m=false;while(i>=0){c=l[i];l.length--;d=c.parentNode;if(c.getAttribute("sifr")=="true"){h=0;while(h<d.childNodes.length){c=d.childNodes[h];if(c.className=="sIFR-alternate"){e=c;h++;continue}d.removeChild(c)}if(e!=null){f=e.firstChild;while(f!=null){g=f.nextSibling;d.appendChild(e.removeChild(f));f=g}d.removeChild(e)}if(!sIFR.UA.bIsXML&&sIFR.UA.bUseInnerHTMLHack)d.innerHTML+="";d.className=d.className.replace(/\bsIFR\-replaced\b/,"")};m=true;i--}return m}return function(k){named.extract(arguments,{sSelector:function(a){k=a}});if(k==null)k="";else k+=">";sIFR.removeDecoyClasses();sIFR.bHideBrowserText=false;if(a(k+"embed")==false)a(k+"object")}}()})()
/*    sIFR v2.0.7
    Copyright 2004 - 2008 Mark Wubben and Mike Davidson. Prior contributions by Shaun Inman and Tomas Jogin.
    
    This software is licensed under the CC-GNU LGPL <http://creativecommons.org/licenses/LGPL/2.1/>
*/
var hasFlash=function(){var a=6;if(navigator.appVersion.indexOf("MSIE")!=-1&&navigator.appVersion.indexOf("Windows")>-1){document.write('<script language="VBScript"\> \non error resume next \nhasFlash = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & '+a+'))) \n</script\> \n');if(window.hasFlash!=null)return window.hasFlash}if(navigator.mimeTypes&&navigator.mimeTypes["application/x-shockwave-flash"]&&navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin){var b=(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]).description;return parseInt(b.substr(b.indexOf(".")-2,2),10)>=a}return false}();String.prototype.normalize=function(){return this.replace(/\s+/g," ")};if(Array.prototype.push==null){Array.prototype.push=function(){var i=0,a=this.length,b=arguments.length;while(i<b){this[a++]=arguments[i++]}return this.length}}if(!Function.prototype.apply){Function.prototype.apply=function(a,b){var c=[];var d,e;if(!a)a=window;if(!b)b=[];for(var i=0;i<b.length;i++){c[i]="b["+i+"]"}e="a.__applyTemp__("+c.join(",")+");";a.__applyTemp__=this;d=eval(e);a.__applyTemp__=null;return d}}function named(a){return new named.Arguments(a)}named.Arguments=function(a){this.oArgs=a};named.Arguments.prototype.constructor=named.Arguments;named.extract=function(a,b){var c,d;var i=a.length;while(i--){d=a[i];if(d!=null&&d.constructor!=null&&d.constructor==named.Arguments){c=a[i].oArgs;break}}if(c==null)return;for(e in c)if(b[e]!=null)b[e](c[e]);return};var parseSelector=function(){var a=/^([^#.>`]*)(#|\.|\>|\`)(.+)$/;function r(s,t){var u=s.split(/\s*\,\s*/);var v=[];for(var i=0;i<u.length;i++)v=v.concat(b(u[i],t));return v}function b(c,d,e){c=c.normalize().replace(" ","`");var f=c.match(a);var g,h,i,j,k,n;var l=[];if(f==null)f=[c,c];if(f[1]=="")f[1]="*";if(e==null)e="`";if(d==null)d=document;switch(f[2]){case "#":k=f[3].match(a);if(k==null)k=[null,f[3]];g=document.getElementById(k[1]);if(g==null||(f[1]!="*"&&!o(g,f[1])))return l;if(k.length==2){l.push(g);return l}return b(k[3],g,k[2]);case ".":if(e!=">")h=m(d,f[1]);else h=d.childNodes;for(i=0,n=h.length;i<n;i++){g=h[i];if(g.nodeType!=1)continue;k=f[3].match(a);if(k!=null){if(g.className==null||g.className.match("(\\s|^)"+k[1]+"(\\s|$)")==null)continue;j=b(k[3],g,k[2]);l=l.concat(j)}else if(g.className!=null&&g.className.match("(\\s|^)"+f[3]+"(\\s|$)")!=null)l.push(g)}return l;case ">":if(e!=">")h=m(d,f[1]);else h=d.childNodes;for(i=0,n=h.length;i<n;i++){g=h[i];if(g.nodeType!=1)continue;if(!o(g,f[1]))continue;j=b(f[3],g,">");l=l.concat(j)}return l;case "`":h=m(d,f[1]);for(i=0,n=h.length;i<n;i++){g=h[i];j=b(f[3],g,"`");l=l.concat(j)}return l;default:if(e!=">")h=m(d,f[1]);else h=d.childNodes;for(i=0,n=h.length;i<n;i++){g=h[i];if(g.nodeType!=1)continue;if(!o(g,f[1]))continue;l.push(g)}return l}}function m(d,o){if(o=="*"&&d.all!=null)return d.all;return d.getElementsByTagName(o)}function o(p,q){return q=="*"?true:p.nodeName.toLowerCase().replace("html:", "")==q.toLowerCase()}return r}();var sIFR=function(){var a="http://www.w3.org/1999/xhtml";var b=false;var c=false;var d;var ah=[];var al=document;var ak=al.documentElement;var am=window;var au=al.addEventListener;var av=am.addEventListener;var f=function(){var g=navigator.userAgent.toLowerCase();var f={a:g.indexOf("applewebkit")>-1,b:g.indexOf("safari")>-1,c:navigator.product!=null&&navigator.product.toLowerCase().indexOf("konqueror")>-1,d:g.indexOf("opera")>-1,e:al.contentType!=null&&al.contentType.indexOf("xml")>-1,f:true,g:true,h:null,i:null,j:null,k:null};f.l=f.a||f.c;f.m=!f.a&&navigator.product!=null&&navigator.product.toLowerCase()=="gecko";if(f.m&&g.match(/.*gecko\/(\d{8}).*/))f.j=new Number(g.match(/.*gecko\/(\d{8}).*/)[1]);f.n=g.indexOf("msie")>-1&&!f.d&&!f.l&&!f.m;f.o=f.n&&g.match(/.*mac.*/)!=null;if(f.d&&g.match(/.*opera(\s|\/)(\d+\.\d+)/))f.i=new Number(g.match(/.*opera(\s|\/)(\d+\.\d+)/)[2]);if(f.n||(f.d&&f.i<7.6))f.g=false;if(f.a&&g.match(/.*applewebkit\/(\d+).*/))f.k=new Number(g.match(/.*applewebkit\/(\d+).*/)[1]);if(am.hasFlash&&(!f.n||f.o)){var aj=(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]).description;f.h=parseInt(aj.substr(aj.indexOf(".")-2,2),10)}if(g.match(/.*(windows|mac).*/)==null||f.o||f.c||(f.d&&(g.match(/.*mac.*/)!=null||f.i<7.6))||(f.b&&f.h<7)||(!f.b&&f.a&&f.k<312)||(f.m&&f.j<20020523))f.f=false;if(!f.o&&!f.m&&al.createElementNS)try{al.createElementNS(a,"i").innerHTML=""}catch(e){f.e=true}f.p=f.c||(f.a&&f.k<312);return f}();function at(){return{bIsWebKit:f.a,bIsSafari:f.b,bIsKonq:f.c,bIsOpera:f.d,bIsXML:f.e,bHasTransparencySupport:f.f,bUseDOM:f.g,nFlashVersion:f.h,nOperaVersion:f.i,nGeckoBuildDate:f.j,nWebKitVersion:f.k,bIsKHTML:f.l,bIsGecko:f.m,bIsIE:f.n,bIsIEMac:f.o,bUseInnerHTMLHack:f.p}}if(am.hasFlash==false||!al.getElementsByTagName||!al.getElementById||(f.e&&(f.p||f.n)))return{UA:at()};function af(e){if((!k.bAutoInit&&(am.event||e)!=null)||!l(e))return;b=true;for(var i=0,h=ah.length;i<h;i++)j.apply(null,ah[i]);ah=[]}var k=af;function l(e){if(c==false||k.bIsDisabled==true||((f.e&&f.m||f.l)&&e==null&&b==false)||al.getElementsByTagName("body").length==0)return false;return true}function m(n){if(f.n)return n.replace(new RegExp("%\d{0}","g"),"%25");return n.replace(new RegExp("%(?!\d)","g"),"%25")}function as(p,q){return q=="*"?true:p.nodeName.toLowerCase().replace("html:", "")==q.toLowerCase()}function o(p,q,r,s,t){var u="";var v=p.firstChild;var w,x,y,z;if(s==null)s=0;if(t==null)t="";while(v){if(v.nodeType==3){z=v.nodeValue.replace("<","&lt;");switch(r){case "lower":u+=z.toLowerCase();break;case "upper":u+=z.toUpperCase();break;default:u+=z}}else if(v.nodeType==1){if(as(v,"a")&&!v.getAttribute("href")==false){if(v.getAttribute("target"))t+="&sifr_url_"+s+"_target="+v.getAttribute("target");t+="&sifr_url_"+s+"="+m(v.getAttribute("href")).replace(/&/g,"%26");u+='<a href="asfunction:_root.launchURL,'+s+'">';s++}else if(as(v,"br"))u+="<br/>";if(v.hasChildNodes()){y=o(v,null,r,s,t);u+=y.u;s=y.s;t=y.t}if(as(v,"a"))u+="</a>"}w=v;v=v.nextSibling;if(q!=null){x=w.parentNode.removeChild(w);q.appendChild(x)}}return{"u":u,"s":s,"t":t}}function A(B){if(al.createElementNS&&f.g)return al.createElementNS(a,B);return al.createElement(B)}function C(D,E,z){var p=A("param");p.setAttribute("name",E);p.setAttribute("value",z);D.appendChild(p)}function F(p,G){var H=p.className;if(H==null)H=G;else H=H.normalize()+(H==""?"":" ")+G;p.className=H}function aq(ar){var a=ak;if(k.bHideBrowserText==false)a=al.getElementsByTagName("body")[0];if((k.bHideBrowserText==false||ar)&&a)if(a.className==null||a.className.match(/\bsIFR\-hasFlash\b/)==null)F(a, "sIFR-hasFlash")}function j(I,J,K,L,M,N,O,P,Q,R,S,r,T){if(!l())return ah.push(arguments);aq();named.extract(arguments,{sSelector:function(ap){I=ap},sFlashSrc:function(ap){J=ap},sColor:function(ap){K=ap},sLinkColor:function(ap){L=ap},sHoverColor:function(ap){M=ap},sBgColor:function(ap){N=ap},nPaddingTop:function(ap){O=ap},nPaddingRight:function(ap){P=ap},nPaddingBottom:function(ap){Q=ap},nPaddingLeft:function(ap){R=ap},sFlashVars:function(ap){S=ap},sCase:function(ap){r=ap},sWmode:function(ap){T=ap}});var U=parseSelector(I);if(U.length==0)return false;if(S!=null)S="&"+S.normalize();else S="";if(K!=null)S+="&textcolor="+K;if(M!=null)S+="&hovercolor="+M;if(M!=null||L!=null)S+="&linkcolor="+(L||K);if(O==null)O=0;if(P==null)P=0;if(Q==null)Q=0;if(R==null)R=0;if(N==null)N="#FFFFFF";if(T=="transparent")if(!f.f)T="opaque";else N="transparent";if(T==null)T="";var p,V,W,X,Y,Z,aa,ab,ac;var ad=null;for(var i=0,h=U.length;i<h;i++){p=U[i];if(p.className!=null&&p.className.match(/\bsIFR\-replaced\b/)!=null)continue;V=p.offsetWidth-R-P;W=p.offsetHeight-O-Q;aa=A("span");aa.className="sIFR-alternate";ac=o(p,aa,r);Z="txt="+m(ac.u).replace(/\+/g,"%2B").replace(/&/g,"%26").replace(/\"/g, "%22").normalize() + S + "&w=" + V + "&h=" + W + ac.t;F(p,"sIFR-replaced");if(ad==null||!f.g){if(!f.g){if(!f.n)p.innerHTML=['<embed class="sIFR-flash" type="application/x-shockwave-flash" src="',J,'" quality="best" wmode="',T,'" bgcolor="',N,'" flashvars="',Z,'" width="',V,'" height="',W,'" sifr="true"></embed>'].join("");else p.innerHTML=['<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" sifr="true" width="',V,'" height="',W,'" class="sIFR-flash"><param name="movie" value="',J,'"></param><param name="flashvars" value="',Z,'"></param><param name="quality" value="best"></param><param name="wmode" value="',T,'"></param><param name="bgcolor" value="',N,'"></param> </object>'].join('')}else{if(f.d){ab=A("object");ab.setAttribute("data",J);C(ab,"quality","best");C(ab,"wmode",T);C(ab,"bgcolor",N)}else{ab=A("embed");ab.setAttribute("src",J);ab.setAttribute("quality","best");ab.setAttribute("flashvars",Z);ab.setAttribute("wmode",T);ab.setAttribute("bgcolor",N)}ab.setAttribute("sifr","true");ab.setAttribute("type","application/x-shockwave-flash");ab.className="sIFR-flash";if(!f.l||!f.e)ad=ab.cloneNode(true)}}else ab=ad.cloneNode(true);if(f.g){if(f.d)C(ab,"flashvars",Z);else ab.setAttribute("flashvars",Z);ab.setAttribute("width",V);ab.setAttribute("height",W);ab.style.width=V+"px";ab.style.height=W+"px";p.appendChild(ab)}p.appendChild(aa);if(f.p)p.innerHTML+=""}if(f.n&&k.bFixFragIdBug)setTimeout(function(){al.title=d},0)}function ai(){d=al.title}function ae(){if(k.bIsDisabled==true)return;c=true;if(k.bHideBrowserText)aq(true);if(am.attachEvent)am.attachEvent("onload",af);else if(!f.c&&(al.addEventListener||am.addEventListener)){if(f.a&&f.k>=132&&am.addEventListener)am.addEventListener("load",function(){setTimeout("sIFR({})",1)},false);else{if(al.addEventListener)al.addEventListener("load",af,false);if(am.addEventListener)am.addEventListener("load",af,false)}}else if(typeof am.onload=="function"){var ag=am.onload;am.onload=function(){ag();af()}}else am.onload=af;if(!f.n||am.location.hash=="")k.bFixFragIdBug=false;else ai()}k.UA=at();k.bAutoInit=true;k.bFixFragIdBug=true;k.replaceElement=j;k.updateDocumentTitle=ai;k.appendToClassName=F;k.setup=ae;k.debug=function(){aq(true)};k.debug.replaceNow=function(){ae();k()};k.bIsDisabled=false;k.bHideBrowserText=true;return k}();
if(typeof sIFR == "function" && !sIFR.UA.bIsIEMac && (!sIFR.UA.bIsWebKit || sIFR.UA.nWebKitVersion >= 100)){
    sIFR.setup();
};
         if(typeof sIFR == "function"){
            sIFR.replaceElement("#lp2ColSection .intro", named({sFlashSrc: "/customerexpress/includes/frut-light.swf", sColor: "#000000"}));
            sIFR.replaceElement("#home_page_text", named({sFlashSrc: "/customerexpress/includes/sifr-cs3-and-up.swf", sColor: "#FFFFFF", sWmode: "transparent"}));
            sIFR.replaceElement("#lp_imageBanner .lpText1 .orange_sifr_text", named({sFlashSrc: "/customerexpress/includes/frut.swf", sColor: "#FFFFFF", sWmode: "transparent"}));
            sIFR.replaceElement("#lp_imageBanner .lpText2 .blue_sifr_text", named({sFlashSrc: "/customerexpress/includes/frut.swf", sColor: "#FFFFFF", sWmode: "transparent"}));
            sIFR.replaceElement("example code", named({sFlashSrc: "/customerexpress/includes/frut.swf", sColor: "#FFFFFF", sWmode: "transparent"}));
    }; // <-- Do not put anything outside of this bracket
