<!-- Hide this section of code from older browsers
/* -------------------------------------------------------
        JAVASCRIPT MENU MAKER v1.0.0
        (c)2008-  Home Office Developer
        Author:   Russell M Otto
        Date:     01 January 2008
   ------------------------------------------------------- */
var INLINE=0;                // Standard (default) horizontal menu style
var LEGEND=1;                // Alternative vertical menu style
var inDiv=0;
var inMenu=0;
var aTextStr='';             // String to store document innerHTML code
var tHeight=15;              // Default minimum menu item height
var mnuStyle=INLINE;         // Menu style to be used - modified by structure parameter in constructor
var mnuStruc=new Array();    // Associative array (hash table) to store menu name with menu level values
var timer=null;

/* Use a timer to close menu if menu after 1 second if no longer active */
function close_menu() {
  if (inMenu==0) {
    if (timer!=null) { window.clearTimeout(timer); }
    timer=null;
    menuShowHide(null);
  }
  else { timer=window.setTimeout("close_menu()", 1000); }
  inMenu=0;
}
/* Set the menu state to reflect 'active' or 'hidden' */
function open_menu(menu_state) {
  inMenu=menu_state;
  if (timer!=null) { window.clearTimeout(timer); timer=null; }
}
function start_inline_menubar(pageOffset) {
  aTextStr='';
  aTextStr+='<table class="block" style="background-color: white; width:100%; border:0px; padding:0px">';
  aTextStr+='<tr><td class="main_menu" style="text-align:'+pageOffset.toLowerCase()+';height:'+tHeight+'px" ';
  aTextStr+='onmouseover="javascript:open_menu(1)" onmouseout="javascript:close_menu()">';
}
function end_inline_menubar() {
  aTextStr+='<\/td><\/tr><\/table>';
}
function start_inline_menu(pageOffset) {
  aTextStr+='<table align="'+pageOffset.toLowerCase()+'" style="border:0px; padding:0px"><tr>';
}
function end_inline_menu() {
  aTextStr+='<\/tr><\/table>';
}
function draw_inline_caption(mnuName, itmLink) {
  mnuStruc[mnuName.toLowerCase()]=mnuStyle;
  aTextStr+='<td style="text-align: center; height: '+tHeight+'px; color: white; padding: 0px; padding-left: 4px; padding-right: 10px">';
  aTextStr+='<div id="'+mnuName.toLowerCase()+'" style="text-align: left"><a href="'+itmLink+'" ';
  if (itmLink!='javascript://') {
    aTextStr+='onmouseover="javascript:close_menu()">';
  }
  else {
    aTextStr+='onclick="javascript:menuShowHide(null)" onmouseover="javascript:menuShowHide(\''+mnuName.toLowerCase()+'\', true)">';
  }
  aTextStr+=mnuName+'<\/a><\/div><\/td>';
}
function start_legend_menubar(pageOffset) {
  aTextStr='';
  aTextStr+='<table style="width:100% border:0px; padding:0px" ';
  aTextStr+='onmouseover="javascript:open_menu(1)" onmouseout="javascript:close_menu()">';
  aTextStr+='<tr><td>';
}
function end_legend_menubar() {
  aTextStr+='<\/td><\/tr><\/table>';
}
function start_legend_menu(pageOffset) {
  aTextStr+='<table cellpadding="0" cellspacing="0" align="'+pageOffset.toLowerCase()+'" style="border: 0px; margin: 0px; padding: 0px">';
}
function end_legend_menu() {
  aTextStr+='<\/table>';
}
function draw_legend_caption(mnuName, itmLink) {
  mnuStruc[mnuName.toLowerCase()]=mnuStyle;
  aTextStr+='<tr><td class="main_menu" style="text-align:center; height: '+tHeight+'px; color: white; padding: 0px; padding-left: 10px; padding-right: 10px" ';
  if (itmLink!='javascript://') {
    aTextStr+='onmouseover="javascript:menuShowHide(null)">';
  }
  else {
    aTextStr+='onclick="javascript:menuShowHide(null)" onmouseout="javascript:close_menu()" onmouseover="javascript:menuShowHide(\''+mnuName.toLowerCase()+'\', true)">';
  }
  aTextStr+='<div id="'+mnuName.toLowerCase()+'" style="text-align: left"><a href="'+itmLink+'">';
  aTextStr+=mnuName+'<\/a><\/div><\/td><\/tr>';
}
function start_submenu(divId) {
  if (inDiv) return;
  inDiv=1;
  if (document.layers) {
    aTextStr+='<layer id="'+divId+ '_m" z-index="100" width="250" padding="0" visibility="hidden">';
  }
  else {
    aTextStr+='<div id="'+divId+ '_m" style="z-index:100; width:250px; position:absolute; padding:0px; visibility:hidden">';
  }
  aTextStr+='<table cellpadding="0" cellspacing="0" style="margin: 0px" ';
  aTextStr+='onmouseover="javascript:menuShowHide(\''+divId+'\', true)" onmouseout="javascript:close_menu()">';
}
function draw_submenu_caption(divItem, itmLink) {
  aTextStr+='<tr><td class="submenu" style="height: '+tHeight+'px; padding: 4px; padding-left: 10px; padding-right: 10px; whitespace:nowrap">';
  aTextStr+='<a href="' + itmLink + '" onclick="javascript:menuShowHide(null)" onmouseout="javascript:close_menu()">'+divItem+'<\/a><\/td><\/tr>';
}
function end_submenu() {
  if (!inDiv) return;
  inDiv=0;
  aTextStr+='<\/table>';
  if (document.layers) { aTextStr+='<\/layer>'; }
  else { aTextStr+='<\/div>'; }
}
/* -------------------------------------------------------

        MENU MAKER CONSTRUCTOR CODE SECTION

   ------------------------------------------------------- */
