//////////////////////
// Site JavaScripts //
//////////////////////

    /* --- News Article List Pagination Controls --- */
    function buildPaginationMenus() {
        var articles = document.getElementById('newsList').getElementsByTagName('ul');
        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";
        }
        //alert('Articles: ' + articles.length + '\nPages: ' + numPages);
        //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);
        //alert("Num: "+num+" Cookie: "+getCookie('newsList'));
        //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");
            //alert("Page has a News Article List");
            buildPaginationMenus();
        } catch(e) {}
    }

    /* --- Control the display of RedDot Foundation Page menu via JavaScript --- */
    function markRDFMs(id) {
        var pageTypes = new Array('RDFM_LPHOME', '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 == "lp_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');
                //alert("LP_HOME: "+lpRightCol.length);
                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');
                //alert("INSIDE: "+bookflap.length);
                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) {
        var pageDivs = new Array('header', 'topNav', 'navHeader', 'navigation', 'flashArea', 'footerWrapper');
        
        for (var aa = 0; aa < pageDivs.length; aa++) {
            document.getElementById(pageDivs[aa]).style.opacity = val/100;
            document.getElementById(pageDivs[aa]).style.filter = 'alpha(opacity=' +val+ ')';
            document.getElementById(pageDivs[aa]).style.MozOpacity = val/100;
        }
    }
    
    function leaveERS() {
        document.getElementById('ERS').style.display = "none";
        document.getElementById('flyout').style.display = "block";
        
        cloudPage(100);
    }*/

    /* --- 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');
            //alert(trs.length);
            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 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');
            //alert("Tables: "+tblz.length);
            
            for (var inx = 0; inx < tblz.length; inx++) {
                if (tblz[inx].parentNode.nodeName != "TD") {
                    // Table is not embedded in another table
                
                    cleanTableRows(tblz[inx]);
                    //alert("return from cleaning table rows");
                    stripeTableRows(tblz[inx]);
                    //alert("return from striping table rows");
                }
                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) {}
    }

    // --- 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++) {
            //alert(divs[inx].className);
            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
        
        var flyOuts = loadFlyoutList();
        hideAllIDs(flyOuts);
        flyOuts[id].style.display = 'block';
        setCookie('flyout', id, 1);
    }
        
    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';
        }
    }
    // --- 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 != "lp_home") {
            var sections = new Array('middleContentSection', 'rightContentSection');
        }
        else {
            var sections = new Array('lp2ColSection', 'lpRightCol');
        }
        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 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 = "/images/interface/plus.gif" //set image path to "closed" folder image
    ddtreemenu.openfolder = "/images/interface/minus.gif" //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)
    }*/

    // --- Shawn Pick Redirect Popup --- //
    function addresscheck(){
        var newhref = null;
        var linklist = document.getElementsByTagName('a');
        var address = new Array("142.179.213.203", "v151p1.test.ad", "v152p1.test.ad:8080", "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');
overlaydiv.style.display = 'none';
mapperdiv.style.display = 'none';
document.getElementById('map_overlay').style.height = "0px";
document.getElementById('mapper').style.height = "0px";
}
function addressbreak(){
flashconfigtemp = document.getElementById('flasherconfig').href;
brokenup = flashconfigtemp.split("/");
for (i = 0;i <= brokenup.length;i++){
alert(brokenup[i]);
}
}
function getheight(val) {
        //var pageDivs = new Array('header', 'topNav', 'navHeader', 'navigation', 'flashArea', 'footerWrapper');
        
        //for (var aa = 0; aa < pageDivs.length; aa++) {
            //document.getElementById(pageDivs[aa]).style.opacity = val/100;
            //document.getElementById(pageDivs[aa]).style.filter = 'alpha(opacity=' +val+ ')';
            //document.getElementById(pageDivs[aa]).style.MozOpacity = val/100;
        //}
        
        var x,y;
        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;
            }
            //alert("Page Height: " + pageHeight + "\nOffset: " + document.body.offsetHeight);
            //var yy = document.body.offsetHeight;
            document.getElementById('map_overlay').style.height = pageHeight+"px";
            document.getElementById('mapper').style.height = "490px"
        } catch(e) {}
        
        //alert(document.getElementById('wrapper').style.height);
        //alert(document.body.offsetHeight);
        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;



        // centre map on the screen
        if (pageWidth < 980 || pageWidth == null){
            mapX = 2;
        } else {
            mapX = Math.floor((pageWidth - 980)/2);
        }
         
        document.getElementById('mapper').style.display = "block";
        document.getElementById('mapper').style.left = mapX+"px"; 
  
        }
    // --- Shawn Pick Finshed --- //

    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();
        

        if (typeof window.formatTopNavIE6 == "function") {
            formatTopNavIE6();
        }
        
        if (pageContains('middleContentSection')) {
            scrubTables();
        }
    
        if (pageContains('newsList')) {
            handleNewsList();
        }
        //addresscheck();
        if (cookieSet('fontSize') == true) {
            adjustFontSize(getCookie('fontSize'));
        }
        else {
            setCookie('fontSize', 1, 1);
            adjustFontSize(1);
        }
        
        
        if (pageContains('newsList')) {
            switchNewsPage(1);
            /*
            if (cookieSet('newsList') == true) {
                switchNewsPage(getCookie('newsList'));
            }
            else {
                switchNewsPage(1);
            }
            */
        }
        

        switchNewsPage(1);

        if (getRequestVar('print') == 'yes') {
            document.body.setAttribute("class", "printable");
            document.body.setAttribute("className", "printable");
            //markPrintTime();
        }
        //if (cookieSet('tab') == true) {
        //    getCookie('tab');
        //}
        //else {
        //    setCookie('tab', id, 1);
        //}
        
    }
    


 // -- 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: "/includes/frut-light.swf", sColor: "#000000",sWmode: "opaque"}));
            sIFR.replaceElement("#lp_imageBanner .lpText1 .orange_sifr_text", named({sFlashSrc: "/includes/frut.swf", sColor: "#FFFFFF", sWmode: "opaque", sBgColor: "#F18034"}));
            sIFR.replaceElement("#lp_imageBanner .lpText2 .blue_sifr_text", named({sFlashSrc: "/includes/frut.swf", sColor: "#FFFFFF", sWmode: "opaque", sBgColor: "#669ACC"}));
            sIFR.replaceElement("example code", named({sFlashSrc: "/includes/frut.swf", sColor: "#FFFFFF", sWmode: "transparent"}));
    };