// Produktpreis
var produktpreis_artikel_1 = 79.90; // 79.90

// Versandkosten Kategorie
var versandkostenliste = new Array();
versandkostenliste[1] = 0; // DE
versandkostenliste[2] = 10.00; // Europa
versandkostenliste[3] = 20.00; // CH
versandkostenliste[4] = 20.00; // Weltweit

// Funktion formatZahl()
function formatZahl(zahl, k, fix) {
    if(!k) k = 0;
    var neu = '';
	var dec_point = '.';
	var thousands_sep = ',';
    // Runden
    var f = Math.pow(10, k);
    zahl = '' + parseInt(zahl * f + (.5 * (zahl > 0 ? 1 : -1)) ) / f ;
    // Komma ermittlen
    var idx = zahl.indexOf('.');
    // fehlende Nullen einfügen
    if(fix)    {
         zahl += (idx == -1 ? '.' : '' )
         + f.toString().substring(1);
    }
	var sign = zahl < 0;
	if(sign) zahl = zahl.substring(1);
    idx = zahl.indexOf('.');
	// Nachkommastellen ermittlen
    if( idx == -1) idx = zahl.length;
    else neu = dec_point + zahl.substr(idx + 1, k);
    while(idx > 0)    {
        if(idx - 3 > 0)
        neu = thousands_sep + zahl.substring( idx - 3, idx) + neu;
        else
        neu = zahl.substring(0, idx) + neu;
        idx -= 3;
    }
    return (sign ? '-' : '') + neu;
}
