function winLoad(func){
  var keepLoad = window.onload;
  window.onload = function(){
    if(keepLoad != null && keepLoad != undefined) keepLoad(); func();
  };
};

// quick fix for the login redirect - total kludge
if(1==0) // remove this line to go live
winLoad(function(){
  if((/login.php$/i).test(document.URL)){
    var els = document.getElementsByTagName('td');
    for(var i=0;i<els.length;i++)
      if(els[i].className == 'VertMenuItems')
        if((/is logged in/).test(els[i].innerHTML)){
          window.location = 'customer/'; break; }
  }
});

