﻿/*
key: ABQIAAAA7-HU7lBkHuNMP1nLMg3jyhRSioOL1srEonO3onU_VMhC8rNP1BQqhPmFLCHFRcDqj7hs4JqsZNcdPQ for Url http://www.reisebuero-nitzsche.de/
api here: http://www.google.com/apis/maps/
adresse in laenge und breite umrechnen: http://www.netzwelt.de/geocoding/index.html
*/


google.load("maps", "2.x");
function initialize() {
	if (GBrowserIsCompatible()) {
		var map = new GMap2(document.getElementById("map"));
		// map.addControl(new GMapTypeControl());
		// map.addControl(new GLargeMapControl());
		//map.disableDragging();
		map.setMapType(G_NORMAL_MAP);

		var center = new GLatLng(25, 20);
		map.setCenter(center, 1);

		for (var name in ytfMembers) {
			var icon = new GIcon();
			icon.image = ytfMembers[name]['image'];
			icon.iconSize = new GSize(75, 75);
			icon.iconAnchor = new GPoint(16, 16);
			icon.infoWindowAnchor = new GPoint(25, 7);
			
			var position = new GLatLng(ytfMembers[name]['lat'] + 10, ytfMembers[name]['lng'] - 10);
			var marker = new GMarker(position, {title: ytfMembers[name]['name'], icon: icon, draggable: false, link: ytfMembers[name]['link']});
			GEvent.addListener(marker, "mouseover", function() {
			//	this.openInfoWindow("Name: "  + this.getTitle());
			});
			GEvent.addListener(marker, "mouseout", function() {
			//	this.closeInfoWindow();
			});
			GEvent.addListener(marker, "click", function() {
				window.location = ytfMembers[this.getTitle()]['link'];
			});
			  
			map.addOverlay(marker);
		}
	} else {
		document.getElementById("map").innerHTML = "Your old browser doesn't support Google Maps.";
	}
}
  
google.setOnLoadCallback(initialize);