function validate()
{
	var message="";
	var phoneExpression = /^\(?(\d{3})\)?[\.\-\/\s]?(\d{3})[\.\-\/\s]?(\d{4})$/;
        var emailExpression = /^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/;
	
	if (!document.registration.event.value)
	{
		if (message == "")
		{
			document.registration.firstName.focus();
		}
		message += "The event you are registering for\n"

	}
	
	if (!document.registration.firstName.value)
	{
		if (message == "")
		{
			document.registration.firstName.focus();
		}
		message += "First Name\n"

	}

	if (!document.registration.lastName.value)
	{
		if (message == "")
		{
			document.registration.lastName.focus();
		}
		message += "Last Name\n"

	}

	if (!document.registration.agency.value)
	{
		if (message == "")
		{
			document.registration.agency.focus();
		}
		message += "Agency Name\n"

	}

	if (!emailExpression.test(document.registration.email.value))
	{
		if (message == "")
		{
			document.registration.email.focus();
		}
		message += "a valid email address\n"
	}

	if (!phoneExpression.test(document.registration.phoneNumber.value))
	{
		if (message == "")
		{
			document.registration.phoneNumber.focus();
		}
		message += "Phone number with area code\n"
	}

	if (!message)
	{
		return true;
	}
	else
	{
		alert("The Following are missing or invalid:\n\n" + message);
		return false;
	}
}


function load() 
{
	if (GBrowserIsCompatible()) 
      {
		var map = new GMap2(document.getElementById("map"));
		map.addControl(new GSmallMapControl());
		map.addControl(new GMapTypeControl());
		map.setCenter(new GLatLng(43.3700, -80.3166), 13);


		function createMarker(point, number) 
		{
  			var marker = new GMarker(point);
 		      
			GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml("<font color='blue'><b>Social Planning Council<br> of Cambridge and North Dumfries</b><br><br>150 Main Street 2nd Floor<br>Cambridge, Ontario<br>N1R 6P9 </font>");});
  			
			return marker;
		}

		for (var i = 0; i < 1; i++) 
		{
  			var point = new GLatLng(43.3590, -80.3105);
  			map.addOverlay(createMarker(point, i + 1));
		}
      }
}
