/* author: jos.berkemeijer@planet.nl , Generated by AceHTML Freeware http://freeware.acehtml.com , Creation date: 05-14-2004 */
//<![CDATA[
// Version : activation on : onmouseover & onclick ; horizontal & vertical menu's tested in ie-6+ and netscape-7.1
// Do not remove this notice.  Copyright 2000-2004 by Mike Hall. See http://www.brainjar.com for terms of use.

//----------------------------------------------------------------------------
// Code to determine the browser and version.
//----------------------------------------------------------------------------

function Browser() {

  var ua, s, i;

  this.isIE    = false;  // Internet Explorer
  this.isOP    = false;  // Opera
  this.isNS    = false;  // Netscape
  this.version = null;

  ua = navigator.userAgent;

  s = "Opera";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isOP = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }

  s = "Netscape6/";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }

  // Treat any other "Gecko" browser as Netscape 6.1.

  s = "Gecko";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = 6.1;
    return;
  }

  s = "MSIE";
  if ((i = ua.indexOf(s))) {
    this.isIE = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }
  
}

var browser = new Browser();

//----------------------------------------------------------------------------
// Code for handling the menu bar and active button.
//----------------------------------------------------------------------------

var activeButton = null;

function buttonClick(event, menuId) {

  var button;

  // Get the target button element.

  if (browser.isIE)
    button = window.event.srcElement;
  else
    button = event.currentTarget;

  // Blur focus from the link to remove that annoying outline.

  button.blur();

  // Associate the named menu to this button if not already done.
  // Additionally, initialize menu display.

  if (button.menu == null) {
    button.menu = document.getElementById(menuId);
    if (button.menu.isInitialized == null)
      menuInit(button.menu);
  }

  // [MODIFIED] Added for activate/deactivate on mouseover.

  // Set mouseout event handler for the button, if not already done.

  if (button.onmouseout == null)
    button.onmouseout = buttonOrMenuMouseout;

  // Exit if this button is the currently active one.

  if (button == activeButton)
    return false;

  // [END MODIFIED]

  // Reset the currently active button, if any.

  if (activeButton != null)
    resetButton(activeButton);

  // Activate this button, unless it was the currently active one.

  if (button != activeButton) {
    depressButton(button);
    activeButton = button;
  }
  else
    activeButton = null;

  return false;
}

function buttonMouseover(event, menuId) {

  var button;

  // [MODIFIED] Added for activate/deactivate on mouseover.

  // Activates this button's menu if no other is currently active.

  if (activeButton == null) {
    buttonClick(event, menuId);
    return;
  }

  // [END MODIFIED]

  // Find the target button element.

  if (browser.isIE)
    button = window.event.srcElement;
  else
    button = event.currentTarget;

  // If any other button menu is active, make this one active instead.

  if (activeButton != null && activeButton != button)
    buttonClick(event, menuId);
}

function depressButton(button) {

  var x, y;

  // Update the button's style class to make it look like it's
  // depressed.

  button.className += " menuButtonActive";

  // [MODIFIED] Added for activate/deactivate on mouseover.

  // Set mouseout event handler for the button, if not already done.

  if (button.onmouseout == null)
    button.onmouseout = buttonOrMenuMouseout;
  if (button.menu.onmouseout == null)
    button.menu.onmouseout = buttonOrMenuMouseout;

  // [END MODIFIED]

  // [MODIFIED @JNB 2004-04-17 ] submenuposition right or under menubutton depending
  // on horizontal or vertical menu. Global vaiable : jbmenu_pos:
  // v = vertical menu & positioning submenu right from menubutton
  // h = horizontal menu & positioning submenu under menubutton
  
  // Position the associated drop down menu under the button and
  // show it.

  x = getPageOffsetLeft(button)+(jbmenu_pos=="v")*(button.offsetWidth-1);
  y = getPageOffsetTop(button) +(jbmenu_pos=="h")*(button.offsetHeight-1);
  
  // [END MODIFIED @JNB 2004-04-17 ] 
  
  // For IE, adjust position.

  if (browser.isIE) {
    x += button.offsetParent.clientLeft;
    y += button.offsetParent.clientTop;
  }

  button.menu.style.left = x + "px";
  button.menu.style.top  = y + "px";
  button.menu.style.visibility = "visible";   
}

function resetButton(button) {

  // Restore the button's style class.

  removeClassName(button, "menuButtonActive");

  // Hide the button's menu, first closing any sub menus.

  if (button.menu != null) {
    closeSubMenu(button.menu);
    button.menu.style.visibility = "hidden";
  }
}

