function getObject(id)
{
  if (document.getElementById)
  {
    return document.getElementById(id);
  }
  else
  if (document.layers && document.layers[id])
  {
    return document.layers[id];
  }
  else
  if (document.all)
  {
    return document.all[id];
  }
}
function show(object)
{
  getObject(object).style.visibility = 'visible';
  getObject(object).style.height = '100%';
}
function hide(object)
{
  getObject(object).style.visibility = 'hidden';
  getObject(object).style.height = '0%';
}
function alertObjProp(obj)
{
  var s="";
  for(var prop in obj)
  {
    s+='{'+prop+'='+obj[prop]+'}';
  }
  alert(s);
}
function setBgImage(target,image)
{
  target.style.background="url("+image+") no-repeat "+target.clientWidth+"px "+target.clientHeight+"px;";
//  target.style.backgroundPosition='expression(document.body.clientWidth/2-oDiv.offsetWidth/2)';
//  target.style.backgroundRepeat='no-repeat';
}
/*
 * This function will not return until (at least)
 * the specified number of milliseconds have passed.
 * It uses a modal dialog.
 */
function pause(numberMillis)
{
  var dialogScript='window.setTimeout('+'function (){ window.close();},'+numberMillis+');';
  var result=window.showModalDialog('javascript:document.writeln("<script>'+dialogScript+'<'+'/script>")');
/* For NN6, but it requires a trusted script.
         openDialog(
           'javascript:document.writeln(' +
            '"<script>' + dialogScript + '<' + '/script>"',
           'pauseDialog', 'modal=1,width=10,height=10');
*/
}
function call(target,fn,args)
{
  var i;
  for(i=0; i<5; i++)
  {
    var evalresult = eval("typeof "+target+"."+fn);
//    alert("Function "+fn+" in "+target+"=>"+evalresult);
//    alert('#'+i+'Call('+target+','+fn+','+args+')');
window.status='#'+i+'Call('+target+','+fn+','+args+')';
    if (evalresult == "function")
    {
      return eval(target+"."+fn+"(args)");
    }
    else
    if (evalresult == "unknown")
    {
      return 'Call not completed - security';
    }
    // Pause for 1/10th sec and the retry
    pause(100);
  }
  return 'Call not completed';
}
// The Central Randomizer 1.3 (C) 1997 by Paul Houle (houle@msc.cornell.edu)
// See:  http://www.msc.cornell.edu/~houle/javascript/randomizer.html

rnd.today=new Date();
rnd.seed=rnd.today.getTime();

function rnd()
{
  rnd.seed = (rnd.seed*9301+49297) % 233280;
  return rnd.seed/(233280.0);
}

function rand(number)
{
  return Math.ceil(rnd()*number);
}

