/*
	Author: Chris Burton
	Date: 20070801
	
   Deluxe Menu Data File | http://deluxe-menu.com

   **This file CANNOT be reloaded into the Deluxe-menu Tuner.**
   
    This script has been modified significantly from the original
    generated file. For one thing it has been localized. For another all
    of the paths are based off of the global variable dmSitePath. For a
    third, we have added the key variable to enable the commercial
    version of the menu. For a fourth, we have added looking at
    dmHomePage to see if we are on the site home page. For a fifth, we
    have modified the page to dynamically show the current page in the
    menu.

    This script expects the following global variables to be defined:
      dmHomePage (boolean) - Defines whether the current page is the home page.
                             Default: false

      dmSitePath (string)  - Defines the root directory where the web
                             site is hosted. This allows the web site to
                             be put into a sub-directory on a server. The
                             value of the root directory is set in the
                             web.config file in a variable called
                             ek_sitePath. From there it is used in the
                             ASPX files as well as passed in here for the
                             menu paths.
*/


// -- Deluxe Tuner Style Names
var itemStylesNames=[];
var menuStylesNames=[];
// -- End of Deluxe Tuner Style Names

//--- Common
var isHorizontal=1;
var smColumns=1;
var smOrientation=0;
var smViewType=0;
var dmRTL=0;
var pressedItem=-2;
var itemCursor="pointer";
var itemTarget="_self";
var statusString="link";
var blankImage="resources/JavaScript/homemenufiles/blank.gif";
var pathPrefix_img="";
var pathPrefix_link="";

//--- Dimensions
var menuWidth="408px";
var menuHeight="28px";
var smWidth="185px";
var smHeight="";

//--- Positioning
var absolutePos=0;
var posX="10px";
var posY="10px";
var topDX=0;
var topDY=0;
var DX=0;
var DY=0;

//--- Font
var fontStyle="bold 12px Verdana";
var fontColor=["#FFFFFF","#003300"];
var fontDecoration=["none","none"];
var fontColorDisabled="#AAAAAA";

//--- Appearance
var menuBackColor="#003300";
var menuBackImage="";
var menuBackRepeat="repeat";
var menuBorderColor="#003300";
var menuBorderWidth=0;
var menuBorderStyle="none";

//--- Item Appearance
var itemBackColor=["#003300","#CCCC99"];
var itemBackImage=["",""];
var itemBorderWidth=0;
var itemBorderColor=["#003300","#CCCC99"];
var itemBorderStyle=["solid","solid"];
var itemSpacing=1;
var itemPadding="3px";
var itemAlignTop="center";
var itemAlign="left";
var subMenuAlign="left";

//--- Icons
var iconTopWidth=16;
var iconTopHeight=16;
var iconWidth=16;
var iconHeight=16;
var arrowWidth=12;
var arrowHeight=12;
var arrowImageMain=["",""];
var arrowImageSub=["resources/JavaScript/homemenufiles/arr_white_1.gif",""];

//--- Separators
var separatorImage="resources/JavaScript/homemenufiles/sep_white2.gif";
var separatorWidth="100px";
var separatorHeight="5px";
var separatorAlignment="left";
var separatorVImage="resources/JavaScript/homemenufiles/sepv_blue.gif";
var separatorVWidth="5px";
var separatorVHeight="18px";
var separatorPadding="0px";

//--- Floatable Menu
var floatable=0;
var floatIterations=6;
var floatableX=1;
var floatableY=1;

//--- Movable Menu
var movable=0;
var moveWidth=12;
var moveHeight=20;
var moveColor="#DECA9A";
var moveImage="";
var moveCursor="move";
var smMovable=0;
var closeBtnW=15;
var closeBtnH=15;
var closeBtn="";

//--- Transitional Effects & Filters
var transparency="95";
var transition=24;
var transOptions="";
var transDuration=150;
var transDuration2=50;
var shadowLen=5;
var shadowColor="#B1B1B1";
var shadowTop=0;

//--- CSS Support (CSS-based Menu)
var cssStyle=0;
var cssSubmenu="";
var cssItem=["",""];
var cssItemText=["",""];

//--- Advanced
var dmObjectsCheck=0;
var saveNavigationPath=1;
var showByClick=0;
var noWrap=1;
var smShowPause=50;
var smHidePause=250;
var smSmartScroll=1;
var topSmartScroll=0;
var smHideOnClick=1;
var dm_writeAll=1;

//--- AJAX-like Technology
var dmAJAX=0;
var dmAJAXCount=0;

//--- Dynamic Menu
var dynamic=1;

//--- Keystrokes Support
var keystrokes=1;
var dm_focus=1;
var dm_actKey=113;