//----------------------------------------------------------------------------
// Code to handle the menus and sub menus.
//----------------------------------------------------------------------------

function menuMouseover(event) {

  var menu;

  // Find the target menu element.

  if (browser.isIE)
    menu = getContainerWith(window.event.srcElement, "DIV", "menu");
  else
    menu = event.currentTarget;

  // Close any active sub menu.

  if (menu.activeItem != null)
    closeSubMenu(menu);
}

function menuItemMouseover(event, menuId) {

  var item, menu, x, y;

  // Find the target item element and its parent menu element.

  if (browser.isIE)
    item = getContainerWith(window.event.srcElement, "A", "menuItem");
  else
    item = event.currentTarget;
  menu = getContainerWith(item, "DIV", "menu");


  // Close any active sub menu and mark this one as active.

  if (menu.activeItem != null)
    closeSubMenu(menu);
  menu.activeItem = item;

  // Highlight the item element.

  item.className += " menuItemHighlight";
 
  // Initialize the sub menu, if not already done.

  if (item.subMenu == null) {
    item.subMenu = document.getElementById(menuId);
    if (item.subMenu.isInitialized == null)
      menuInit(item.subMenu);
  }
// [MODIFIED @JNB 2004-04-28 ] new  menu's always 'on top'  (don't remove double coded !)
 menuhz(item.subMenu.style.zIndex)
 item.subMenu.style.zIndex=menuhzindex+5
 menuhz(item.subMenu.style.zIndex)
 item.subMenu.style.zIndex=menuhzindex+5
// [END MODIFIED @JNB 2004-04-28 ] 
  
  
  // [MODIFIED] Added for activate/deactivate on mouseover.

  // Set mouseout event handler for the sub menu, if not already done.

  if (item.subMenu.onmouseout == null)
    item.subMenu.onmouseout = buttonOrMenuMouseout;

  // [END MODIFIED]

  // Get position for submenu based on the menu item.

  x = getPageOffsetLeft(item) + item.offsetWidth;
  y = getPageOffsetTop(item);

  // Adjust position to fit in view.

  var maxX, maxY;

  if (browser.isIE) {
    maxX = Math.max(document.documentElement.scrollLeft, document.body.scrollLeft) +
      (document.documentElement.clientWidth != 0 ? document.documentElement.clientWidth : document.body.clientWidth);
    maxY = Math.max(document.documentElement.scrollTop, document.body.scrollTop) +
      (document.documentElement.clientHeight != 0 ? document.documentElement.clientHeight : document.body.clientHeight);
  }
  if (browser.isOP) {
    maxX = document.documentElement.scrollLeft + window.innerWidth;
    maxY = document.documentElement.scrollTop  + window.innerHeight;
  }
  if (browser.isNS) {
    maxX = window.scrollX + window.innerWidth;
    maxY = window.scrollY + window.innerHeight;
  }
  maxX -= item.subMenu.offsetWidth;
  maxY -= item.subMenu.offsetHeight;

  if (x > maxX)
    x = Math.max(0, x - item.offsetWidth - item.subMenu.offsetWidth
      + (menu.offsetWidth - item.offsetWidth));
  y = Math.max(0, Math.min(y, maxY));

  // Position and show the sub menu.

  item.subMenu.style.left = x + "px";
  item.subMenu.style.top  = y + "px";
  item.subMenu.style.visibility = "visible";

  // Stop the event from bubbling.

  if (browser.isIE)
    window.event.cancelBubble = true;
  else
    event.stopPropagation();
}

function closeSubMenu(menu) {

  if (menu == null || menu.activeItem == null)
    return;

  // Recursively close any sub menus.

  if (menu.activeItem.subMenu != null) {
    closeSubMenu(menu.activeItem.subMenu);
    menu.activeItem.subMenu.style.visibility = "hidden";
    menu.activeItem.subMenu = null;
  }
  removeClassName(menu.activeItem, "menuItemHighlight");
  menu.activeItem = null;
}

// [MODIFIED] Added for activate/deactivate on mouseover. Handler for mouseout
// event on buttons and menus.

function buttonOrMenuMouseout(event) {

  var el;


  // If there is no active button, exit.
 
  if (activeButton == null)
    return;

  // Find the element the mouse is moving to.

  if (browser.isIE)
    el = window.event.toElement;
  else if (event.relatedTarget != null)
      el = (event.relatedTarget.tagName ? event.relatedTarget : event.relatedTarget.parentNode);

  // If the element is not part of a menu, reset the active button.

  if (getContainerWith(el, "DIV", "menu") == null) {
    resetButton(activeButton);
    activeButton = null;
  }
}

