//*****************************************************************************
// Do not remove this notice.
//
// Copyright 2000-2002 by Mike Hall.
// See http://www.brainjar.com for terms of use.
//*****************************************************************************

//----------------------------------------------------------------------------
// Code to determine the browser and version.
//----------------------------------------------------------------------------

// define for sitestat
var rubrieknaam = "";
var tellernaam = "";

var vertMenu = false;
var menuImageSource = "";

var WEBAPP_ROOT_CONTEXT = "/static";

// mouseovers for arrows
pijl     =  new Image ()
pijl.src = WEBAPP_ROOT_CONTEXT + "/" + siteContext + "/images/tipPijlgif.gif";

pijlMo     =  new Image ()
pijlMo.src = WEBAPP_ROOT_CONTEXT + "/" + siteContext + "/images/tipPijlgifMO.gif";

function op(plaats) {
	document.images[plaats].src     = pijlMo.src;
}
 
function af(plaats) {
	document.images[plaats].src     = pijl.src;
}

var uz = getObject("uz");

function hideUz() {
  if (uz == null) {
    uz = getObject("uz");
  }
  if (uz != null) {
    uz.style.visibility = "hidden";
  }
}

function showUz() {
  if (uz == null) {
    uz = getObject("uz");
  }
  if (uz != null) {
    uz.style.visibility = "visible";
  }
}

function Browser() {

  var ua, s, i;

  this.isIE    = false;  // Internet Explorer
  this.isNS    = false;  // Netscape
  this.version = null;

  ua = navigator.userAgent;

  s = "MSIE";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isIE = 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 NS 6.1.

  s = "Gecko";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = 6.1;
    return;
  }
}

var browser = new Browser();

//----------------------------------------------------------------------------
// Code for handling the menu bar and active button.
//----------------------------------------------------------------------------

var activeButton = null;
var activeMenuIndex = -1;

/* [MODIFIED] This code commented out, not needed for activate/deactivate
   on mouseover.

// Capture mouse clicks on the page so any active button can be
// deactivated.

if (browser.isIE)
  document.onmousedown = pageMousedown;
else
  document.addEventListener("mousedown", pageMousedown, true);

function pageMousedown(event) {

  var el;

  // If there is no active button, exit.

  if (activeButton == null)
    return;

  // Find the element that was clicked on.

  if (browser.isIE)
    el = window.event.srcElement;
  else
    el = (event.target.tagName ? event.target : event.target.parentNode);

  // If the active button was clicked on, exit.

  if (el == activeButton)
    return;

  // If the element is not part of a menu, reset and clear the active
  // button.

  if (getContainerWith(el, "DIV", "menu") == null) {
    resetButton(activeButton);
    activeButton = null;
  }
}

[END MODIFIED] */

function buttonClick(event, menuId, menuIndex) {

  var button;

hideUz();
  // 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 = getObject(menuId);
    if (button.menu.isInitialized == null)
      menuInit(button.menu,menuIndex);
  }

  // [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,menuIndex);
    activeButton = button;
    activeMenuIndex = menuIndex;
  }
  else
  {
    activeButton = null;
    activeMenuIndex = -1;
  }

  return false;
}

function imageMouseout(event,imageId,newImage,menuIndex)
{
    var button;
    var img;

    img = getObject(imageId);
    if (img == null)
    {
      ;
    }
    else
    {
      img.src = newImage;
    }
    buttonOrMenuMouseout(event,menuIndex);

/*
  if (browser.isIE)
    button = window.event.srcElement;
  else
    button = event.currentTarget;

  if (button == activeButton)
    resetButton(activeButton);
*/
}

function imageMouseover(event, menuId, imageId, newImage, menuIndex) {

  var button;
  var img;

  img = getObject(imageId);
  if (img != null)
    img.src = newImage;

  // [MODIFIED] Added for activate/deactivate on mouseover.

  // Activates this button's menu if no other is currently active.

  
  if (activeButton == null) {
    buttonClick(event, menuId, menuIndex);
    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, menuIndex);
}

function buttonMouseover(event, menuId, menuIndex) {

  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, menuIndex);
    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, menuIndex);
}

function depressButton(button,menuIndex) {

  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]

  // Position the associated drop down menu under the button and
  // show it.


