/* helper function to load multiple functions, courtesy Simon Wilson */
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

function popup(url,w,h,scroll)
{
  var l = (screen.width-w)/2;
  var t = (screen.height-h)/2;

  window.open(url,'_blank','resizable=yes,location=no,menubar=no,scrollbars='+scroll+',status=no,toolbar=no,fullscreen=no,dependent=no,width='+w+',height='+h+',left='+l+',top='+t);
}

//get basepath
var site_base = "";
if(a=document.getElementsByTagName("link")[0])
{
  site_base = a.href.substr(0,a.href.indexOf('/resources'));
}


//menu
navHover = function()
{
  menu_hover('topbar');
  menu_hover('nav');
}

function menu_hover(id)
{
  if(document.getElementById(id))
  {
    var lis = document.getElementById(id).getElementsByTagName("LI");
    for (var i=0; i<lis.length; i++) {
      lis[i].onmouseover=function() {
        this.className+=" iehover";
      }
      lis[i].onmouseout=function() {
        this.className=this.className.replace(new RegExp(" iehover\\b"), "");
      }
    }
  }
}

if (window.attachEvent) {window.attachEvent("onload", navHover);} //only needed in IE

addLoadEvent(function()
{
    if($('login_username'))
    {
        if($('login_username').value=='')
        {
            $('login_username').value = 'Inlognaam';
        }
        $('login_username').onclick = function()
        {
            if(this.value=='Inlognaam')
            {
                this.value='';
            }
        }
        $('login_username').onblur = function()
        {
            if(this.value=='')
            {
                this.value='Inlognaam';
            }
        }
    }
})