// [END MODIFIED]

//----------------------------------------------------------------------------
// Code to initialize menus.
//----------------------------------------------------------------------------

function menuInit(menu) {

  var itemList, spanList;
  var textEl, arrowEl;
  var itemWidth;
  var w, dw;
  var i, j;

  // For IE, replace arrow characters.

  if (browser.isIE) {
    menu.style.lineHeight = "2.5ex";
    spanList = menu.getElementsByTagName("SPAN");
    for (i = 0; i < spanList.length; i++)
      if (hasClassName(spanList[i], "menuItemArrow")) {
        spanList[i].style.fontFamily = "Webdings";
        spanList[i].firstChild.nodeValue = "4";
      }
  }

  // Find the width of a menu item.

  itemList = menu.getElementsByTagName("A");
  if (itemList.length > 0)
    itemWidth = itemList[0].offsetWidth;
  else
    return;

	
	
  // For items with arrows, add padding to item text to make the
  // arrows flush right.

  for (i = 0; i < itemList.length; i++) {
    spanList = itemList[i].getElementsByTagName("SPAN");
    textEl  = null;
    arrowEl = null;
    for (j = 0; j < spanList.length; j++) {
      if (hasClassName(spanList[j], "menuItemText"))
        textEl = spanList[j];
      if (hasClassName(spanList[j], "menuItemArrow"))
        arrowEl = spanList[j];
    }
    if (textEl != null && arrowEl != null) {
      textEl.style.paddingRight = (itemWidth 
        - (textEl.offsetWidth + arrowEl.offsetWidth)) + "px";
      // For Opera & Netscape , remove the negative right margin to fix a display bug.
      if (browser.isOP | browser.isNS)
        arrowEl.style.marginRight = "0px";
    }
  }

// [MODIFIED @JNB 2004-04-28 ] to be able to set negative margins
   // Fix IE hover problem by setting an explicit width on first item of
  // the menu.
  
if (browser.isIE) {var maxw=0;
 for (var i=0; i<itemList.length; i++){ maxw=Math.max(maxw,itemList[i].offsetWidth); }
 for (var i=0; i<itemList.length; i++){ itemList[i].style.width = maxw+"px"; }
 }
// [END MODIFIED @JNB 2004-04-28 ] 	

  // Mark menu as initialized.

  menu.isInitialized = true;
}

//----------------------------------------------------------------------------
// General utility functions.
//----------------------------------------------------------------------------

function getContainerWith(node, tagName, className) {

  // Starting with the given node, find the nearest containing element
  // with the specified tag name and style class.

  while (node != null) {
    if (node.tagName != null && node.tagName == tagName &&
        hasClassName(node, className))
      return node;
    node = node.parentNode;
  }

  return node;
}

function hasClassName(el, name) {

  var i, list;

  // Return true if the given element currently has the given class
  // name.

  list = el.className.split(" ");
  for (i = 0; i < list.length; i++)
    if (list[i] == name)
      return true;

  return false;
}

function removeClassName(el, name) {

  var i, curList, newList;

  if (el.className == null)
    return;

  // Remove the given class name from the element's className property.

  newList = new Array();
  curList = el.className.split(" ");
  for (i = 0; i < curList.length; i++)
    if (curList[i] != name)
      newList.push(curList[i]);
  el.className = newList.join(" ");
}

function getPageOffsetLeft(el) {

  var x;

  // Return the x coordinate of an element relative to the page.

  x = el.offsetLeft;
  if (el.offsetParent != null)
    x += getPageOffsetLeft(el.offsetParent);

  return x;
}

function getPageOffsetTop(el) {

  var y;

  // Return the x coordinate of an element relative to the page.

  y = el.offsetTop;
  if (el.offsetParent != null)
    y += getPageOffsetTop(el.offsetParent);

  return y;
}

// [MODIFIED @JNB 2004-04-22 ] 
// Write initial stylesheet voor JBMENU functions including horizontal & vertical menu's and optional activation on "click" & "onmouseover" 
var menu_inss='<style type="text/css" > div.vertmenu * a.menuButton {white-space: nowrap;display:block}'
menu_inss+='div.menu{position: absolute; visibility: hidden;top:0px;z-index: 101;filter: progid:DXImageTransform.Microsoft.Shadow(direction=135,color=#808080,strength=3);}' 
menu_inss+='</style>'
document.write (menu_inss)

// [END MODIFIED @JNB 2004-04-22 ] 


//]]>

//[[[ JBMENU functions added by J.N. Berkemeijer @JNB 2004-04-22 

// User functions

