// ---------------------------- =Maps
 (function() {
  var stylez = [
    { featureType: "administrative", elementType: "all", stylers: [ { hue: "#1186ca" },{ saturation: -100 } ] },
    { featureType: "landscape", elementType: "all", stylers: [ { hue: "#1186ca" },{ saturation:-100 } ] },
    { featureType: "poi", elementType: "all", stylers: [ { hue: "#1186ca" },{ saturation:-50 } ] },
    { featureType: "road", elementType: "all", stylers: [ { hue: "#000000" },{ saturation:-100 } ] },
    { featureType: "transit", elementType: "all", stylers: [ { hue: "#1186ca" },{ saturation:-50 } ] },
    { featureType: "water", elementType: "all", stylers: [ { hue: "#1186ca" },{ saturation:0 } ] }
  ];

  var positions = {
    mapfreiberg: [new google.maps.LatLng(50.92225,13.32603), new google.maps.LatLng(50.935606,13.330364)]
  };
  var myOptions = {
    zoom: 13,
    center: positions.mapfreiberg[1],
		scrollwheel: true,
    mapTypeId: google.maps.MapTypeId.ROADMAP
  };
  var map = new google.maps.Map(document.getElementById("mapfreiberg"), myOptions);
  var styledMapOptions = { name: "Grayscale" };
  var gsMapType = new google.maps.StyledMapType(stylez, styledMapOptions);
  map.mapTypes.set('grayscale', gsMapType);
  map.setMapTypeId('grayscale');

  var myInfoWindow = new google.maps.InfoWindow();
	var marker = new google.maps.Marker({ position: positions.mapfreiberg[0], map: map, animation: google.maps.Animation.DROP });
	
  $('.map nav a').click(function(e) {
    e.preventDefault();
		myInfoWindow.close();
    $('.map nav a').removeClass('selected');
    $(this).addClass('selected');
    var c = positions[$(this).attr('rel')];
    map.setCenter(c[1]);
    marker.setPosition(c[0]);
  });

	var myWindowOptions = {
		content: '<strong> A&D Heiz- und Trockenger&auml;te <br />Mietservice GmbH </strong><br/>Hainichener-Stra&szlig;e 73 <br />09599 Freiberg/Sachsen <br/>Tel.: 03731 207 615 9'
	};
	

			myInfoWindow = new google.maps.InfoWindow(myWindowOptions);
			myInfoWindow.open(map,marker);


	
})();
