function waitcursor(bActivated)
{
  var x,y;
  if (self.innerHeight) // all except Explorer
  {
    x = self.innerWidth;
    y = self.innerHeight;
  }
  else if (document.documentElement && document.documentElement.clientHeight) // Explorer 6 Strict Mode
  {
   x = document.documentElement.clientWidth;
   y = document.documentElement.clientHeight;
  }
  else if (document.body) // other Explorers
  {
   x = document.body.clientWidth;
   y = document.body.clientHeight;
  }
  var el=document.getElementById('waitdsk');
	if(null!=el)
	{
		el.style.visibility = (bActivated)?'visible':'hidden';
		el.style.display = (bActivated)?'block':'none';
		el.style.width = x + "px";
		el.style.height = y + "px";
		el.style.zIndex = 1;
	}
	el=document.getElementById('waitload');
	if(null!=el)
	{
		var top = (y/2) - 50;
		var left = (x/2) - 200;
		if( left<=0 ) left = 10;
		el.style.visibility = (bActivated)?'visible':'hidden';
		el.style.display = (bActivated)?'block':'none';
		el.style.left = left + "px"
		el.style.top = top + "px";
		el.style.zIndex = 2;
	}
}
function waitcursor_hidewhenloaded()
{
  var oldOnLoad = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = function() {
      waitcursor(0);
    };
  } else {
    window.onload = function() {
      oldOnLoad();
      waitcursor(0);
    };
  }
}