// voor horizontale menu's: x pos = x pos van button, y pos is direct onder
// button, dus button.offsetHeight naar beneden
//  x = getPageOffsetLeft(button);
//  y = getPageOffsetTop(button) + button.offsetHeight;


// VERT MENU

// voor verticale menu's: x pos = menubreedte (maar even 50) naar rechts, en
// op y positie van de bovenkant van de button. Om de een of andere reden
// wordt de offset t.o.v. de pagina niet goed berekend, en wordt iedere button 
// 2 x meegeteld. Hierdoor is de offset voor de eerste button goed, maar voor
// alle overige buttons niet. Dit kan gecorrigeerd worden door de helft te nemen
// van de berekende pageoffset - de offset van de hele menubar div
  var vertMenu = verticalMenu[menuIndex];

  x = getPageOffsetLeft(button);
  if (vertMenu) { x += button.offsetWidth; }

  y = (getPageOffsetTop(button) - DIV_yoffset[menuIndex])/2;
  if (!vertMenu) { 
    y += button.offsetHeight;
  }

  
  
  // zou moeten zijn: y=getPageOffsetTop(button) - (buttonIndex)*button.offsetHeight; waarbij (buttonIndex) het nr. van de button is, te beginnen bij 0
//  alert('PAGEOFFSET = '+getPageOffsetTop(button)+' OFFSETHEIGHT = '+button.offsetHeight);

  // For IE, adjust position.

  if (browser.isIE) {
    x += button.offsetParent.clientLeft;
    y += button.offsetParent.clientTop;
  }

  x = x - DIV_xoffset[menuIndex];
//alert('DIVOFFSET = ' +DIV_xoffset[menuIndex]+','+DIV_yoffset[menuIndex]);
  button.menu.style.left = x + "px";
  button.menu.style.top  = y + "px";
//alert('POS = ' +x+','+y);
  button.menu.style.visibility = "visible";
}

function resetButton(button,menuIndex) {

  // Restore the button's style class.

  removeClassName(button, "menuButtonActive",menuIndex);

  // Hide the button's menu, first closing any sub menus.

  if (button.menu != null) {
    closeSubMenu(button.menu,menuIndex);
    button.menu.style.visibility = "hidden";
  }
}

//----------------------------------------------------------------------------
// Code to handle the menus and sub menus.
//----------------------------------------------------------------------------

function menuMouseover(event, menuIndex) {

  var menu;

  // Find the target menu element.
  hideUz();
  if (browser.isIE)
    menu = getContainerWith(window.event.srcElement, "DIV", "menu", menuIndex);
  else
    menu = event.currentTarget;

  // Close any active sub menu.
  if (menu.activeItem != null)
  {
      closeSubMenu(menu,menuIndex);
  }
}

function menuItemMouseover(event, menuId, menuIndex) {

  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", menuIndex);
  }
  else
    item = event.currentTarget;
  menu = getContainerWith(item, "DIV", "menu", menuIndex);

  // Close any active sub menu and mark this one as active.

  if (menu.activeItem != null)
  {
    closeSubMenu(menu,menuIndex);
  }
hideUz();
  menu.activeItem = item;

  // Highlight the item element.

//  item.className += " menuItemHighlight";
  addClassName(item,"menuItemHighlight",menuIndex);

  // Initialize the sub menu, if not already done.

  if (item.subMenu == null) {
    item.subMenu = getObject(menuId);
    if (item.subMenu.isInitialized == null)
      menuInit(item.subMenu,menuIndex);
  }

  // [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);

  x = x - DIV_xoffset[menuIndex];
  y = y - DIV_yoffset[menuIndex];

  // Adjust position to fit in view.

  var maxX, maxY;

  if (browser.isNS) {
    maxX = window.scrollX + window.innerWidth;
    maxY = window.scrollY + window.innerHeight;
  }
  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);
  }
  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,menuIndex) {

  if (menu == null || menu.activeItem == null)
    return;

  showUz();
  // Recursively close any sub menus.

  if (menu.activeItem.subMenu != null) {
    closeSubMenu(menu.activeItem.subMenu,menuIndex);
    menu.activeItem.subMenu.style.visibility = "hidden";
    menu.activeItem.subMenu = null;
  }
  removeClassName(menu.activeItem, "menuItemHighlight",menuIndex);
  menu.activeItem = null;
}

