﻿var gicons = [];
gicons["branch"] = new GIcon(G_DEFAULT_ICON, "/images/googleMap/icons/branch.png");
gicons["branch"].iconSize = new GSize(32, 37);
gicons["you"] = new GIcon(G_DEFAULT_ICON, "http://gmaps-samples.googlecode.com/svn/trunk/markers/blue/blank.png");
gicons["you"].iconSize = new GSize(20, 34);
var gmarkers = [];
var htmls = [];


function createMarker(point,name,html,icontype,reference) {
        // === create a marker with the requested icon ===
        var marker = new GMarker(point, gicons[icontype]);
        marker.mycategory = icontype;
        marker.myPosition = i;
        marker.mytitle = reference;
        GEvent.addListener(marker, "click", function() {
          marker.openInfoWindowHtml(html);
        });

        // save the info we need to use later for the side_bar
        gmarkers[i] = marker;
        htmls[i] = html;
        // add a line to the side_bar html

        i++;
        return marker;
      }


      // This function picks up the click and opens the corresponding info window
      function myclick(i) {
        gmarkers[i].openInfoWindowHtml(htmls[i]);
        //ew.openOnMarker(gmarkers[i],html[i]);
      }
