$(document).ready(function() {

	//------- Google Maps ---------//
	
  // Create an array of styles.
  var cmdStyles = [
    {
    featureType: "landscape",
	 elementType: "geometry",
    stylers: [
      { saturation: -100 },
      { lightness: -94 }
    ]
  },{
    featureType: "poi",
	elementType: "geometry",
    stylers: [
      { hue: "#00ddff" },
      { saturation: -95 },
      { lightness: -83 }
    ]
  },{
    featureType: "road",
	 elementType: "geometry",
    stylers: [
      { hue: "#ffcc00" },
      { saturation: 99 },
      { lightness: -46 }
    ]
  },{
    featureType: "transit",
	elementType: "geometry",
    stylers: [
      { hue: "#ffe500" }
    ]
  },{
    featureType: "water",
	elementType: "geometry",
    stylers: [
      { hue: "#00ff5e" },
      { saturation: -99 },
      { lightness: -70 }
    ]
  },{
    elementType: "labels",
    stylers: [
      { invert_lightness: true },
      { saturation: -99 },
      
      ]
    }, {
    featureType: "administrative",
	 elementType: "geometry",
    stylers: [
      { invert_lightness: true }
    ]
  },{
  }
  ];

  // Create a new StyledMapType object, passing it the array of styles,
  // as well as the name to be displayed on the map type control.
  var cmdType = new google.maps.StyledMapType(cmdStyles,
    {name: "CMD Theme"});
	
		  
	// Creating a LatLng object containing the coordinate for the center of the map
	var latlng = new google.maps.LatLng(-20.272835,148.714907);
	  
	// Creating an object literal containing the properties we want to pass to the map  
	var options = {  
		zoom: 15, // This number can be set to define the initial zoom level of the map
		center: latlng,
		mapTypeControlOptions: {
      mapTypeIds: [google.maps.MapTypeId.ROADMAP, 'cmd']
    }// This value can be set to define the map type ROADMAP/SATELLITE/HYBRID/TERRAIN
	};  
	// Calling the constructor, thereby initializing the map  
	var map = new google.maps.Map(document.getElementById('map_div'), options);  
	
	// Define Marker properties
	var image = new google.maps.MarkerImage('images/cmd-map-marker.png',
		// This marker is 129 pixels wide by 42 pixels tall.
		new google.maps.Size(130, 74),
		// The origin for this image is 0,0.
		new google.maps.Point(0,0),
		// The anchor for this image is the base of the flagpole at 18,42.
		new google.maps.Point(18, 42)
	);
	
	

	
	// Add Marker
	var marker1 = new google.maps.Marker({
		position: new google.maps.LatLng(-20.271573,148.714027), 
		map: map,		
		icon: image // This path is the custom pin to be shown. Remove this line and the proceeding comma to use default pin
	});	
	
	// Add listener for a click on the pin
	google.maps.event.addListener(marker1, 'click', function() {  
		infowindow1.open(map, marker1);  
	});
		
	// Add information window
	var infowindow1 = new google.maps.InfoWindow({  
		content:  createInfo('Curious Media Development', '26 Nara Av,<br />Airlie Beach,<br />QLD 4802 AUS<br /><a href="http://www.curiousconcepts.com" title="Click to view our website">Our Website</a>')
	}); 
	
	map.mapTypes.set('cmd', cmdType);
    map.setMapTypeId('cmd');
	

	
	// Create information window
	function createInfo(title, content) {
		return '<div class="infowindow"><strong>'+ title +'</strong><br />'+content+'</div>';
	} 

});