// [MODIFIED] Added for activate/deactivate on mouseover. Handler for mouseout
// event on buttons and menus.

function buttonOrMenuMouseout(event,menuIndex) {

  var el;
  showUz();

  // 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 (menuIndex != null)
  {
    if (getContainerWith(el, "DIV", "menu",menuIndex) == null) {
      resetButton(activeButton);
      activeButton = null;
      activeMenuIndex = -1;
    }
  }
  else {
    if (getContainerWith(el, "DIV", "menu",activeMenuIndex) == null) {
      resetButton(activeButton);
      activeButton = null;
      activeMenuIndex = -1;
    }
  }
}

// [END MODIFIED]

//----------------------------------------------------------------------------
// Code to initialize menus.
//----------------------------------------------------------------------------

function menuInit(menu,menuIndex) {

  var itemList, spanList;
  var textEl, arrowEl;
  var itemWidth;
  var w, dw;
  var i, j;
  var mIndex = "" + menuIndex;

  // 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",menuIndex)) {
        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",menuIndex))
        textEl = spanList[j];
      if (hasClassName(spanList[j], "menuItemArrow",menuIndex))
        arrowEl = spanList[j];
    }
    if (textEl != null && arrowEl != null)
      textEl.style.paddingRight = (itemWidth
        - (textEl.offsetWidth + arrowEl.offsetWidth)) + "px";
  }

  // Fix IE hover problem by setting an explicit width on first item of
  // the menu.

  if (browser.isIE) {
      for (var i = 0; i< itemList.length; i++) {
        w = itemList[i].offsetWidth;
        itemList[i].style.width = w + "px";
        dw = itemList[i].offsetWidth - w;
        w -= dw;
        itemList[i].style.width = w + "px";
      }
  }

  // Mark menu as initialized.

  menu.isInitialized = true;
}

//----------------------------------------------------------------------------
// General utility functions.
//----------------------------------------------------------------------------

function getContainerWith(node, tagName, name, menuIndex) {

  // Starting with the given node, find the nearest containing element
  // with the specified tag name and style class.

  var className = getClassName(name,menuIndex);

  while (node != null) {
    if (node.tagName != null && node.tagName == tagName &&
        hasClassName(node, name,menuIndex))
      return node;
    node = node.parentNode;
  }

  return node;
}

function hasClassName(el, name, menuIndex) {

  var i, list;
  var clName = getClassName(name,menuIndex);

  // 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] == clName)
      return true;

  return false;
}

function addClassName(el,name,menuIndex)
{
  el.className += " " + getClassName(name,menuIndex);
}

function removeClassName(el, name, menuIndex) {

  var i, curList, newList;

  if (menuIndex == null) { menuIndex = activeMenuIndex; }
  var clName = getClassName(name,menuIndex);

  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] != clName)
      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;
}

function getClassName(name,menuIndex)
{
  var clname = name + "" + menuIndex + "";
//  var clname = name; 
  return clname;
}

function DL_GetElementLeft(eElement)
{
    // initialize var to store calculations
    var nLeftPos = eElement.offsetLeft;          
    // identify first offset parent element  
    var eParElement = eElement.offsetParent;     
    // move up through element hierarchy
    while (eParElement != null)
    {                                            
	// appending left offset of each parent
        nLeftPos += eParElement.offsetLeft;      
	// until no more offset parents exist
        eParElement = eParElement.offsetParent;  
    }
    // return the number calculated
    return nLeftPos;                             
}

function DL_GetElementTop(eElement)
{
    // initialize var to store calculations
    var nTopPos = eElement.offsetTop;            
    // identify first offset parent element  
    var eParElement = eElement.offsetParent;     
    // move up through element hierarchy
    while (eParElement != null)
    {                                            
	// appending top offset of each parent
        nTopPos += eParElement.offsetTop;        
	// until no more offset parents exist
        eParElement = eParElement.offsetParent;  
    }
    // return the number calculated
    return nTopPos;                              
}



