<!-- Create a MenuMatic Instance -->
		window.addEvent('domready', function() {
			if($('nav')){
				var myMenu = new MenuMatic({ orientation:'vertical' });	
			}
			if($('map_canvas')){
				initialize();
			}
			if($('newsDate')){
				var myCal = new Calendar({ newsDate:'Y-m-d'});
			}
		});

//<!-- Create a calendar Instance -->
		/*window.addEvent('domready', function() {
			//Datepicker
				new vlaDatePicker('textbox-id');
			//Calendar
				new vlaCalendar('block-element-id');
		});*/

  		
//Googlemap
function initialize() {
	
    if (GBrowserIsCompatible()) {
		    var map = new GMap2(document.getElementById("map_canvas"));
		    map.setCenter(new GLatLng(-43.504132, 172.728432), 15);

		    // Add 10 markers to the map at random locations
		    		    
		      var latlng = new GLatLng(-43.505637, 172.724199);
		      map.addOverlay(new GMarker(latlng));
			  
			  			  
			  //this line removes the normal map option, allowing us to specify only satellite map view
				map.removeMapType(G_HYBRID_MAP);
				map.removeMapType(G_NORMAL_MAP);
		     
	}

}	  	  	
		
//form validation

function checkData(){
	var name = document.getElementById("name"); 
	var email = document.getElementById("email");
	var phone = document.getElementById("phone");
	
	
	if(name.value == "" || !isNaN(name.value)){  //check to see if field is empty or is a number
		alert("Please enter your name");
		name.focus();	//not valid, so set focus to correct field
		return false;  //stops the form being submitted
	}
	
	//you only get here if the name is valid
	else if (email.value == ""){  //check if email field is empty
		alert("Please enter your email");
		email.focus();  //set focus to email
		return false;	
	}
	
	
	//you only get here if the name is valid and an email address has been entered
	else if (phone.value == "" || isNaN(phone.value)){  //check if phone field is empty or not a number
		alert("Please enter your phone number");
		phone.focus();  //set focus to phone
		return false;	
	}
	
	
		return true;	//allows form to be submitted	

}
