function onOut(item, id, on, notCurrent)
{
  var divs = item.getElementsByTagName('DIV');
  if(notCurrent)
  {
    if(document.all)
      divs[1].style.filter = 'alpha(opacity=' + (on?40:0) + ')';
    else
      divs[1].style.opacity = on?0.4:0;
    divs[0].style.color = divs[1].style.color = on?'#ffffff':'#043a54';
  }
}

function openFlash(url)
{
  var win = window.open(url,'flash','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=750,height=550');
  win.focus();
}

function openInfo(url)
{
  var win = window.open(url,'info','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=750,height=550');
  win.focus();
}


function center()
{
  var page = document.getElementById('page');
  if(page)
  {
    var w = document.all?document.body.clientWidth:window.innerWidth;
    page.style.left = ((w > page.clientWidth?((w - page.clientWidth) / 2):0) + (page.clientWidth / 2)) + 'px';
  }
}

function resizePopup()
{
  var infopopup = document.getElementById('infocontent');
  if(infopopup)
  {
    var p = infopopup.getElementsByTagName('P');
    if(p.length == 1)
    {
      var img = p[0].getElementsByTagName('IMG');
      if(img.length == 1)
      {
        var x = infopopup.appendChild(p[0].removeChild(img[0]));
        infopopup.removeChild(p[0]);
        var w = x.width + (document.all ? 20 : 16);
        var h = x.height + (document.all ? 92 : 58);
        document.body.style.overflow = 'hidden';
        document.body.style.margin = '0px';
       
        window.resizeTo(w, h);
        
        while(document.body.clientWidth < x.width && document.body.clientHeight < x.height)
          window.resizeBy(5, 5);
        while(document.body.clientWidth < x.width)
          window.resizeBy(5, 0);
        while(document.body.clientHeight < x.height)
          window.resizeBy(0, 5);
          
        while(document.body.clientWidth > x.width && document.body.clientHeight > x.height)
          window.resizeBy(-1, -1);
        while(document.body.clientWidth > x.width)
          window.resizeBy(-1, 0);
        while(document.body.clientHeight > x.height)
          window.resizeBy(0, -1);

        self.focus();
      }
    }
  }
}

window.onload = function(){/*center();*/ resizePopup();};

function sleep(naptime){
      naptime = naptime * 1000;
      var sleeping = true;
      var now = new Date();
      var alarm;
      var startingMSeconds = now.getTime();
      while(sleeping){
         alarm = new Date();
         alarmMSeconds = alarm.getTime();
         if(alarmMSeconds - startingMSeconds > naptime){ sleeping = false; }
      }      
      alert("Wakeup!");
   }

/*window.onresize = center;*/