// global variables: menuIndex en classTxt
var MENU_IMAGE_DIR = WEBAPP_ROOT_CONTEXT + "/" + siteContext +  "/images/menu";
var DIV_xoffset = new Array();
var DIV_yoffset = new Array();
var verticalMenu = new Array();
var menuIndex = -1;
var classTxt = "";

var urlprefix = "";
var urlpostfix = "";

function setMenuImageDir(context)
{
   if (context == "common") {
      MENU_IMAGE_DIR = WEBAPP_ROOT_CONTEXT + "/images/menu";
   }
   else {
      // if not explicitly common, default context is site-specific
      MENU_IMAGE_DIR = WEBAPP_ROOT_CONTEXT + "/" + siteContext +  "/images/menu";
   }
}

function bBD(id) // begin tag DIV for menu bar
{
  var outstr = "<div id=\"mbar_"+id+"\" class=\"menuBar"+classTxt+"\" style=\"position:absolute;\"><table cellspacing=\"0\" cellpadding=\"0\" border=\"0\">";
  document.write(outstr);
}

function eBD(id) // end tag DIV for menu bar
{
  var outstr = "</table></div>";
  document.write(outstr);
}

function bMD(id) // begin tag DIV for (sub)menu
{
  var mid = "" + menuIndex + "_" + id;
  var outstr = "<div id=\"m_" + mid +"\" class=\"menu"+classTxt+"\" onmouseover=\"menuMouseover(event,'"+menuIndex+"')\">";
  document.write(outstr);
}

function eMD(id) // end tag DIV for (sub)menu
{
  var outstr = "</div>";
  document.write(outstr);
}

// VERT MENU
// voor verticale menu's: een <TR> en </TR> om iedere <TD> en </TD> van de 
// menu items in ABC en ABnC

function ABnC(id,url,text,img,img_mo) // Anchor for a MenuButton without Children
{
   var mid = "" + menuIndex + "_" + id;
   var imgid = "img_" + mid;
   var outstr = "";
   if (vertMenu) { outstr += "<tr>"; }
   outstr += "<td><a class=\"menuButton"+classTxt+"\" href=\""+url+"\" \n";
   outstr += "onmouseover=\"getObject('"+imgid+"').src='"+MENU_IMAGE_DIR+"/"+img_mo+"';\" \n";
   outstr += "onmouseout=\"getObject('"+imgid+"').src='"+MENU_IMAGE_DIR+"/"+img+"'\"\n";
   outstr += "><img style=\"cursor:pointer;\" id=\""+imgid+"\" src=\""+MENU_IMAGE_DIR+"/"+img+"\" border=\"0\"></a></td>\n";
   if (vertMenu) { outstr += "</tr>"; }
   document.write(outstr);
}

function skip()
{
  return;
}

function ABC(id,url,text,img,img_mo) // Anchor for a MenuButton with Children
{
  var mid = "" + menuIndex + "_" + id;
  var imgid = "img_" + mid;
  if (url.length == 0)
  {
    url = "javascript:skip()"
  }
  var outstr = "";
  if (vertMenu) { outstr += "<tr>"; }
  outstr += "<td><a class=\"menuButton"+classTxt+"\" href=\""+url+"\" \n";
  outstr += "onmouseover=\"imageMouseover(event, 'm_"+mid+"' ,'img_"+mid+"','"+MENU_IMAGE_DIR+"/"+img_mo+"', '"+menuIndex+"');\" \n";
  outstr += "onmouseout=\"imageMouseout(event, 'img_"+mid+"','"+MENU_IMAGE_DIR+"/"+img+"','"+menuIndex+"');\"\n";
  outstr += "><img style=\"cursor:pointer;\" id=\""+imgid+"\" src=\"" + MENU_IMAGE_DIR +"/" + img+"\" border=\"0\"></a></td>\n";
  if (vertMenu) { outstr += "</tr>"; }
  document.write(outstr);
}

function AMnC(id,url,text) // Anchor for MenuItem without Children
{
  var outstr = "<a class=\"menuItem"+classTxt+"\" href=\""+urlprefix+url+urlpostfix+"\">" + text + "</a>\n";
  document.write(outstr);
}

