function addLocation(mode)
{
	var href = "search.php?mode=" + mode;
    var f = document.forms["Search"];
    if (f) {
		var loc = f.elements["location"].value;
		if (loc != "")
			href += "&location=" + loc;
	}
    window.location.href = href;
}

function newFenster(page,name,w,h,scroll,resize){
	leftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	topPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings = 'height='+h+',width='+w+',top='+topPosition+',left='+leftPosition+',scrollbars='+scroll+',resizable='+resize+''
	window.open(page,name,settings);
}

function hoverEffectOn(e,img,w,h) {
	e.style.backgroundColor = '#F7F7F7';
	document.images[img].src = 'layout/images/visitenkarte_big.gif';
	document.images[img].width = w;
	document.images[img].height = h;
}
function hoverEffectOut(e,img,w,h) {
	e.style.backgroundColor = 'white';
	document.images[img].src = 'layout/images/visitenkarte_small.gif';
	document.images[img].width = w;
	document.images[img].height = h;
}

onload = function() {
    var f = document.forms["Search"];
    if (f)
       f.elements["location"].focus();
}

function checkEmail(but) 
{
	var myForm = but.form;
	
	if(myForm.user.value == "")
	{
	     alert("Bitte geben Sie Ihren Namen ein!");
	     myForm.user.focus();
	     return false;
	}
		
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm.email.value) == false)
	{
	    alert("Ihre Email-Adresse ist syntaktisch falsch!\nBitte überprüfen Sie Ihre Angaben.");
		myForm.email.focus();
		return (false);
	}

    but.value = "Vielen Dank!";
    myForm.submit();
}

