
//var pathIcons = "http://maps.google.com/mapfiles/kml/pal3/icon";
//New concept store
var iconNewConcept = new GIcon(); 
//iconNewConcept.image = 'http://gmaps-samples.googlecode.com/svn/trunk/markers/circular/greencirclemarker.png';
iconNewConcept.image = '../Images/Store/new_concept_notail.png';
iconNewConcept.shadow = '';
iconNewConcept.iconSize = new GSize(32,32);
iconNewConcept.shadowSize = new GSize(22, 20);
iconNewConcept.iconAnchor = new GPoint(16, 16);
iconNewConcept.infoWindowAnchor = new GPoint(5, 1);

//Regular concept
var iconRegular = new GIcon(); 
//iconRegular.image = 'http://gmaps-samples.googlecode.com/svn/trunk/markers/circular/bluecirclemarker.png';
iconRegular.image = '../Images/Store/old_concept_notail.png';
iconRegular.shadow = '';
iconRegular.iconSize = new GSize(32, 32);
iconRegular.shadowSize = new GSize(22, 20);
iconRegular.iconAnchor = new GPoint(16, 16);
iconRegular.infoWindowAnchor = new GPoint(5, 1);

var customIcons = [];
customIcons["1"] = iconNewConcept;
customIcons["0"] = iconRegular;
var markerGroups = { "1": [], "0": []};

//Add icons on the Google map, set the center with a specifi zoom.
function SetCenter(latitude, longitude, zoom, latitudes, longitudes, nbIcons) 
{
    var map = new GMap2(document.getElementById("map_canvas"));
    if (GBrowserIsCompatible()) 
    {
        map.setCenter(new GLatLng(latitude, longitude), zoom);
        map.addControl(new GLargeMapControl());
        map.addControl(new GMapTypeControl());
    }
     
    for (var i = 0; i < nbIcons; i++) 
    {            		
        var latlng = new GLatLng(latitudes[i], longitudes[i]);                        
        map.addOverlay(CreateMarker(latlng, i));              
    }   
}
        
 //Creates Markers with an image icon.
 function CreateMarker(point, index) {
 
//    var icon = new GIcon(); 
//    icon.image = 'http://gmaps-samples.googlecode.com/svn/trunk/markers/circular/greencirclemarker.png'; 
//    icon.iconSize = new GSize(32, 32); 
//    icon.iconAnchor = new GPoint(16, 16); 
//    icon.infoWindowAnchor = new GPoint(25, 7); 

//So something like that replaces this bit of your existing code: 
        // use a custom icon with letter A - Z 
        //var letter = String.fromCharCode("A".charCodeAt(0) + index); 
        //var letter = index+1; 
        //var myIcon = new GIcon(G_DEFAULT_ICON, "http://www.google.com/mapfiles/marker" + letter + ".png"); 
        //myIcon.printImage = "http://maps.google.com/mapfiles/marker"+letter+"ie.gif"; 
        //myIcon.mozPrintImage = "http://maps.google.com/mapfiles/marker"+letter+"ff.gif"; 

//This bit creates the marker 
        opts = { 
          //"icon": icon,
          "icon": customIcons[storeTypes[index]],
          "labelClass": "GoogleMarker"+storeTypes[index],
          "labelText": index+1, 
          "labelOffset": new GSize(-5, -12) 
        }; 
        //var marker = new GMarker(point, opts);
        var marker = new LabeledMarker(point, opts); 
        markerGroups[storeTypes[index]].push(marker);

      GEvent.addListener(marker, "click", function() {
      var addressStore = "<p class='MallName'>" + mall[index] + "</p>" + 
                         "<p class='StoreDetail'>" + 
                         storeAddress[index] + "<br />" + 
                         cityProvince[index] + "<br />" + 
                         postalCode[index] + "<br />" +
                         phoneNumber[index] + "</p>" +
                         "<p class='StoreExtraDetail'>" + customText[index] + "</p>";
        marker.openInfoWindowHtml(addressStore);
      });
      
      return marker;
    }
    
///Show a simple map, with a zoom, and the latitude/longitude of the center of the map.
function ShowMap(latitude, longitude, zoom)
{
    if (GBrowserIsCompatible()){
        var map = new GMap2(document.getElementById("map_canvas"));
        map.setCenter(new GLatLng(latitude, longitude), zoom);
        map.addControl(new GLargeMapControl());
        map.addControl(new GMapTypeControl());
    } 
}

function toggleGroup(type) {
  for (var i = 0; i < markerGroups[type].length; i++) {
    var marker = markerGroups[type][i];
    if (marker.isHidden()) {
      marker.show();
    } else {
      marker.hide();
    }
  } 
}