function createMenu(menu_ary, tpl_ary) {
 var aItem=null;
 var aStr=new Array();

 /* Copy the menu structure into a temporary string array */
 tAlign=tpl_ary[0]['alignment'];
 tHeight=tpl_ary[0]['height'];
 tStyle=tpl_ary[0]['lstyle'];

 mnuStyle=(tStyle=='inline') ? INLINE : LEGEND;

 switch (mnuStyle) {
 case INLINE: start_inline_menubar(tAlign); break;
 default: start_legend_menubar(tAlign); break;
 }

 /* Copy the menu structure into a temporary string array */
 for (var i=0; i<menu_ary.length; i++) {
   aStr[i]=menu_ary[i].toString();
 }

 /* Open the menu table */
 switch (mnuStyle) {
 case INLINE: start_inline_menu(tAlign); break;
 default: start_legend_menu(tAlign); break;
 }

 /* Write all the 'Main Menu' captions */
 for (var i=0; i<aStr.length; i++) {
   var commaPos=aStr[i].indexOf(",");
   aCaption=aStr[i].substr(0, commaPos);

   aLinkStr=aStr[i].substr(commaPos+1, aStr[i].length);

   /* Is there a link coming up... */
   linkPos=aLinkStr.indexOf(",");
   if (linkPos > 0) {
     aLink=aLinkStr.substr(0, linkPos);
     commaPos=linkPos; }
   else {
     if ((linkPos == -1) && (aLinkStr.length > 0)) {
       aLink=aLinkStr;
       commaPos=aLinkStr.length; }
     else { aLink="javascript://"; }}

   switch (mnuStyle) {
   case INLINE: draw_inline_caption(aCaption, aLink); break;
   default: draw_legend_caption(aCaption, aLink); break;
   }
 }

 /* Close the menu table */
 switch (mnuStyle) {
 case INLINE: end_inline_menu(); break;
 default: end_legend_menu(); break;
 }

 /* Write all the 'Sub-Menus' for each 'Main Menu' item */
 for (var i=0; i<aStr.length; i++) {

   aItemStr=aStr[i];

   commaPos=aItemStr.indexOf(",");
   aCaption=aItemStr.substr(0, commaPos);


   do {
     /* Remove the 'Caption' section from the string variable */
     aItemStr=aItemStr.substr(commaPos+1, aItemStr.length);

     /* Is there a submenu coming up... */
     commaPos=aItemStr.indexOf(",");
     if (aItemStr!="") {
       if (commaPos!=-1) {
         aItem=aItemStr.substr(0, commaPos);
         if (aItem!="") {
           aLinkStr=aItemStr.substr(commaPos+1, aItemStr.length);

           /* Is there a link coming up... */
           linkPos=aLinkStr.indexOf(",");
           if (linkPos > 0) {
             aItemStr=aItemStr.substr(commaPos+1, aItemStr.length);
             aLink=aLinkStr.substr(0, linkPos);
             commaPos=linkPos;
           }
           else {
             if ((linkPos == -1) && (aLinkStr.length > 0)) {
               aLink=aLinkStr;
               commaPos=aLinkStr.length;
             }
             else {
                 aLink="javascript://";
               }
           }
           start_submenu(aCaption.toLowerCase());
           draw_submenu_caption(aItem, aLink);
         }
       }
     }
   } while(commaPos!=-1);
   end_submenu();
 }

 switch (mnuStyle) {
 case INLINE: end_inline_menubar(); break;
 default: end_legend_menubar(); break;
 }

 /* Write the entire section of HTML out to the document */
 document.writeln(aTextStr);
}

/* -------------------------------------------------------

        MENU MAKER DISPLAY / HIDE CODE SECTION

   ------------------------------------------------------- */
var curr_menu = null;
var last_menu = null;

function menuShowHide(m, viz) {
var x_ofs = 0, y_ofs = 0;

    if (m != null) {

      /* Get the document element and assign it to a temporary variable */
      p = d = document.getElementById(m);

      /* Use the temporary variable to recursive through all preceding
         elements to sum all the preceding offsets - Left and Top */
      while(p != document.body) {
        x_ofs += p.offsetLeft;
        y_ofs += p.offsetTop;
        p = p.offsetParent;
      }

      /* Determine the current menu dimensions and set its location values */
      H = d.offsetHeight;
      curr_menu=document.getElementById(m+'_m');
      dd_menu_width=curr_menu.offsetWidth;
      if (document.all) { W=dd_menu_width; }
      else { W = this.offsetWidth; }

      X = x_ofs + d.offsetLeft;
      Y = y_ofs + d.offsetTop;

      /* Determine if menu is inline or list using stored string of menu styles */
      switch (parseInt(mnuStruc[m])) {
      case INLINE: break;
      default: X += (d.offsetWidth + 15); Y -= (d.offsetHeight + 3); break;
      }

      /* Adjust the top value according to the user's browser type */
      Z = (document.all) ? 4 : 2;

      /* Adjust menu right-hand edge to keep within client area */
      win_width=(document.all) ? document.body.clientWidth : window.innerWidth;
      overRun=win_width-(X + dd_menu_width);
      if (overRun<0) { X+=overRun; }

    }

    /* Hide any currently displayed menu */
    if (last_menu != null) { last_menu.style.visibility="hidden"; }

    /* Show the currently selected menu */
    if ((viz) && (m != null)) {
      with (curr_menu.style) {
        top = Y + H + Z;
        left = X - 20;
        width = W;
        visibility = "visible";
      }
    }

    /* Set the value for the most recently displayed menu */
    last_menu=curr_menu;
}

function getScrollXY() {
  var scrOfX = 0, scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }
  return [ scrOfX, scrOfY ];
}// -->