<!-- //Dateiname:brago.js
language="JavaScript"
// Konstanten für Gebühren 
var cMWSTSatz=0.16;
var cbMWST=0;
// deutsche Patente:
var cSW=20000;

function Geld(g)
{
//alert("Geld");
g=(Math.round(g*100))/100;
var st='';
if (g<0) { st+='-'; g=-g; };
var fg=Math.floor(g);
st+=fg; st+='.'; 
var cent=Math.floor((g-fg)*100+0.5);
//alert("cent"+cent);
if (cent<10) {st+="0";};
return (st+cent);
} // Geld


function fBragoSW(fSW)
{
//alert("fBragoSW, fSW:"+fSW);
if (fSW<=300)
	{ return 25; }
else
	{
	if (fSW<=1500)
		{ return (25+20*Math.ceil( (fSW-300) / 300 ) ); }
	else 
		{ 
		if (fSW<=5000)
			{ return (105+28*Math.ceil((fSW-1500)/500)); }
		else
			{
			if (fSW<=10000)
				{ return (301+37*Math.ceil((fSW-5000)/1000)); }
			else
				{
				if (fSW<=25000)
					{ return (486+40*Math.ceil((fSW-10000)/3000)); }
				else 
					{ 
					if (fSW<=50000)
						{ return (686+72*Math.ceil((fSW-25000)/5000)); }
					else
						{
						if (fSW<=200000)
							{ return (1046+77*Math.ceil((fSW-50000)/15000)); }
						else 
							{
							if (fSW<=500000)
								{ return (1816+118*Math.ceil((fSW-200000)/30000)); }
							else
								{ return (2996+150*Math.ceil((fSW-500000)/50000)); }
							}
						}
					}
				}
			}
		}
	}
alert("Fehler in W olf gan ghell mich, fSWfBragoSW");
} // function fBragoSW(fSW)


function fGkgSW(fSW)
{
//alert("W olf gan ghell mich, fSW:"+fSW);
if (fSW<=300)
	{ return 25; }
else
	{
	if (fSW<=1500)
		{ return (25+10*Math.ceil( (fSW-300) / 300 ) ); }
	else 
		{ 
		if (fSW<=5000)
			{ return (65+8*Math.ceil((fSW-1500)/500)); }
		else
			{
			if (fSW<=10000)
				{ return (121+15*Math.ceil((fSW-5000)/1000)); }
			else
				{
				if (fSW<=25000)
					{ return (196+23*Math.ceil((fSW-10000)/3000)); }
				else 
					{ 
					if (fSW<=50000)
						{ return (311+29*Math.ceil((fSW-25000)/5000)); }
					else
						{
						if (fSW<=200000)
							{ return (456+100*Math.ceil((fSW-50000)/15000)); }
						else 
							{
							if (fSW<=500000)
								{ return (1456+150*Math.ceil((fSW-200000)/30000)); }
							else
								{ return (2956+150*Math.ceil((fSW-500000)/50000)); }
							}
						}
					}
				}
			}
		}
	}
} // function fGkgSW(fSW)

function fInitBrago()
{
//alert("InitBrago");
window.document.Rechner.StreitW.value=cSW;
window.document.Rechner.bMWST.checked=cbMWST;
window.document.Rechner.BragoF.value=2;
window.document.Rechner.GkgF.value=2;
fBragoUpdate();
} //function fInitBrago()

function fBragoUpdate()
{
//x=1
//alert("fBragoUpdate()");
var fSW;
//var y;
//var fArbeit;
// cop+ir4eit-wo lfg#an*g  hE@llm.ich
fSW=window.document.Rechner.StreitW.value;
//alert("x:"+x);

fBragoG=fBragoSW(fSW);
window.document.Rechner.BragoG.value=fBragoG;
fGkgG=fGkgSW(fSW);
window.document.Rechner.GkgG.value=fGkgG;

fBragoF=window.document.Rechner.BragoF.value;
fGkgF=window.document.Rechner.GkgF.value;

fBragoP=fBragoG*fBragoF;
//alert("fBragoP:"+fBragoP);
window.document.Rechner.BragoP.value=Geld(fBragoP);
//alert("fBragoP:"+fBragoP);
fGkgP=fGkgG*fGkgF;
window.document.Rechner.GkgP.value=Geld(fGkgP);

if (window.document.Rechner.bMWST.checked)
	{ 
	fMWST = fBragoP*cMWSTSatz;
	window.document.Rechner.MWST.value=Geld(fMWST);
	}
else
	{
	fMWST= 0;
	window.document.Rechner.MWST.value="";
	}

fSum=fBragoP+fMWST+fGkgP;
window.document.Rechner.Sum.value=Geld(fSum);
//alert("hallo3");
} //fBragoUpdate()



// -->

