    var aMenu = new Array();
    var min = 11;
    var max = 20;
    var increment = 2;
    var vp = GetViewPorts();
    var ms;
    var centerWidth = 731;
    
    /**
     *
     *
     */
    function Flip(toggle, name) {
        if ( toggle ) { // Mouseover
            document.getElementById(name + '_on').style.display = 'inline';
        } 
        else { // Mouse out 
            document.getElementById(name + '_on').style.display = 'none';
        }
    }
    
    /**
     *
     *
     */
    function Goto(obj) {
        document.location.href = aRootLinks[obj.id].link;
    }

    /**
     *
     *
     */
    function RenderMenu() {
        for( var i in aNav ) {
            var item = aNav[i];
            if ( typeof(aMenuLinks[item]) != 'undefined' ) {
                if ( aMenuLinks[item].length > 0 ) {
                  aMenu[item] = ms.addMenu(document.getElementById(item));
                  for( var j in aMenuLinks[item] ) {
                      if ( typeof(aMenuLinks[item][j].title) != 'undefined' ) {
                        aMenu[item].addItem(aMenuLinks[item][j].title, aMenuLinks[item][j].link);
                      }
                  }
                }
            }
        }
    }
    
    /**
     *
     *
     */
    function InitMenu() {
        for( var i in aNav ) {
            var item = aNav[i];
            if ( typeof(aMenuLinks[item]) != 'undefined' ) {
                aMenu[item].onactivate = new Function("Flip(true, '" + item + "')");
                aMenu[item].ondeactivate = new Function("Flip(false, '" + item + "')");
            }
        }
    }


        function init() {
    
            if (TransMenu.isSupported()) {
                TransMenu.initialize();
                // hook all the highlight swapping of the main toolbar to menu activation/deactivation
                // instead of simple rollover to get the effect where the button stays hightlit until
                // the menu is closed.
                InitMenu()
            }
        }


    /**
     *
     *
     */
    function FontSize(action) {
        var currentValue = document.body.style.fontSize;
        var fontSize = parseInt(currentValue);
        var delta = (action == 'UP' ? increment : -increment );
        fontSize = fontSize + delta;
        
        if (fontSize > max)
            return;
        if (fontSize < min )
            return;

        document.body.style.fontSize = fontSize + 'px';
        return false;
    }
    
    /**
     *
     *
     */
    function InitNav() { 
        for( i = 0; i < aNav.length; i++) {
            var nav = aNav[i];
            document.getElementById(nav).onmouseover = new Function("Flip(true , '" + nav + "')");
            if (typeof aMenuLinks[nav] == "undefined") {
                document.getElementById(nav).onmouseout   = new Function("Flip(false, '" + nav + "');");
            }
        }
        init();
    }
    
    /**
     *
     *
     */
    function GetViewPorts() {
       var viewport = new Object;   
       var viewportwidth;
       var viewportheight;
       
       // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
       if (typeof window.innerWidth != 'undefined')
       {
            viewportwidth = window.innerWidth,
            viewportheight = window.innerHeight
       }
       // IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)
       else if (typeof document.documentElement != 'undefined'
           && typeof document.documentElement.clientWidth !=
           'undefined' && document.documentElement.clientWidth != 0)
       {
             viewportwidth = document.documentElement.clientWidth,
             viewportheight = document.documentElement.clientHeight
       }
       // older versions of IE
       else
       {
             viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
             viewportheight = document.getElementsByTagName('body')[0].clientHeight
       }        
        
        viewport.width = viewportwidth;
        viewport.height = viewportheight;
        return viewport;
    }
    
    function ResizeWindow()
    {
        /*
        var vp = GetViewPorts();
        var page = document.getElementById('page');
        
        if (vp.width < 1010) {
            document.body.style.overflowX = 'scroll';
            //page.style.width = '994px';
            document.body.style.width = '994px';
        }
        else {
            document.body.style.overflowX = 'hidden';
            page.style.width = '1020px';
            document.body.style.width = '1020px';
        }
        
        */
    }
    
    function HightlightBreadCrumbs() {
        var bc = document.getElementById("breadcrumbs");
        bc.lastChild.lastChild.style.color = '#8b7f9f';
    }
    
    function ConfirmRedirect() {
        var strMsg = "You are now leaving the Financial Ombudsman Service website.\n" +
                      "The information you have requested is temporarily still located\n"+
                      "on one of the websites we used before we merged to become the Financial Ombudsman Service.\n\n" +
                      "Are you sure you want to continue ?";
        
        if ( !confirm(strMsg) ) {
            return false;
        }
    }
    
  // Extract a random image for the home header image ( max 4 Images )
  function RandomHome( rand_dom_id ) {
    var rand_no = Math.random();
    rand_no = rand_no * 10;
    rand_no = Math.ceil(rand_no % 4);
        
    document.getElementById(rand_dom_id).src = "/images/foshome_img" + rand_no + ".png";
  }

