

var homeMap = {

   initializeHomeMap : function() {
    	latlng = new google.maps.LatLng(24,13);
    	homeMap.mapOptions = {
     	zoom: 1,
     	center: latlng,
     	mapTypeId: google.maps.MapTypeId.ROADMAP,
     	mapTypeControl: false
		};

     homeMap.map = new google.maps.Map(document.getElementById("worldmap"), homeMap.mapOptions)
    },


	loadMarkers : function() {
		if(homeMap.map)
		{
	//alert('map loaded');
		  homeMap.setMarkers(homeMap.map);
		 }
	},

	setMarkers : function(map) {
  
		jQuery.ajax({
				type: "GET",
				url: "javascript/guides.js",
				dataType: "json",
				success: function(json){
					//alert( "Data: " + json );
						jQuery.each(json,function(i,item) {  
  
							   var currentLatLng = new google.maps.LatLng(item.lat, item.lon);
    //console.log(item.href)
								 var image = 'skin/img_pin16.png';
    
    							var marker = new google.maps.Marker({
        						position: currentLatLng,
        						map: map,
        						title: item.name,
								icon: image
        						});   
        						
								google.maps.event.addListener(marker, 'click', function() {
									window.location = item.href;
								});
        						
        						
						});

				}
		})
	}

};