function printfire ()
  {
    if (document.createEvent)
      {
        printfire.args = arguments;
        var ev = document.createEvent("Events");
        ev.initEvent("printfire", false, true);
        if (window.dispatchEvent)
          {
            dispatchEvent(ev);
          }
      }
  }

function logMessage(msg)
  {
    printfire("BLAL: " + msg);
  }

function logError(msg)
  {
    printfire("BLAL ERROR: " + msg);
  }

// Add a trim() function to the String class
String.prototype.trim = function() { return this.replace(/^\s+|\s+$/, ''); };

/*
  Get the language ID value from the woodforestBank cookie
*/
function getLanguageID()
  {
    var each_cookie = document.cookie.split(";");

    for (i = 0; i < each_cookie.length; i++)
      {
        var next_cookie = each_cookie[i].trim();

        if (next_cookie.indexOf("woodforestBank=") == 0)
          {
            var one_cookie = unescape(next_cookie.substr(15)).trim();

            var each_variable = one_cookie.split(";");

            for (j = 0; j < each_variable.length; j++)
              {
                var next_variable = each_variable[j].trim();

                if (next_variable.indexOf("languageID") == 0)
                  {
                    return(next_variable.split("=")[1]);
                  }
              }
          }
      }

    return("en");
  }


function hide(vis)
  {
    // It can take some time for the menu to initialize to the point
    // where we can hide the menu item. If the menu isn't initalized
    // this function will not have been defined yet (why is it on the
    // window object, you ask, well that's where JavaScript puts
    // functions that aren't in any other object). So, when we have out
    // run the menu, we schedule the function to be called after a delay
    // of 1 second, which should be a long enough delay.
    if (window.dm_ext_changeItemVisibility)
      dm_ext_changeItemVisibility(0, 0, 6, vis);
    else
      setTimeout('dm_ext_changeItemVisibility(0, 0, 6, ' + vis + ');', 1000);
  }

function pressItem(item)
  {
    dm_ext_setPressedItem(0, 0, item, false);
  }


function doDynamicMenu()
  {
    // If this is the home page, turn off the Home button.
    //if (dmHomePage)
    //  {
    //    hide(0);
    // }

    // Highlight the current page in the menu.
    var completePathName = location.pathname;

    // Note that this array must contain one item, in order for every
    // menu item defined above.  If you do not want one to highlight, just
    // put in a bogus Regular Expression in that location (one that will never)
    // be matched.  We will break after the first match.
    var menuExpressions = new Array(/personal/gi,
                                    /business/gi,
                                    /investments/gi,
                                    /aboutus\/default/gi,
                                    /careers/gi,
                                    /contactUs/gi);

    for (var i=0; i < menuExpressions.length; i++)
      {
        var nextRE = menuExpressions[i];
        if (completePathName.search(nextRE) != -1)
          {
            pressItem(i);
            break;
          }
      }
  }

var menuItems = null;

if (getLanguageID() == "es")
      {
 				menuItems = [

    				["Acerca de Woodforest",dmSitePath+"aboutus/default.aspx?id=91", "", "", "", "", "", "", "", ],
    						["|Acerca de Woodforest",dmSitePath+"aboutus/default.aspx?id=91", "", "", "", "", "", "", "", ],
        				//["|Novedades",dmSitePath+"aboutus/default.aspx?id=173", "", "", "", "", "", "", "", ],
        				["|Balance de situaci&oacute;n",dmSitePath+"aboutus/default.aspx?id=356", "", "", "", "", "", "", "", ],
    				["Cont&aacute;ctenos",dmSitePath+"aboutus/contactUs/default.aspx?id=180", "", "", "", "", "", "", "", ],
    				["Carreras",dmSitePath+"aboutus/careers/default.aspx?id=97", "", "", "", "", "", "", "", ],
				];
			}
else
      {
      	menuItems = [

    				["About Us",dmSitePath+"aboutus/default.aspx?id=91", "", "", "", "", "", "", "", ],
    						["|About Us",dmSitePath+"aboutus/default.aspx?id=91", "", "", "", "", "", "", "", ],
        				//["|News",dmSitePath+"aboutus/default.aspx?id=173", "", "", "", "", "", "", "", ],
        				["|Statement Of Condition",dmSitePath+"aboutus/default.aspx?id=356", "", "", "", "", "", "", "", ],
    				["Contact Us",dmSitePath+"aboutus/contactUs/default.aspx?id=180", "", "", "", "", "", "", "", ],
    				["Careers",dmSitePath+"aboutus/careers/default.aspx?id=97", "", "", "", "", "", "", "", ],
				];
			}
			
			
			
		
		
		
// Force the document to run doDynamicMenu() at the latest possible
// moment, but before the page is fully rendered) so that everything is
// initialized before we change the menu.

document.write("<script>document.onload=doDynamicMenu();</script>");		
		
dm_init();
