function setspancontent (divname, content){
 if (document.all)
  document.all[divname].innerHTML = content;
 else{
  var d = document.layers[divname].document;
  d.open();
  d.write (content);
  d.close();
 }
}

function setspantext (divname, content){
 if (document.all)
  document.all[divname].innerText = content;
 else{
  var d = document.layers[divname].document;
  d.open();
  d.write (content);
  d.close();
 }
}

function appendspantext (divname, content){
  document.all[divname].innerText += content;
}

function getiepos (divname, side){
 var pos = 0;
 while (divname != null){
  pos += divname["offset" + side];
  divname = divname.offsetParent;
 }
 return pos;
}

function getleft (divname){
 if (document.all)	return getiepos (document.all[divname], "Left");		// IE
 else				return document.layers[divname].pageX;			// NETSCAPE
}

function gettop (divname){
 if (document.all)	return getiepos (document.all[divname], "Top");			// IE
 else				return document.layers[divname].pageY;			// NETSCAPE
}

function getleftarena (divname){
 if (document.all)	return getiepos (document.all[divname], "Left")-getleft("arena");		// IE
 else				return document.layers[divname].pageX-getleft("arena");			// NETSCAPE
}

function gettoparena (divname){
 if (document.all)	return getiepos (document.all[divname], "Top")-gettop("arena");			// IE
 else				return document.layers[divname].pageY-gettop("arena");			// NETSCAPE
}

function setpos (divname, x, y){
 if (document.all){	// IE
  document.all[divname].style.pixelLeft = getleft("arena")+Math.round(x);
  document.all[divname].style.pixelTop = gettop("arena")+Math.round(y);
 }
 else{			// NETSCAPE
  document.layers[divname].pageX = getleft("arena")+Math.round(x);
  document.layers[divname].pageY = gettop("arena")+Math.round(y);
 }
}

function setposabs (divname, x, y){
 if (document.all){	// IE
  document.all[divname].style.pixelLeft = Math.round(x);
  document.all[divname].style.pixelTop = Math.round(y);
 }
 else{			// NETSCAPE
  document.layers[divname].pageX = Math.round(x);
  document.layers[divname].pageY = Math.round(y);
 }
}

function hide(spanname){
 document.all[spanname].style.visibility = "hidden";
}

function show(spanname){
 document.all[spanname].style.visibility = "visible";
}

function rnd(x){
 return Math.round(x*10000)/10000;
}

function retrieveObject(what) {
 var output = '';
 for (i in what) {
  if (typeof what[i] == 'object')
   output += retrieveObject(what[i]);
  else
   output += i + ' = ' + what[i] + '\n';
 }
 return output;
}

function cloneObject(what){
 for (i in what) {
  if (typeof what[i] == 'object')
   this[i] = new cloneObject(what[i]);
  else
   this[i] = what[i];
 }
}

