neues_Fenster = null;


var gut = 0;
function loadit()
{
	
	if (document.images)
	{
		
		pics_on = new Array();
		
		for(i=0; i <= 15; i++)
		{
			if(i < 10)
			{
				id = '0'+i;
			}
			else
			{
				id = i;
			}
			pics_on[i] = new Image();
	   	pics_on[i].src = "/pics/menu_" + id + "_on.gif";
		}		
		gut = 1;
	}
}
	

function hi(id)
{

   if (document.images && gut == 1)
   {
   	name = 'men' + id;
      document[name].src= "/pics/menu_" + id + "_on.gif";
   }
}



function ho(id)
{
   if (document.images && gut == 1)
   {
   	name = 'men' + id;
      document[name].src= "/pics/menu_" + id + "_of.gif";
   }
}

function writem(u)
{
	ma = 'ma';
	a = '@';
	document.write('<a href="' + ma + 'ilto:' + u + a + 're-' + 'natur-hvl.' + 'de">' + u + a + 're-' + 'natur-hvl.' + 'de</a>');
}


function makeDecimal(ref, id, dec)
{
	wert = ref.value;
	wert = Number(wert.replace(',', '.'));
	//Biodephos
	if(isNaN(wert))
	{
		wert = 1;
	}
	else
	{
		comma = Math.pow(10, dec);
		wert = Math.round(wert * comma)/ comma;
	}	
	ref.value = wert;	
	calcResult(id);	
		
}

function calcResult(id)
{
	//Biodephos
	if(id == 555)
	{
		keyKon = 'konzentration' + id;
		keyWasser = 'wasser' + id;
		keyAnzahl = 'anzahl' + id;	
		konzentration = parseFloat(document.getElementById(keyKon).value);
		wasser = parseFloat(document.getElementById(keyWasser).value);
		if(konzentration > 0 && wasser > 0)
		{
			entfernen = konzentration * wasser * 1000;
			liter = Math.ceil(entfernen / 6500);
			document.getElementById('result555').innerHTML = 'Sie benötigen ' + liter + ' Liter Biodephos.';
			document.getElementById(keyAnzahl).value = liter;
		}
	}
	else
	{
		keyBreite = 'breite' + id;
		keyLaenge = 'laenge' + id;
		keyAnzahl = 'anzahl' + id;	
		breite = parseFloat(document.getElementById(keyBreite).value);
		laenge = parseFloat(document.getElementById(keyLaenge).value);
		document.getElementById(keyAnzahl).value = Math.round(breite *laenge);
	}
	
}


fenster = null;

function show(Bild0,Breite0,Hoehe0)
{	
	Bild = Bild0;
	Breite = Breite0;
	Hoehe = Hoehe0;
	weg();
	setTimeout("top(Bild,Breite,Hoehe)",500);
}

function top(Bild,Breite,Hoehe)
{  
    fBreite=Breite+30;
	fHoehe=Hoehe+30;
	Optionen = 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,height='+fHoehe+',width='+fBreite+'';
	fenster = window.open(Bild,'Foto',Optionen);
	with (fenster) 
   {
      document.writeln('<HTML><HEAD><TITLE>Gro&szlig;es Foto</TITLE></HEAD>');
      document.writeln('<BODY BGCOLOR="#ffffff"><Center>');
      document.writeln('<IMG SRC="/'+Bild+'" WIDTH="'+Breite+'" HEIGHT="'+Hoehe+'" BORDER="0" ALT="Foto">');
      document.writeln('</Center></BODY></HTML>');
   }
}

function weg()
{
    if (fenster != null)
	{
		if (!fenster.closed)
		{
			fenster.close();
		}
	}
}


function showSearchOptions(status)
{
	if(status == 1)
	{
		document.getElementById('searchoptions').style.visibility = "visible";
		document.getElementById('optionswitch').innerHTML = '<a href="Javascript:showSearchOptions(0)"  onClick="showSearchOptions(0); return false">-Suchoptionen</a>';
	}
	else
	{
		document.getElementById('searchoptions').style.visibility = "hidden";
		document.getElementById('optionswitch').innerHTML = '<a href="Javascript:showSearchOptions(1)" onClick="showSearchOptions(1); return false">+Suchoptionen</a>';
	}
}


