var NTSCP=((navigator.appName == "Netscape") && (parseInt(navigator.appVersion)) >= 4 && (parseInt(navigator.appVersion) < 6));
function getPrice() {
  the_price=0 ;
  if (NTSCP) {
    if (window.document.pricelist.startingPrice.checked) the_price= parseInt(window.document.pricelist.startingPrice.value);
    for (i=1 ; i < (document.pricelist.length - 1) ; i++) {
      if (window.document.pricelist['price' + i].checked) the_price += parseInt(window.document.pricelist['price' + i].value) ;
    }
    window.document.pricelist.total_price.value = getAsNumer(the_price)+',-' ;
  }
  else {
    if (document.pricelist.startingPrice.checked) the_price= parseInt(document.pricelist.startingPrice.value) ;
    for (i=1 ; i < (document.pricelist.length - 1) ; i++) {
      if (document.pricelist['price' + i].checked) the_price += parseInt(document.pricelist['price' + i].value) ;
    }
    document.pricelist.total_price.value = getAsNumer(the_price)+',-' ;
  }
}
function getAsNumer(number) {
  newstr='' ;
  tempstr= number.toString(10) ;
  len = tempstr.length ;
  pad_spaces = ((len - (len % 3))/3) ;
  if ((len %3) == 0) pad_spaces--;
  start_pos = len - (pad_spaces*3);
  if (len <=3) {
    newstr=tempstr ;
  }
  else {
    newstr = tempstr.substr(0, start_pos) ;
    for (i=0 ; i < (pad_spaces) ; i++) {
      start_pos = start_pos + (i*3) ;
      newstr += ' ' + tempstr.substr(start_pos, start_pos+2) ;
    }
  }
  return newstr ;
}