function menuCreate(Mname,Morientation,Mms){
// Mname = any valid & unique menu name
// Morientation : "h" = horizontal , "v" = vertical
// Mms : "sub" = submenu ; "main" = mainmenu

// General settings ! (don't change this unless ykwyd)
 // General initial fontsize for main & sub menu's
menu_gfs='font-size: 8pt;'
 // General initial padding & Shadow-Filter main menu's
menu_gps='padding: 4px 2px 4px 2px;filter: progid:DXImageTransform.Microsoft.Shadow(direction=135,color=#808080,strength=3);'
 // General initial buttonsetting
menu_gbs='text-align: left;top: 0px;z-index: 100;cursor: default;position: relative; text-decoration: none; background-color: transparent;left: 0px;'
menu_gbs+='margin: 0px 0px 0px 1px;padding: 2px 2px 2px 6px;'
 // General initial Itemsetting
menu_gis='cursor: default; text-decoration: none;display: block;text-decoration: none;white-space: nowrap;color:#FF3300;padding: 3px 1em;'
 // General hoverstyle
menu_ghs='color: #FFFFFF;background-color: #4B0082;'

//Initial settings
menu_rules=new Array;menu_rulenr=0;jbmenu_pos="h";menuButtonMaxWidth=0;
menu_name=Mname; menuhzindex=1000;
menu_ms=Mms;menuccc=0;menuddd=0
// stylesheet i.c. main menu
var ms='#'+Mname+'style';
// stylesheet i.c. sub menu
var ss='#'+Mname;
menu_sq=(menu_ms!='sub')
//Fill  menu content
if (Morientation=='v'){menuhv='vertmenu';} else{menuhv='hormenu';};
if (menu_sq){cins='<div class="'+menuhv+'" id="'+Mname+'" style="position:absolute;visibility:hidden;"  onmousemove="jbmenu_pos=\''+Morientation+'\';"><div class="menuBar" id="'+Mname+'style"  onmousemove="jbmenu_pos=\''+Morientation+'\';">'}
else {cins='<div class="menu" id="'+Mname+'"  onmouseover="menuMouseover(event)">';} 
menu_content =cins;

//shorthand stylesheet slectorgroups i.c. main menu
// main menu style sec
menu_idstyle=ms;
// general text style for main menu & submenu's
menu_gntxtstyle=ms+', '+ms+' a.menuButton, '+ms+' a.menuButton div.menu, '+ms+' a.menuButton div.menu a.menuItem' ;
menu_gntxtstylec='{';
// specific barstyle for each main menu bar sec (no text)
menu_barstyle=ms;
menu_barstylec='{'+menu_gfs+menu_gps;
// specific style for buttons sec in de main menu 
menu_butstyle=ms+' a.menuButton';
menu_butstylec='{'+menu_gbs;
// color, bgcolor,border for &hover/active settings for menu & buttons
menu_colhstyle=ms+' a.menuButtonActive, '+ms+' a.menuButtonActive:hover';
menu_colhstylec='{';
// color, bgcolor,border for hover/active settings for menu-items
menu_itcolhstyle=ms+' * a.menuItem:hover , '+ms+' * a.menuItemHighlight';
menu_itcolhstylec='{';
// color, bgcolor,border for non-hover/active settings for menu-items
menu_itcolnstyle=ms+' * div.menu, '+ms+' *  div.menu a.menuItem';
menu_itcolnstylec='{';

//shorthand stylesheet slectorgroups i.c. specific submenu
// normal submenu style i.c. outside border etc.
menu_substyle=ss;
menu_substylec='{'+menu_gfs;
// submenu normal inside style menuItems
menu_subnstyle=ss+' a';
menu_subnstylec='{'+menu_gis;
// submenu hover/active style menuItems
menu_subostyle=ss+'  a.menuItem:hover,'+ss+'  a.menuItemHighlight';
menu_subostylec='{'+menu_ghs;
};


function menuTextStyle(Msize,Mweight,Mfamily){;
// Msize= font size; ex. 12pt
// Mweight = font weight; ex. normal, bold, etc.
// Mfamily = font family ; ex. Verdana, Arial, ...
var mw="" , mf="";
if (Mfamily!=undefined){mf=';font-family:'+Mfamily+';'};
if (Mweight!=undefined){mw=';font-weight:'+Mweight+';'};
var st='font-size:'+Msize+';'+mw+mf;
if (menu_ms!='sub'){menu_gntxtstylec+=st}
else{menu_subnstylec+=st;menu_substylec+=st;}
};

