function loadLocationMap() {
  if (GBrowserIsCompatible()) {

	  // Display the map, with some controls and set the initial location 
	  var map = new GMap2(document.getElementById("map"));
	  map.addControl(new GLargeMapControl());
	  map.addControl(new GMapTypeControl());
	  map.setCenter(new GLatLng(-34.62159, 150.702896), 9);
	
	  // Set up markers with info windows 
	
	  var point = new GLatLng(-34.62159, 150.702896);
      var html = '';
      html += '<div style="width:240px; padding: 0; margin: 0 0 -0px 0;">';
      html += '<h4>Illawarra Fly</h4>';
      html += '<p>182 Knights Hill Rd,<br/> Knights Hill NSW <br>Phone 1300 362 881</p>';
      html += '<p><a href="http://maps.google.com.au/" id="directions_map_link" onclick="clicky(this); return false;">Get Directions to Illawarra Fly</a></p>';
      html += '<form action="http://maps.google.com/maps" method="get" target="_blank" id="frmMapDirections" style="display:none;"> <p><strong>Enter your starting address:</strong><input name="saddr" type="text" /> <input name="daddr" value="182 Knights Hill Rd, Knights Hill NSW" type="hidden" /> <input value="Go" type="submit" /></p> </form>';
      html += '</div>';
	  var marker = createMarker(point,html);
	  map.addOverlay(marker);
	}
}

function clicky($this){
    $($this).parent().hide();
    $('#frmMapDirections').show();
    $('#frmMapDirections').submit(function(){
      var href = $(this).attr('action') + '?' + $(this).serialize();
      window.open('', 'mapWindow', 'toolbar=1,resizable=1,scrollbars=1,left=50,top=50,width=900,height=550');
      $(this).attr("target", "mapWindow");
    });
}

$(function(){
    $('#frmDirections').submit(function(){
      var href = $(this).attr('action') + '?' + $(this).serialize();
      window.open('', 'mapWindow', 'toolbar=1,resizable=1,scrollbars=1,left=50,top=50,width=900,height=550');
      $(this).attr("target", "mapWindow");
    });
});

  function createMarker(point,html) {
    var marker = new GMarker(point);
    GEvent.addListener(marker, "click", function() {
      marker.openInfoWindowHtml(html);
    });
    return marker;
  }
  
  $(function(){

  });
