function Initialise(top, side, sub){
  //select the correct top menu
  document.all('menu0' + top).className = 'menu-button-selected';
  
  if (side > 0) {
    //hide the other side menu groups
    for(a = 1; a <= 4; a++){
      if(a != side){
        var oGroup = document.all('group' + a + '0');
        if(oGroup != null){
          for(i = 0; i < oGroup.length; i++){
            oGroup[i].style.display = 'none';
          }
        }  
      }
    }
    
    //select the correct side menu
    document.all('menu' + side + sub).className = 'menu-button-selected';
  }  
  
  //set focus
  document.all('Logo').focus();
}

function ShowStatus(txtOver) {
  window.status = txtOver;
  return true;
}

function FormatNumber(num, dec, moneychar) {
  if (moneychar == undefined) moneychar = '';
  num = num.toString().replace(/\$|\,/g,'');
  if(isNaN(num)) num = "0";
  sign = (num == (num = Math.abs(num)));
  num = Math.floor(num * Math.pow(10, dec) + 0.50000000001);
  frac = num % Math.pow(10, dec);
  num = Math.floor(num / Math.pow(10, dec)).toString();
  if(frac.toString().length < dec) frac = '000000000000000'.substring(0, dec - frac.toString().length) + frac;
  for (var i = 0; i < Math.floor((num.length - (1 + i)) / 3); i++)
    num = num.substring(0, num.length - (4 * i + 3)) + ',' + num.substring(num.length - (4 * i + 3));
  if (dec > 0){
    return (((sign) ? '' : '-') + moneychar + num + '.' + frac);
  } else {
    return (((sign) ? '' : '-') + moneychar + num);
  }
}

