function rechne()
	{
	ergebnis = 0;
	format = window.document.formular.format.options[document.formular.format.selectedIndex].value;
	xpix = window.document.formular.xpix.value;
	ypix = window.document.formular.ypix.value;
	if ((xpix != "") && (ypix != ""))
		format = xpix*ypix;
	bits = window.document.formular.bits.options[window.document.formular.bits.selectedIndex].value;
	if (bits == 10)
		bits = 10*32/30
	rgbyuv = window.document.formular.rgbyuv.options[window.document.formular.rgbyuv.selectedIndex].value;
	bilder = window.document.formular.bilder.options[window.document.formular.bilder.selectedIndex].value;
	framesfree = window.document.formular.framesfree.value;
	bildart= window.document.formular.bildart.options[window.document.formular.bildart.selectedIndex].value;
	speicher= window.document.formular.speicher.value;
	zeiteinheit=window.document.formular.zeiteinheit.options[window.document.formular.zeiteinheit.selectedIndex].value;
	
	if (framesfree != "")
		{
		//window.document.formular.bilder.value="";
		//window.document.formular.bildart.value="";
		bilder = framesfree;
		bildart = window.document.formular.bildart2.value;
		}
	switch(window.document.formular.rate.options[window.document.formular.rate.selectedIndex].value)
		{
		case "gb": rate=eval(1/8/1000/1000/1000); break;
		case "gbit": rate=eval(1/1000/1000/1000); break;
		case "mb": rate=eval(1/8/1000/1000); break;
		case "mbit": rate=eval(1/1000/1000); break;
		case "kb": rate=eval(1/8/1000); break;
		case "kbit": rate=eval(1/1000); break;
		case "byte": rate=eval(1/8); break;
		case "bit": rate=1; break;
		}
	ergebnisdata = (Math.round(100*format*bits*rgbyuv*bilder*rate*bildart))/100;
	
	switch(window.document.formular.gbmb.options[window.document.formular.gbmb.selectedIndex].value)
		{
		case "gb": rate=eval(1/8/1000/1000/1000); break;
		case "mb": rate=eval(1/8/1000/1000); break;	
		}
	switch(window.document.formular.zeiteinheit.options[window.document.formular.zeiteinheit.selectedIndex].value)
		{
		case "std": zeit=eval(1/3600); break;
		case "min": zeit=eval(1/60); break;
		case "sek": zeit=1; break;
		}
	if (zeit==1) //Wenn es sich um Sekunden handelt
		{
		ergebniszeit = Math.round(speicher/(format*bits*rgbyuv*bilder*rate*bildart)*zeit);
		}
	else
		{
		ergebniszeit = (speicher/(format*bits*rgbyuv*bilder*rate*bildart)*zeit);
		}
	ergebnis_sek = (speicher/(format*bits*rgbyuv*bilder*rate*bildart));
	
	if (Math.floor(ergebniszeit) < ergebniszeit)
		{
		minuten=(ergebnis_sek-(Math.floor(ergebnis_sek/60)*60));
		if (zeit==(1/3600))
			{
			min2=(Math.floor((ergebniszeit-Math.floor(ergebniszeit))/zeit/60));
			sekunden=(minuten-(Math.floor(minuten/60)*60));
			ergebniszeit=Math.floor(ergebniszeit) + " : " + Math.round(min2) + " : " + Math.round(sekunden);
			}
		else
			{
			ergebniszeit=Math.floor(ergebniszeit) + " : " + Math.round(minuten);
			}
		}
	window.document.formular.spieldauer.value = ergebniszeit;
	window.document.formular.ergebnis.value = ergebnisdata;
	}

function vorrang_format()
	{
	window.document.formular.xpix.value="";
	window.document.formular.ypix.value="";
	}
	
function vorrang_xy()
	{
	window.document.formular.format.value="0";
	}
	
function vorrang_bilder()
	{
	window.document.formular.framesfree.value="";
	window.document.formular.bildart2.value="0";
	}
	
function vorrang_framesfree()
	{
	window.document.formular.bilder.value="0";
	window.document.formular.bildart.value="0";
	}
