function chgOver(e,oo)
{
	switch(oo)
	{
		case 1:
			e.style.background='#0011f4';
			e.style.color='white';
			e.style.cursor='pointer';
			break;
		case 2:
			e.style.background='#E5E5E5';
			e.style.color='black';
			e.style.cursor='default';
			break;
		default:
			break;
	}
}

function jumpTo(e)
{
	window.document.getElementById("FL01").value=e;
	window.document.mpage.submit();
}

function prBerechnen()
{
	window.document.getElementById("RK1").innerHTML=formatZahl(document.getElementById("Standard").value*0.45,2,true)+" €*";
	window.document.getElementById("RK2").innerHTML=formatZahl(document.getElementById("Kompakt").value*0.75,2,true)+" €*";
	window.document.getElementById("RK3").innerHTML=formatZahl(document.getElementById("Gross").value*1.20,2,true)+" €*";
	window.document.getElementById("RK4").innerHTML=formatZahl(document.getElementById("Maxi").value*1.70,2,true)+" €*";
	window.document.getElementById("RK5").innerHTML=formatZahl(document.getElementById("EE").value*1.73,2,true)+" €*";
	window.document.getElementById("RK6").innerHTML=formatZahl(document.getElementById("UER").value*3.56,2,true)+" €*";
	window.document.getElementById("RK7").innerHTML=formatZahl(document.getElementById("PZA").value*2.52,2,true)+" €*";
	window.document.getElementById("RK8").innerHTML=formatZahl(document.getElementById("Postkarte").value*0.40,2,true)+" €*";

	window.document.getElementById("DP1").innerHTML=formatZahl(document.getElementById("Standard").value*0.55,2,true)+" €";
	window.document.getElementById("DP2").innerHTML=formatZahl(document.getElementById("Kompakt").value*0.90,2,true)+" €";
	window.document.getElementById("DP3").innerHTML=formatZahl(document.getElementById("Gross").value*1.45,2,true)+" €";
	window.document.getElementById("DP4").innerHTML=formatZahl(document.getElementById("Maxi").value*2.20,2,true)+" €";
	window.document.getElementById("DP5").innerHTML=formatZahl(document.getElementById("EE").value*2.05,2,true)+" €";
	window.document.getElementById("DP6").innerHTML=formatZahl(document.getElementById("UER").value*5.65,2,true)+" €";
	window.document.getElementById("DP7").innerHTML=formatZahl(document.getElementById("PZA").value*3.85,2,true)+" €";
	window.document.getElementById("DP8").innerHTML=formatZahl(document.getElementById("Postkarte").value*0.45,2,true)+" €";
	
	window.document.getElementById("RKGesamt").innerHTML=formatZahl(((document.getElementById("Standard").value*0.45)+(document.getElementById("Kompakt").value*0.75)+(document.getElementById("Gross").value*1.20)+(document.getElementById("Maxi").value*1.70)+(document.getElementById("EE").value*1.73)+(document.getElementById("UER").value*3.56)+(document.getElementById("PZA").value*2.52)+(document.getElementById("Postkarte").value*0.40)),2,true)+" €*";
	window.document.getElementById("DPGesamt").innerHTML=formatZahl(((document.getElementById("Standard").value*0.55)+(document.getElementById("Kompakt").value*0.90)+(document.getElementById("Gross").value*1.45)+(document.getElementById("Maxi").value*2.20)+(document.getElementById("EE").value*2.05)+(document.getElementById("UER").value*5.65)+(document.getElementById("PZA").value*3.85)+(document.getElementById("Postkarte").value*0.45)),2,true)+" €";
	
}

function formatZahl(zahl, k, fix) { 
    if(!k) k = 0; 
    var neu = ''; 
  
	var dec_point = '.'; 
	var thousands_sep = ','; 
  
    var f = Math.pow(10, k); 
    zahl = '' + parseInt(zahl * f + (.5 * (zahl > 0 ? 1 : -1)) ) / f ; 
  
    var idx = zahl.indexOf('.'); 
  
    if(fix)    { 
         zahl += (idx == -1 ? '.' : '' ) 
         + f.toString().substring(1); 
    } 
	var sign = zahl < 0; 
	if(sign) zahl = zahl.substring(1); 
    idx = zahl.indexOf('.'); 
  
    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; 
} 

