
	function $(id) {
		return document.getElementById(id);
	}

	function format_preis(einPreis) {
		return komma_hinzufuegen(Math.round(einPreis * 100) / 100) + " &euro;";
	}
	
	function format_preis_js(einPreis) {
		return komma_hinzufuegen(Math.round(einPreis * 100) / 100) + " \u20AC";
	}
	

	function round(nummer, nr) { 
		return parseFloat(("" + nummer.toFixed(nr)).replace(/0+$/g,'')); 
	}
					
	function komma_hinzufuegen(nStr) {

		nStr += '';
		x = nStr.split('.');
		x1 = x[0];
		
		x2 = ",";		
		
		if (x.length == 1)
			x2 += "00";		
		
		if (x.length > 1) {
			x2 += x[1];
			for (var i = x2.length; i <= 2; i++) {
				x2 += "0";			
			}
		
		}
		
		var rgx = /(\d+)(\d{3})/;
		while (rgx.test(x1))
			x1 = x1.replace(rgx, '$1' + '.' + '$2');
		
		return x1 + x2;
	}
	