function menuColor(Mcolor,McolorOMO,Mbgcolor,MbgcolorOMO){;
// Mcolor :menu textcolor
// McolorMO :menu textcolor On Mouse Over
// Mbgcolor :menu backgroundcolor
// MbgcolorMO :menu backgroundcolor On Mouse Over
var cn='color:'+Mcolor+'; background-color:'+Mbgcolor+';' ;
var co='color:'+McolorOMO+'; background-color:'+MbgcolorOMO+';' ;
if (menu_sq){menu_gntxtstylec+=cn;menu_colhstylec+=co;} 
else{menu_subnstylec+=cn;menu_substylec+=cn;menu_subostylec+=co;} 
};

function menuWidth(Mwidth){;
// Mwidth :menu width; ex. 22em, 100px, 30%, etc.
// only main bar width will be specified; other width's are automatically set
menu_width=Mwidth; menu_gntxtstylec+='width:'+Mwidth+';' ;
};

function menuWidthIE(Mwidth){;
// Mwidth :menu width; ex. 22em, 100px, 30%, etc.
// only main bar width will be specified; other width's are automatically set
if (document.all){menu_width=Mwidth; menu_gntxtstylec+='width:'+Mwidth+';' ;}
};



function menuBarWidth(Mwidth){;
// Mwidth :menu Bar width 
// in incidental cases overwrite Bar-width
menuButtonMaxWidth=parseFloat(Mwidth)
};




function menuGeneralStyle(Mstyle){;
// Mstyle :standard css style; ex. "padding: 0px;" , etc
if (menu_ms!='sub'){ menu_gntxtstylec+=Mstyle+';'}
else {menu_substylec+=Mstyle;}
};

function menuOnMousOverStyle(Mstyle){;
// Mstyle :standard css style; ex. "padding: 0px;" , etc
if (menu_ms!='sub'){menu_colhstylec+=Mstyle+';'}
else {menu_subostylec+=Mstyle;};
};

function menuBarStyle(Mstyle){;
// Mstyle :standard css style; ex. "padding: 0px;" , etc
if (menu_ms!='sub'){menu_barstylec+=Mstyle+';'}
else {menu_substylec+=Mstyle;};
};

function menuButtonStyle(Mstyle){;
// Mstyle :standard css style; ex. "padding: 0px;" , etc
menu_butstylec+=Mstyle+';';
};

function menuItemStyle(Mstyle){;
// Mstyle :standard css style; ex. "padding: 0px;" , etc
menu_subnstylec+=Mstyle+';';
};

function menuAddButton(Msubname,Mcontent){;
// Msubname = Submenu name ; Case No submenu : Msubname="none"
// Mcontent : any (!) HTML /CSS content
var ins=""; if (Msubname!="none"){;
ins=' onclick="return buttonClick(event, \''+Msubname+'\');" onmouseover="buttonMouseover(event, \''+Msubname+'\');" ';
};
menu_content+='<a class="menuButton"  '+ins+'>'+Mcontent+'</a>';
menuButtonMaxWidth=Math.max(menuButtonMaxWidth,Mcontent.length);
};

function menuAddButtonClick(Msubname,Mcontent){;
// Msubname = Submenu name ; Case No submenu : Msubname="none"
// Mcontent : any (!) HTML /CSS content
var ins=""; if (Msubname!="none"){;
ins=' onclick="return buttonClick(event, \''+Msubname+'\');"  ';
};
menu_content+='<a class="menuButton"  '+ins+' title="Please click" >'+Mcontent+'</a>';
menuButtonMaxWidth=Math.max(menuButtonMaxWidth,Mcontent.length);
};

function menuAddItem(Msubname,Mcontent){;
// Msubname = Submenu name ; Case No submenu : Msubname="none"
// Mcontent : any (!) HTML /CSS content
var ins;if (Msubname!="none"){Mcontent+="&#160;";
ins='<a class="menuItem"  href="" onclick="return false;" onmouseover="menuItemMouseover(event, \''+Msubname+'\');" >';
ins+='<span class="menuItemText" >'+Mcontent+'</span><span class="menuItemArrow">&#9654;</span></a>';
menu_content+=ins;
}
else{menu_content+='<a class="menuItem"  href="" onclick="return false;" >'+Mcontent+'</a>';
};
};

