// JavaScript Document for the Google Map

function mapit(){
	
//<![CDATA[
	var zoomlvl = 4;
// Creates a marker whose info window displays the given number
	function createMarker(point, number) {
  		var marker = new GMarker(point);
/*
  // Show this marker's index in the info window when it is clicked
  var html = "<span style='font-family: arial; font-size: 10px'><strong>Saline Lectronics, Inc.</strong><br>710 N.Maple Rd.<br>Saline, MI 48176</span>";
 */

  		GEvent.addListener(marker, "click", function() {
			if(zoomlvl == 4) { map.centerAndZoom(point, 3); zoomlvl = 3;}
			else if(zoomlvl == 3) { map.centerAndZoom(point, 2); zoomlvl = 2;}
			else if(zoomlvl == 2) { map.centerAndZoom(point, 1); zoomlvl = 1;}
  			else if(zoomlvl == 1) { map.centerAndZoom(point, 4); zoomlvl = 4;}

  		}); 
  	return marker;
	}
    
	var map = new GMap(document.getElementById("map"));
	map.addControl(new GSmallMapControl());
	map.addControl(new GMapTypeControl());
	map.centerAndZoom(new GPoint(-83.741864, 42.277852), 3);
// Add 10 random markers in the map viewport
var bounds = map.getBoundsLatLng();
var width = bounds.maxX - bounds.minX;
var height = bounds.maxY - bounds.minY;
  var point = new GPoint(-83.741864, 42.277852);
  var marker = createMarker(point, 1);
  map.addOverlay(marker);
/*  var html = "<b>Saline Lectronics, Inc.</b><br>710 N.Maple Rd.<br>Saline, MI 48176";
  marker.openInfoWindowHtml(html); */
    //]]>

}

window.onload = mapit; 
window.onunload = GUnload;