// JavaScript map

// JavaScript Document

//<![CDATA[
//	function load() {
//			if (GBrowserIsCompatible()) {
//					function createMarker(point,html,icon) {
//							var marker = new GMarker(point,icon);
//							GEvent.addListener(marker, "click", function() {
//							marker.openInfoWindowHtml(html);
//							});
//							
//							
//					return marker;
//					}
//					
//					var map = new GMap2(document.getElementById("map2"));
//					map.setCenter(new GLatLng(43.78712359666325, 11.23626708984375), 7);
//					map.addControl(new GSmallMapControl());
//					map.addControl(new GScaleControl());
//					map.enableScrollWheelZoom(true);
//					map.addMapType(G_SATELLITE_MAP);
//					//***********************
//					var myIcon = new GIcon(G_DEFAULT_ICON, "http://www.ex3.it/tmpl/ex3/images/marker.png", null , "http://www.ex3.it/tmpl/ex3/images/ombra.png");
//					myIcon.iconSize=new GSize(33,40);
//					myIcon.shadowSize=new GSize(52,35);
//					var point = new GLatLng(43.75676071554622, 11.288301944732666);
//					htmlMarker = '<img src="http://www.ex3.it/tmpl/ex3/images/map.jpg">';
//
//					var marker = createMarker(point,htmlMarker,myIcon)
//					map.addOverlay(marker);
//									
//          
//							}
//	}
//	

				  function load(){


								   if (GBrowserIsCompatible()) {

												  // Init a new map
												  var map = new GMap2(document.getElementById('map2'));
												  map.addControl(new GSmallMapControl());
												  map.setCenter(new GLatLng(43.78712359666325, 11.23626708984375), 7);
								         		  map.addControl(new GScaleControl());
											      map.enableScrollWheelZoom(true);
												  map.addMapType(G_SATELLITE_MAP);
												  
												  // Creating a new marker
												var myIcon = new GIcon(G_DEFAULT_ICON, "http://www.ex3.it/tmpl/ex3/images/marker.png", null , "http://www.ex3.it/tmpl/ex3/images/ombra.png");
												myIcon.iconSize=new GSize(33,40);
												myIcon.shadowSize=new GSize(52,35);

												
												var point = new GLatLng(43.75676071554622, 11.288301944732666);
												var marker = new GMarker(new GLatLng(43.75676071554622, 11.288301944732666),myIcon)

												  // Adding a click-event to the marker

												  GEvent.addListener(marker, 'click', function() {

														  var tabs = [];
														  tabs.push(new GInfoWindowTab('Main Info', '<div style="min-height:350px"><img src="http://www.ex3.it/tmpl/ex3/images/map.jpg"></div>'));
														  tabs.push(new GInfoWindowTab('Bus Line', '<div style="min-height:350px"><img src="http://www.ex3.it/tmpl/ex3/images/map2.jpg"></div>'));
														  marker.openInfoWindowTabsHtml(tabs);

												  });
											  

												  // Add marker to map

												  map.addOverlay(marker);

								   }

				   }                                              



	//]]>
