﻿ function azload() {
      var map = new GMap2(document.getElementById("map"));
      map.addControl(new GSmallMapControl());
      map.addControl(new GMapTypeControl());
      map.setCenter(new GLatLng(41.399322, -81.784384), 9);

      var masajid = new Array();
      masajid[masajid.length] = new Masjid("Islamic Center of Greater Cleveland", "41.399322", "-81.784384", "",
         "6055 W. 130th Street", "Parma", "OH", "44130", "216.362.0786", "216.362.0787", "\u0069\u0063\u0063\u0040\u0069\u0063\u0063\u006c\u0065\u0076\u0065\u006c\u0061\u006e\u0064\u002e\u006f\u0072\u0067", "http://www.iccleveland.org");
      masajid[masajid.length] = new Masjid("Muslim Association of Cleveland East (MACE)", "41.574450", "-81.498041", "25900 Chardon Road", "",
         "Richmond Hts", "OH", "44143", "216.261.1413", "", "", "http://www.maceohio.com");
      masajid[masajid.length] = new Masjid("Masjid Al-Madinah", "41.458640", "-82.171574", "",
      "1300 Reid Ave", "Lorain", "OH", "44052", "216.244.136", "216.985.1270", "", "");
      masajid[masajid.length] = new Masjid("Masjid Al-Nur", "41.522277", "-81.620614", "",
      "1251 E-99th Street", "Cleveland", "OH", "44121", "", "", "", "");
      masajid[masajid.length] = new Masjid("Lorain Ave Mussalla", "41.458947", "-81.778386", "",
      "12920 Lorain Ave", "Cleveland", "OH", "44111", "", "", "", "");
      masajid[masajid.length] = new Masjid("Masjid Uqbah", "41.498599", "-81.591086", "",
      "2222 Stokes Blvd", "Cleveland", "OH", "44106", "216.791.8411", "", "uqbahmf@yahoo.com", "http://www.uqbah.org/modules.php?op=modload&name=Downloads&file=index");
      masajid[masajid.length] = new Masjid("Masjid Rasool-ullah", "41.480049", "-81.748012", "",
      "9400 Detroit Ave", "Cleveland", "OH", "44102", "", "", "", "");
      masajid[masajid.length] = new Masjid("Unity Center", "41.325451", "-81.609923", "",
      "10909 Chippewa Rd", "Brecksville", "OH", "44141", "", "", "", "");
      masajid[masajid.length] = new Masjid("Islamic Center of Greater Toledo", "41.536668", "-83.614083", "",
      "25877 Scheider Road", "Perrysburg", "OH", "43551", "419.874.3509", "", "info@icgt.org", "http://www.icgt.org");
      masajid[masajid.length] = new Masjid("Islamic Society of Akron &amp; Kent", "41.180978", "-81.503146", "",
      "152 E. Steels Corners Rd.", "Cuyahoga Falls", "OH", "44224", "330.922.9991", "", "info@isak.org", "http://www.isak.org");
      masajid[masajid.length] = new Masjid("Masjid Umat-ul-lah", "41.520151", "-81.604648", "",
      "1396 E-115th Street", "Cleveland", "OH", "44106", "216.721.2162", "", "", "");
      masajid[masajid.length] = new Masjid("Masjid Warith Deen", "41.519551", "-81.637941", "",
      "7301 Superior Avenue", "Cleveland", "OH", "44103", "216.431.1992", "", "", "");
      masajid[masajid.length] = new Masjid("Masjid Bilal", "41.504051", "-81.636843", "",
      "7401 Euclid Ave", "Cleveland", "OH", "", "", "", "", "");
      masajid[masajid.length] = new Masjid("Masjid Islam", "41.430218", "-81.825092", "",
      "4600 Rocky River Dr", "Cleveland", "OH", "", "", "", "", "");
      masajid[masajid.length] = new Masjid("First Cleveland Masjid", "41.460381", "-81.591076", "",
      "3613 E 131st St", "Cleveland", "OH", "44120", "216.283.9027", 
      "", "info@firstclevelandmosque.com", "http://www.firstclevelandmosque.com/");
   
      for (var i=0; i<masajid.length; i++) {
         //createMarker(masajid[i]);
         map.addOverlay(createMarker(masajid[i]));
      }

}
function createMarker(masjid) {
  var point = new GLatLng(parseFloat(masjid.lat), parseFloat(masjid.lng));
  var marker = new GMarker(point);
  GEvent.addListener(marker, "click", function() {
   var strDesc = "<b>" + masjid.title + "</b><br>";
   if (masjid.info != "") { 
    strDesc +=  masjid.info + "<br>";
   }
   if (masjid.address != "") { 
    strDesc +=  masjid.address + "<br>";
   }

   if ((masjid.city != "") || (masjid.state != "") || (majid.zip != "")) { 
    strDesc +=  masjid.city + " " + masjid.state + " " + masjid.zip + "<br>";
   }
   if (masjid.phone != "") { 
    strDesc +=  "Ph: " + masjid.phone + "<br>";
   }
   
   if (masjid.fax != "") { 
    strDesc +=  "Fax: " + masjid.fax + "<br>";
   }
   
   if (masjid.email != "") { 
    strDesc +=  "Email: <a href='mailto:" + masjid.email + "'>" + masjid.email + "</a><br>";
   }
   if (masjid.web != "") { 
    strDesc +=  "<a href='" + masjid.web + "' target='_blank'>" + masjid.web + "</a><br>";
   }
   //alert(strDesc);
    marker.openInfoWindowHtml("<p>" + strDesc + "</p>");
  });
  return marker;
}
function Masjid(title, lat, lng, info, address, city, state, zip, phone, fax, email, web) {
   this.title = title;
   this.lat = lat;
   this.lng = lng;
   this.info = info;
   this.address = address;
   this.city = city;
   this.state = state;
   this.zip = zip;
   this.phone = phone;
   this.fax = fax;
   this.email = email;
   this.web = web;
}
