function sucheVal(obj, unique)
{
	if (obj["plz_"+unique].value && isNaN(obj["plz_"+unique].value))
	{
		obj["plz_"+unique].style.color="red";
		alert ('Das ist keine Zahl.');
		return false;
	}
	else
	{
		obj["plz_"+unique].style.color="#5B5959";
	}
	if (obj["plz_"+unique].value && obj["plz_"+unique].value.length < 2)
	{
		obj["plz_"+unique].style.color="red";
		alert ('Bitte geben Sie mindestens die ersten zwei Stellen der Postleitzahl ein.');
		return false;
	}
	else
	{
		obj["plz_"+unique].style.color="#5B5959";
	}
	
	var rx = new RegExp("[^0-9a-zäöüßA-ZÄÖÜ.,-/ ]");
	if (rx.test(obj["ort_"+unique].value) == true)
	{
		obj["ort_"+unique].style.color = 'red';
		alert('Ihre Eingabe wird nicht akzeptiert.\nBitte verwenden Sie ausschließlich Alphanumerische Zeichen sowie .,-/');
		return false;
	}
	else
	{
		obj["ort_"+unique].style.color="#5B5959";
	}
	if (rx.test(obj.stichwort.value) == true)
	{
		obj.stichwort.style.color = 'red';
		alert('Ihre Eingabe wird nicht akzeptiert.\nBitte verwenden Sie ausschließlich Alphanumerische Zeichen sowie .,-/');
		return false;
	}
	else
	{
		obj.stichwort.style.color="#5B5959";
	}
	
	if (obj.umkreis.value && isNaN(obj.umkreis.value))
	{
		obj.umkreis.style.color="red";
		alert ('Das ist keine Zahl.');
		return false;
	}
	else
	{
		obj.umkreis.style.color="#5B5959";
	}
	if (obj.umkreis.value && (obj.umkreis.value<1 || obj.umkreis.value>50))
	{
		obj.umkreis.style.color="red";
		alert ('Bitte wählen Sie einen Umkreis zwischen 1 und 50 KM.');
		return false;
	}
	else
	{
		obj.umkreis.style.color="#5B5959";
	}
	//return false;
}

function mouseoverimg (obj)
{
	obj = document.getElementById(obj);
	if (obj.src.indexOf('_o') == -1)
	{
		file = obj.src.replace(/(\.gif|jpg|jpeg|png)/, '_o$1');
		document.getElementById(obj.id).src = file;
	}
}
function mouseoverimgoff (obj)
{
	obj = document.getElementById(obj);
	if (obj.src.indexOf('_o') > -1)
	{
		file = obj.src.replace(/_o/, '');
		document.getElementById(obj.id).src = file;
	}
}
/* helpBox */
function remove(vater, kind)
{
	var node = document.getElementById(kind);
	document.getElementById(vater).removeChild(node);
}
function kreissuche(suche)
{
	suche ? hreff = suche : hreff = "suche";
	if (document.suchForm && document.suchForm.kat.options[document.suchForm.kat.selectedIndex].value > 0)
	{
		hreff+="-"+document.suchForm.kat[document.suchForm.kat.selectedIndex].value;
	}
	else if (document.katform.kat && document.katform.kat.value != '')
	{
		hreff+="-"+document.katform.kat.value;
	}
	document.location.href=hreff+".html";
	return false;
}
function plzsuche(suche)
{
	suche ? hreff = "plzsuche"+suche : hreff = "plzsuche";
	if (document.suchForm && document.suchForm.kat.options[document.suchForm.kat.selectedIndex].value > 0)
	{
		hreff+="-"+document.suchForm.kat[document.suchForm.kat.selectedIndex].value;
	}
	else if (document.katform.kat && document.katform.kat.value != '')
	{
		hreff+="-"+document.katform.kat.value;
	}
	document.location.href=hreff+".html";
	return false;
}
function switchText(name)
{
	if( window.document.getElementById("kreisnameOben"))
	{
		window.document.getElementById("kreisnameOben").firstChild.data=name;
	 	if (window.innerHeight < 700)
	 	{
			window.document.getElementById("kreisnameUnten").firstChild.data=name;
		}
	}

}
function restoreText()
{
	if( window.document.getElementById("kreisnameOben"))
	{
		window.document.getElementById("kreisnameOben").firstChild.data="";
		window.document.getElementById("kreisnameUnten").firstChild.data="";
	}
}
function deleteText()
{
	if( window.document.getElementById("kreisnameOben"))
	{
		window.document.getElementById("kreisnameOben").firstChild.data="";
		window.document.getElementById("kreisnameUnten").firstChild.data="";
	}
}

function winOpen(id, width, height)
{
		 width=width+40;
		 height=height+40;
		 window.open('referenzen.php?id=' + id + '', '', 'width='+ width +',height='+ height +',scrollbars=yes');
}