function menuAddItemClick(Msubname,Mcontent){;
// Msubname = Submenu name ; Case No submenu : Msubname="none"
// Mcontent : any (!) HTML /CSS content
var ins;if (Msubname!="none"){Mcontent+="&#160;";
ins='<a class="menuItem"  href=""   onmouseover="if  (menuccc==1 & (\'hidden\'==document.getElementById(\''+Msubname+'\').style.visibility)){menuccc=0;};if (menuccc==1 ){menuItemMouseover(event, \''+Msubname+'\')};return false" onclick="menuccc=0;menuItemMouseover(event, \''+Msubname+'\');return false" onmouseout="if (menuccc==1 ){menuItemMouseover(event, \''+Msubname+'\')};return false" >';
ins+='<span class="menuItemText" >'+Mcontent+'</span><span class="menuItemArrow" onmouseover="menuccc=1;menuItemMouseover(event, \''+Msubname+'\')" onmouseout="menuccc=0">&#9654;</span></a>';
menu_content+=ins;
}
else{menu_content+='<a class="menuItem"  href="" onclick="return false;">'+Mcontent+'</a>';
};
};


function menuAddLinkItem(Mcontent,Mlink,Mtitle){;
// Msubname = Submenu name ; 
// Mcontent : any (!) HTML /CSS content
//Mlink= url of the link
// Mtitle = [optional]  information on mouse over
var tit; if (Mtitle==undefined) { tit='' } else { tit='TITLE="'+Mtitle+'" ' };
var ins='<a class="menuItem"  href='+Mlink+'><span onclick="window.location=\''+Mlink+'\';return false;" ';
ins+='onmouseover="this.style.cursor=\'hand\';"  '+tit+' >'+Mcontent+'</span></a>';
menu_content+=ins;
};

function menuAddSeparator(Mstyle,Msigns){;
// add seperator with optional style: Mstyle
if (Mstyle==undefined) {Mstyle='border: 1px inset #FFFFFF; margin: 1px 2px;'};
menu_content+='<div style="'+Mstyle+'"></div>';
};

function menuAddAnything(Manything){;
// add anything ; No highlight supported
menu_content+=Manything;
};

function menuEnd(){;
// Close & finisch variables & stylesheets
menu_content+='</div>';
if (menu_ms!="sub"){menu_content+='</div>'};

//  Set menuwidth on max i.c. vertical main menu 
if ((menuhv=="vertmenu") & (menu_ms!="sub") & document.all ){menu_barstylec+='width:'+menuButtonMaxWidth+'em ;' };

menu_gntxtstylec+="}";menu_barstylec+="}";menu_butstylec+="}";
menu_colhstylec+="}";menu_itcolhstylec+="}";menu_itcolnstylec+="}";
menu_substylec+="}";menu_subostylec+="}";menu_subnstylec+="}";

// make & write menu stylesheets
 // main menu
sts='<style>'+menu_gntxtstyle+menu_gntxtstylec;
sts+=menu_barstyle+menu_barstylec;
sts+=menu_butstyle+menu_butstylec;
sts+=menu_colhstyle+menu_colhstylec;
sts+=menu_itcolhstyle+menu_itcolhstylec;
sts+=menu_itcolnstyle+menu_itcolnstylec;
sts+='</style>';
if (menu_ms!="sub"){document.write(sts)};

 //sub menu
sts='<style>'+menu_substyle+menu_substylec;
sts+=menu_subostyle+menu_subostylec;
sts+=menu_subnstyle+menu_subnstylec;
sts+='</style>';
if (menu_ms=="sub"){document.write(sts)};

// write main menu to screen 
document.write(menu_content);
};

function menuShow(Mname){;
// Show the menu ; relative positioned menu
// Mname = name of the menu
// Trick for Netscape to display menu over iframe or other element
if (null==document.all){document.write('<div id="netscapefake" style="position:fixed;left:0px;top:127px;width:1006px;height:2000px;" align="left" valign="top" onmouseover="netscapefaker(\'hidden\')"></div>')}

var docs=document.getElementById(Mname);
var vv=docs.className;
if (vv=="hormenu"){ww="h"}else{ww="v"};
var wr='<span style="position:absolute" onmousemove="jbmenu_pos=\''+ww+'\';" onmouseout="netscapefaker(\'visible\')" onmouseover="jbmenu_pos=\''+ww+'\';"><div class="'+docs.className+'" id="'+Mname+'" onmouseover="jbmenu_pos=\''+ww+'\';" >'+docs.innerHTML+'</div></span>';
document.writeln (wr) ;
}

function menuShowr(Mname,Mwidth){ ;
// Show the menu ; relative positioned menu
// Mname = name of the menu
// Mwidth = width )
menuShow(Mname);
document.write ('<span style="margin-left:'+Mwidth+'"></span>');
};

