// Wechselkursberechnungskonstanten
ChfExRate=1.00;
UsdExRate=1.00;
EurExRate=1.40;
RoundFact=0.01;

// Fremdwährungspreisberechnung
function ForexPrices(basis)
{ prchf = basis;
  prusd = 0;
  preur = 0;
  prusd = (Math.round(prchf/(UsdExRate*RoundFact))*RoundFact);
  preur = (Math.round(prchf/(EurExRate*RoundFact))*RoundFact);
  prchf_text = FormatierterPreis(prchf,'CHF');
  prusd_text = FormatierterPreis(prusd,'US$');
  preur_text = FormatierterPreis(preur,'EUR');
  return prchf_text + prusd_text + preur_text;
}

// Anzeige der Bildergallerie
function ShowGallery(param)
{
	gallery = window.open('200.htm',param,'resizable=yes,scrollbars=yes,menubar=no,toolbar=no,status=yes');
}

// Anzeige der Grossbilder
function ShowLargePic(param)
{
	gallery = window.open('200.htm',param,'resizable=yes,scrollbars=yes,menubar=no,toolbar=no,status=yes');
}


// Formatierung auf 2 Nachkommastellen inkl. Nuller
function FormatierterPreis(preis,w_kennung) {
//  p=preis.indexOf(".");
//  if (p==-1) {
//    preis=preis+".00";
//    }
//  else {
//    preis=preis+"00";
//    }

//  p=preis.indexOf(".");
//  preis_vor=preis.substring(0,p);
//  preis_nach=preis.substring(p+1,p+3);

  return w_kennung + (Math.round(preis*100)/100) + "  ";
}

function TablePrices(basis)
{ prchf = basis;
  prusd = 0;
  preur = 0;
  prusd = (Math.round(prchf/(UsdExRate*RoundFact))*RoundFact);
  prusd = (Math.round(prusd*100)/100)
  preur = (Math.round(prchf/(EurExRate*RoundFact))*RoundFact);
  preur = (Math.round(preur*100)/100)
  PriceArray = [prchf,prusd,preur];
  return PriceArray;
}