// JavaScript Document

  function initialize() {
  
   
    var myOptions = {
      zoom: 12,
      center: cntr,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    };
    
	var map = new google.maps.Map(document.getElementById("map"), myOptions);
	
	var lesleyString = '<div id="content">'+
    '<h1><a href=lesley_chiles.php>Lesley Chiles</a></h1>'+
    '<div id="bodyContent">'+
    '<p>tel. 020 7096 0778</p>' +
    '<p>mob. 07858 139 734</p>'+
    '</div>'+
    '</div>';
	
	var michaelString = '<div id="content">'+
    '<h1><a href=michael_fairbairn.php>Michael Fairbarn</a></h1>'+
    '<div id="bodyContent">'+
    '<p>tel. 01727 766 955</p>' +
    '<p>mob. 07850 766 955</p>'+
    '</div>'+
    '</div>';
	
	var julieString = '<div id="content">'+
    '<h1><a href=julie_harding.php>Julie Harding</a></h1>'+
    '<div id="bodyContent">'+
    '<p>tel. 01923 268 572</p>' +
    '<p>mob. 07812 112 307</p>'+
    '</div>'+
    '</div>';
	
	var lesleyinfo = new google.maps.InfoWindow({
    content: lesleyString
	});
	var michaelinfo = new google.maps.InfoWindow({
    content: michaelString
	});
	var julieinfo = new google.maps.InfoWindow({
    content: julieString
	});
  
	var lesley = new google.maps.LatLng(51.702736, -0.617841);
	var michael = new google.maps.LatLng(51.7548, -0.3474);
	var julie = new google.maps.LatLng(51.71363,-0.44987);
	 
  	var image = 'images/pin.png';
	
  	var les = new google.maps.Marker({
      position: lesley, 
      map: map, 
      title:"Lesley Chiles",
	  icon: image
  	});
	
	var mic = new google.maps.Marker({
      position: michael, 
      map: map, 
      title:"Michael Fairbairn",
	  icon: image
  	});
	
	var jul = new google.maps.Marker({
      position: julie, 
      map: map, 
      title:"Julie Harding",
	  icon: image
  	});
	
	var boundary = new google.maps.Polyline({
    path: [lesley, michael, julie, lesley],
    strokeColor: "#003366",
    strokeOpacity: 0.5,
    strokeWeight: 5
  });

  boundary.setMap(map);
  
		  google.maps.event.addListener(les, 'click', function() {
		  lesleyinfo.open(map,les);
			});
		google.maps.event.addListener(mic, 'click', function() {
  		michaelinfo.open(map,mic);
		});
		google.maps.event.addListener(jul, 'click', function() {
		  julieinfo.open(map,jul);
			});
  
  }