function menuShowa(Mname,Mleft,Mtop){;
// Show the menu ; absolute positioned menu
// Mname = name of the menu
// Mleft, Mtop = nr of pixels from the left,top (use plain numbers, do not use "px" !)
var docs=document.getElementById(Mname);vv=docs.className;
var wr="<div style='position:absolute;left:"+Mleft+"px ;top:"+Mtop+"px ;' ><scr"+"ipt>menuShow('"+Mname+"')</script></div>";
document.write (wr) ;
};

function netscapefaker(hv){;
// fakes background in Gecko/Netscape browsers to prevent the menu from cutoff onmouseover by other elements
if (null==document.all){document.getElementById("netscapefake").style.visibility=hv};
};


function menuhz(varz){;
//  set max  zIndex
menuhzindex=Math.max(menuhzindex,varz);
};

function menuArrowmargin(corr){;
// Correction "corr" of the arrowposition i.c. of submenu's ; Example: menuArrowmargin("-5px") 
document.write("<style>div.menu a.menuItem span.menuItemArrow{margin-right: "+corr+";} </style>");
};

function menuShadow(Fstrength,Fcolor,Fdirection){;
// Create or delete Shadow (only ie) Example: menuShadow(8,"blue",135)
if (Fdirection==undefined){Fdirection="135"; if (Fcolor==undefined){Fcolor="#808080";if (Fstrength==undefined){Fstrength="0"}}};
menuBarStyle("filter: progid:DXImageTransform.Microsoft.Shadow(direction="+Fdirection+",color="+Fcolor+",strength="+Fstrength+");");
};

// Different standard menustyles

function menuPreStyle(Sname){
// Define predefined styles with stylenames Sname
	if (Sname=="swpcrc"){;
		menuTextStyle("12px","bold","arial");menuColor("#CAD9EA","004792","#2963A0","#8DABCB");
		menuGeneralStyle("padding:0px;");menuBarStyle("padding:0px;");
		menuButtonStyle("text-align:center; padding:5px 4px 5px 4px;" + 
											"border:1px solid; border-color: #A8BED6 #004792 #004792 #A8BED6;");
	}
}
//////////////////////
// Define Main menu: Example1
menuCreate("example1","v","main")
menuPreStyle("swpcrc")
menuAddButton("clinRes","Clinical Research Networks")
menuAddButton("clinResMeth","Clinical Research Methodological Support")
menuAddButton("clinTri","Clinical Research Facilities")
menuAddButton("image","Imaging")
menuAddButton("clinCap","Clinical Research Capacity Development")
menuAddButton("partner","Partners")
menuAddButton("resprog","Research Programmes")
menuAddButton("clahrc","Peninsula CLAHRC")
menuEnd()

// Define submenu: clinCap
menuCreate("clinCap","v","sub")
menuPreStyle("swpcrc")
menuAddLinkItem("Peninsula Graduate School ","http://www.pcmd.ac.uk/gradschool/institute/index.php")
//menuAddLinkItem("Academic Fellowships/Lectureship Scheme","")
menuAddLinkItem("Research Vacancies","jobs.php")
menuEnd()
// Define submenu: resprog
menuCreate("resprog","v","sub")
menuPreStyle("swpcrc")