function AMC(id,url,text)  // Anchor for MenuItem with Children
{
  var mid = "" + menuIndex + "_" + id;
  if (url.length == 0)
  {
    url = "javascript:skip()"
  }
  else {
    url = urlprefix + url + urlpostfix;
  }
  var outstr = "<a class=\"menuItem"+classTxt+"\" href=\""+url+"\"\n";
  outstr += "onmouseover=\"menuItemMouseover(event, 'm_"+mid+"', '"+menuIndex+"');\"\n";
  outstr += "><span class=\"menuItemText"+classTxt+"\">"+text+"</span><span class=\"menuItemArrow"+classTxt+"\">&#9654;</span></a>";
  document.write(outstr);
}

function setUPre(up)
{
  urlprefix=up;
}

function setUPost(up)
{
  urlpostfix=up;
}

function resetUP()
{
  urlprefix="";
  urlpostfix="";
}

function sep()
{
  document.write("<div class=\"menuItemSep\"></div>\n");
}


/*************************************
** MISC FUNCTIONS
*************************************/

var contentFontSize = 12;

function vergrootTxt()
{
  var contentObj = getObject('content');
  if (contentObj != null)
  {
    if (contentFontSize == 18) {
      contentFontSize = 12;
    } else {
      contentFontSize = 18;
    }

    var ch = contentObj.childNodes;
    if (ch.length > 0)
    {
      var cl = ch.length;
      for (var i=0;i<cl;i++)
      {
        setObjTextSize(ch[i],contentFontSize);
      }
    }
  }
  var argc = vergrootTxt.arguments.length;
  if (argc > 0) {
    // called on initialization: don't change cookie value
  }
  else {
    // toggle function: switch from yes to no and vice versa
    var ck = GetCookie("vergroottxt");
    if (ck)
    {
      if (ck.length > 0) {
        if (ck.indexOf("yes") == 0) {
          SetCookie("vergroottxt","no","/uib");
        }
        else {
          SetCookie("vergroottxt","yes","/uib");
          var str = GetCookie("vergroottxt");
        }
      }
      else {
        SetCookie("vergroottxt","yes","/uib");
        var str = GetCookie("vergroottxt");
      }
    }
    else {
        SetCookie("vergroottxt","yes","/uib");
        var str = GetCookie("vergroottxt");
    }
  }
}

function setObjTextSize(obj,fontSize)
{
  if (obj != null)
  {
    if (obj.style != null)
    {
      obj.style.fontSize = fontSize;
    }
    var ch = obj.childNodes;
    if (ch.length > 0)
    {
      var cl = ch.length;
      for (var i=0;i<cl;i++)
      {
        setObjTextSize(ch[i],fontSize);
      }
    }
  }
}

function seturlparameter(url,parname,parvalue)
      {
	var q = url.indexOf('?');
	var newps = "";
	var parfound = 0;

	if ((q > 0) && (q < url.length-1))
	{
	  var tl = url.length;
	  var ps = url.substring(q+1,tl);
	  url = url.substring(0,q);

	  var pars = ps.split("&");
	  newps = "?";
	  var amp = "";
	  for (i = 0;i<pars.length;i++)
	  {
	    var nv = pars[i].split("=");
	    if (nv[0] == parname) {
	      nv[1] = escape(parvalue);
	      parfound = 1;
	    }
	    if ((nv[0] != null) && (nv[1] != null))
	    {
	      newps += amp + nv[0] + "=" + nv[1];
	      if (i == 0) {
	        amp = "&";
	      }
	    }
	  }
	  if (!parfound) {
	    newps += amp + parname + "=" + escape(parvalue);
	  }
	}
	else {
	  var quest = "?";
	  if (q > 0) { quest = ""; }
	  newps = quest + parname + "="+escape(parvalue);
	}
	url = url + newps;
	return url;
}

//------------------------------------------
// IE 5.0 patches, added by Nico van Vliet
//------------------------------------------

function getObject(name) {
    return (document.getElementById) ? document.getElementById(name) : document.all(name);
}

if (!Array.prototype.push) {
    Array.prototype.push = function (items) {
        for(var counter = 0; counter<arguments.length; counter++) {
            this[this.length] = arguments[counter];
        }
        return this.length;
    }
}
