//icons
var recIcon = "images/tennis.png";
var shopIcon = "images/shoppings.png";
var attrIcon = "images/attractions.png";
var edIcon = "images/library.png";
var hospIcon = "images/building.png";
var vMarkers = new Array();
//recreation
vMarkers[0] = ["Riverfront Park", recIcon, 32.8696402, -79.9658425];
vMarkers[1] = ["Danny Jones Gymnasium", recIcon, 32.8850813, -79.9925267];
vMarkers[2] = ["Park Circle", recIcon, 32.8810531, -79.985708];
vMarkers[3] = ["Wannamaker County Park", recIcon, 33.0210301, -80.0895219];
vMarkers[4] = ["Collins Park", recIcon, 32.8792645, -80.0590804];
vMarkers[5] = ["Northwood Park", recIcon, 32.9671712, -80.0440753];
vMarkers[6] = ["Pepperhill Park", recIcon, 32.9689437, -80.0425693];
vMarkers[7] = ["MeadWestvaco Park", recIcon, 32.9032202, -79.9881548];
vMarkers[8] = ["Golf Club at Wescott Plantation", recIcon, 32.9452646, -80.1397497];
vMarkers[9] = ["Park Circle Disc Golf", recIcon, 32.8810531, -79.985708];
//shopping
vMarkers[10] = ["Northwoods Mall", shopIcon, 32.9418259, -80.0406389];
vMarkers[11] = ["Tanger Outlet Mall", shopIcon, 32.8792645, -80.0590804];
vMarkers[12] = ["Festival Centre", shopIcon, 32.9183417, -80.1023615];
vMarkers[13] = ["North Rivers Marketplace", shopIcon, 32.9278495, -80.0339765];
vMarkers[14] = ["Aviation Square Shopping Center", shopIcon, 32.9278495, -80.0339765];
vMarkers[15] = ["North Charleston Shopping Center", shopIcon, 32.9278495, -80.0339765];
vMarkers[16] = ["Gaslite Square Shopping Center", shopIcon, 32.9278495, -80.0339765];
vMarkers[17] = ["Eagle Creek Shopping Center", shopIcon, 32.9892663, -80.109357];
vMarkers[18] = ["North Fiftytwo Square Shopping Center", shopIcon, 32.9278495, -80.0339765];
//attractions
vMarkers[19] = ["North Charleston Coliseum", attrIcon, 32.8674834, -80.0212533];
vMarkers[20] = ["North Charleston Performing Arts Center", attrIcon, 32.8674834, -80.0212533];
vMarkers[21] = ["Charleston Area Convention Center", attrIcon, 32.8674834, -80.0212533];
vMarkers[22] = ["Whirlin' Waters Adventure", attrIcon, 33.0210301, -80.0895219];
vMarkers[23] = ["Greater Charleston Naval Base Memorial", attrIcon, 32.8696402, -79.9658425];
vMarkers[24] = ["North Charleston and American LaFrance Fire Museum and Educational Center", attrIcon, 32.8358506, -80.0653638];
vMarkers[25] = ["City Art Gallery", attrIcon, 32.8674834, -80.0212533];
vMarkers[26] = ["Old North Charleston Picture House", attrIcon, 32.8815605, -79.9778539];
vMarkers[27] = ["Dinner Theater", attrIcon, 32.834825, -80.0421468];
vMarkers[28] = ["Hockey -  South Carolina Stingrays", attrIcon, 32.8674834, -80.0212533];
vMarkers[29] = ["Charleston Southern University Athletics", attrIcon, 32.97714, -80.069693];
//education
vMarkers[30] = ["Trident Technical College", edIcon, 32.925728, -80.0331712];
vMarkers[31] = ["Charleston Southern University", edIcon, 32.97714, -80.069693];
vMarkers[32] = ["Strayer University", edIcon, 32.8539729, -79.9124644];
vMarkers[33] = ["Lowcountry Graduate Center", edIcon, 32.8664375, -80.0150732];
vMarkers[34] = ["Miller-Motte Technical College", edIcon, 32.95461, -80.0434423];
vMarkers[35] = ["Southern Wesleyan University", edIcon, 32.8469372, -80.0192402];
vMarkers[36] = ["Virginia College", edIcon, 32.90638, -80.022933];
vMarkers[37] = ["Springfield College", edIcon, 32.8415966, -80.0220429];
vMarkers[38] = ["Dorchester Road Regional Library", edIcon, 32.872941, -80.0577284];
vMarkers[39] = ["Cooper River Memorial Library", edIcon, 32.8567471, -79.9792331];
vMarkers[40] = ["Otranto Road Regional Library", edIcon, 32.9647757, -80.0479386];
//healthcare
vMarkers[41] = ["Trident Medical Center", hospIcon, 33.0128583, -79.9864071];
vMarkers[42] = ["Roper St. Francis - Northwoods ER", hospIcon, 32.9379225, -80.0458845];
vMarkers[43] = ["Medcare Express", hospIcon, 32.9377379, -80.0926014];
	
function gMapInit() {
	geocoder = new google.maps.Geocoder();
    var myLatlng = new google.maps.LatLng(32.900000,-80.020000);
    var myOptions = {
      zoom: 11,
      center: myLatlng,
	  disableDefaultUI: true,
	  navigationControl: true,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    }
    var map = new google.maps.Map(document.getElementById("gMapWidget"), myOptions);
	var infowindow=null;
	$(vMarkers).each(function() {
	    var marker = $(this);
	    var name = marker[0];
	    var icon = marker[1];
	    var address = new google.maps.LatLng(marker[2],marker[3]);
	    marker = new google.maps.Marker({ position: address, map: map, icon: icon });
	    google.maps.event.addListener(marker, 'mouseover', function() {
	        if (infowindow == null) {
	            infowindow = new google.maps.InfoWindow({ content: name,maxWidth:200});
	        }
	        else {
	            infowindow.setContent(name);
	        }
	        infowindow.open(map, marker);
	    });
	});
}   
