function openWindow(url, wname, features) {
  w = window.open(url, wname, features);
  w.focus();
}

function formatNumber (num, dec) {
  var n = Math.round (eval(num) * Math.pow(10,dec)) / Math.pow(10,dec);
  s = "" + n;
  if (dec == 0) return s;
  pos = s.indexOf(".");
  if (pos == -1) {
     s = s + ".";
     pos = s.length-1;
  };
  while (s.length-pos <= dec) {s = s + "0"};
  return s;
}

function setBgColor(bgColor) {
   parent.frames[0].document.background=null;
   parent.frames[0].document.bgColor=bgColor;
}


