// JavaScript Document

// Google Maps
function load(niederlassung) {

	document.getElementById("map").style.display = "block";
	
	if (GBrowserIsCompatible()) {
		var map = new GMap2(document.getElementById("map"));
		map.setMapType(G_SATELLITE_MAP);
		map.addControl(new GLargeMapControl());
		map.addControl(new GMapTypeControl());
		map.addControl(new GOverviewMapControl());
        map.setCenter(new GLatLng(47.368829, 8.558382), 18);
		// Creates a marker at the given point with the given number label
		function createMarker(point, number) {
		var marker = new GMarker(point);
		GEvent.addListener(marker, "click", function() {
			marker.openInfoWindowHtml("<b>Krepper Knecht Partner</b><br>Dr. iur. Antoine F. Goetschel<br>Sophienstrasse 2<br>CH-8032 Z&uuml;rich");
		});
		return marker;
	}
	
	 var point = new GLatLng(47.368829, 8.558382);
  	 
	 map.addOverlay(createMarker(point, 1));	
}
}

function formcheck( thisform ){
		
	if ( thisform.vorname.value == "" ){
		alert( "Fehler - Vorname" );
		thisform.vorname.focus();
		return false;
	}				

	if ( thisform.nachname.value == "" ){
		alert( "Fehler - Nachname" );
		thisform.nachname.focus();
		return false;
	}

	if ( thisform.email.value == "" ){
		alert( "Fehler - E-mail" );
		thisform.email.focus();
		return false;
	}
	
	if(thisform.email.value.indexOf("@") == -1 || thisform.email.value.indexOf(".") == -1){
		alert( "Fehler - E-mail" );
		thisform.email.focus();
		return false;
	}
	
	return true;
	
}

function formcheck_en( thisform ){
		
	if ( thisform.vorname.value == "" ){
		alert( "Error - First name" );
		thisform.vorname.focus();
		return false;
	}				

	if ( thisform.nachname.value == "" ){
		alert( "Error - Last name" );
		thisform.nachname.focus();
		return false;
	}

	if ( thisform.email.value == "" ){
		alert( "Error - E-mail" );
		thisform.email.focus();
		return false;
	}
	
	if(thisform.email.value.indexOf("@") == -1 || thisform.email.value.indexOf(".") == -1){
		alert( "Error - E-mail" );
		thisform.email.focus();
		return false;
	}
	
	return true;
	
}