menuAddLinkItem("South West Peninsula Clinical Diabetes ","swpdiabetes.php")
menuAddLinkItem("South West Peninsula Neurosciences ","swpneuro.php")
menuAddLinkItem("South West Peninsula Cardiovascular ","swpcardio.php")
menuAddLinkItem("South West Peninsula Cancer ","swpcancer.php")
menuAddLinkItem("South West Peninsula Bone and Joint","swpbones.php")
menuAddLinkItem("NHS R&D Annual Reports ","http://www.nrr.nhs.uk/2005AnnualReports/")
menuEnd()
// Define submenu: experim
menuCreate("experim","v","sub")
menuPreStyle("swpcrc")
menuAddLinkItem("Experimental Medicine Facilities","emf.php")
menuEnd()
// Define submenu: clinTri
menuCreate("clinTri","v","sub")
menuPreStyle("swpcrc")
menuAddLinkItem("Dedicated Outpatients and Day Case Facilities","outpat.php")
menuAddLinkItem("UKCRN Experimental Medicine Facilities","http://www.ukcrcexpmed.org.uk")
//menuAddLinkItem("Dedicated Inpatients Facilities","inpat.php")
menuEnd()
// Define submenu: clinRes
menuCreate("clinRes","v","sub")
menuPreStyle("swpcrc")
menuAddLinkItem("Primary Care Research Network","http://www.pcrnsw.org/ ")
menuAddLinkItem("Diabetes Local Research Network","diabetes_lrn.php")
menuAddLinkItem("Medicines for Children Local Research Network","medicine_lrn.php")
menuAddLinkItem("Dementias and Neurodegenerative Diseases Research Network","neuro_lrn.php")
menuAddLinkItem("Stroke Local Research Network","stroke_lrn.php")
menuAddLinkItem("West Hub, UK Mental Health Research Network","http://www.sword.nhs.uk/index.cfm?dwCurrentMenu=3")
menuAddLinkItem("UK Cancer Research Network","http://www.ncrn.org.uk/networks/networks.asp?ID=30")
menuEnd()
// Define submenu: clinResMeth
menuCreate("clinResMeth","v","sub")
menuPreStyle("swpcrc")
menuAddLinkItem("Research Design Service - South West ","http://www.rds-sw.nihr.ac.uk/")
menuAddLinkItem("Peninsula Clinical Trials Unit ","http://penctu.pcmd.ac.uk")
menuEnd()
// Define submenu: partner
menuCreate("partner","v","sub")
menuPreStyle("swpcrc")
menuAddLinkItem("Peninsula College of Medicine and Dentistry","http://www.pms.ac.uk")
menuAddLinkItem("Universty of Plymouth","http://www.plymouth.ac.uk")
menuAddLinkItem("Universty of Exeter","http://www.exeter.ac.uk")
menuAddLinkItem("Royal Devon and Exeter NHS Foundation Trust","http://www.rdehospital.nhs.uk/")
menuAddLinkItem("Plymouth Hospitals NHS Trust","http://www.plymouthhospitals.nhs.uk/Pages/Home.aspx")
menuAddLinkItem("Royal Cornwall Hospitals Trust","http://www.cornwall.nhs.uk/rcht/")
menuAddLinkItem("South Devon Healthcare NHS Trust","http://www.sdhct.nhs.uk/")
menuAddLinkItem("North Devon Healthcare Trust","http://www.northdevonhealth.nhs.uk/")
menuAddLinkItem("Devon PCT","http://www.devonpct.nhs.uk/")
menuAddLinkItem("Cornwall and Isles of Scilly PCT","http://www.cornwall.nhs.uk/CIOSPCT/home.aspx")
menuAddLinkItem("Torbay Care Trust","http://www.torbaycaretrust.nhs.uk/")
menuAddLinkItem("Plymouth Teaching PCT","http://www.nhs.uk/ServiceDirectories/Pages/Trust.aspx?id=5F1")
menuAddLinkItem("Devon Partnership Trust","http://www.devonpartnership.nhs.uk/")
menuAddLinkItem("Cornwall Partnership Trust","http://www.cornwall.nhs.uk/cpt/")
menuEnd()
// Define submenu: links
menuCreate("links","v","sub")
menuPreStyle("swpcrc")
menuAddLinkItem("Peninsula Magnetic Resonance Research Centre (PMRRC)","http://www.ex.ac.uk/pmrrc")
menuAddLinkItem("Peninsula RDSU","http://www.projects.ex.ac.uk/prdsu/welcome1.htm")
menuAddLinkItem("National Research Register","http://www.update-software.com/national/")
menuAddLinkItem("SWORD (South West Mental Health Research Governance Network)","http://www.sword.nhs.uk")
menuAddLinkItem("","")
menuEnd()
// Define submenu: image
menuCreate("image","v","sub")
menuPreStyle("swpcrc")
menuAddLinkItem("Peninsula Magnetic Resonance Research Centre (PMRRC)","http://www.ex.ac.uk/pmrrc")
menuAddLinkItem("Academy of Radiology ","http://www.penra.org.uk")
menuEnd()
// Define submenu: clahrc
menuCreate("clahrc","v","sub")
menuPreStyle("swpcrc")
menuAddLinkItem("Peninsula CLAHRC Website","http://clahrc-peninsula.nihr.ac.uk/")
/*menuAddLinkItem("Executive Summary (pdf)","files/PenCLAHRC_executive_summary.pdf")
menuAddLinkItem("Original Bid (pdf)","files/SWPCRC_CLAHRC_January_2008.pdf")
menuAddLinkItem("Lifton Stakeholder Event","lifton.php")
menuAddLinkItem("Project Board","penclahrc_project_board.php")*/
/*
menuAddLinkItem("Original Bid","penclahrc.php")
menuAddLinkItem("Executive summary","files/PenCLAHRC_executive_summary.pdf")
menuAddLinkItem("Introduction","files/The_Peninsula_CLAHRC_JET.ppt")
menuAddLinkItem("How the Peninsula CLAHRC will work","files/Pen_CLARHC_lifton_SL.ppt")
menuAddLinkItem("Questionnaire","files/Lifton_questionnaire.doc")
*/
menuEnd()

//]]]