function orderOfCreation(marker,b) {
        return 1;
      } 

function createMarker(lt, lg, popuptext) {
    var point = new GLatLng(lt, lg);
    // Create our "tiny" marker icon
    var tinyIcon = new GIcon();
    tinyIcon.image = "/images/billboard.png";
    tinyIcon.iconSize = new GSize(30, 30);
    tinyIcon.iconAnchor = new GPoint(15, 3);
    tinyIcon.infoWindowAnchor = new GPoint(15, 35);

    //tinyIcon.image = "/images/mm_20_red.png";
    //tinyIcon.iconSize = new GSize(12, 20);
    //tinyIcon.iconAnchor = new GPoint(6, 20);
    //tinyIcon.infoWindowAnchor = new GPoint(6, 25);

    //tinyIcon.image = "/images/deoutdoor-guy.gif";
    //tinyIcon.iconSize = new GSize(40, 48);
    //tinyIcon.iconAnchor = new GPoint(20, 48);
    //tinyIcon.infoWindowAnchor = new GPoint(25, 15);

    //tinyIcon.image = "http://labs.google.com/ridefinder/images/mm_20_red.png";
    //tinyIcon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
    //tinyIcon.iconSize = new GSize(12, 20);
    //tinyIcon.shadowSize = new GSize(22, 20);
    //tinyIcon.iconAnchor = new GPoint(6, 20);
    // Set up our GMarkerOptions object literal
    markerOptions = { icon:tinyIcon, zIndexProcess:orderOfCreation };
    var marker = new GMarker(point, markerOptions);
    GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(popuptext); });
    return marker;
}

function loadMap() {
    var map = new GMap2(document.getElementById("map_canvas"));
    map.addControl(new GLargeMapControl());
    map.addControl(new GMapTypeControl());

    var xmldoc = loadSigns();
    var thecenter = getMapCenter(xmldoc);
    map.setCenter(new GLatLng(thecenter.lt, thecenter.lg), Number(thecenter.zoom));

    var thesigns = getAllSigns(xmldoc);
    var lastlt = thesigns[0].lt;
    var lastlg = thesigns[0].lg;
    var popuptext = "";
    for (i = 0; i < thesigns.length; i++) {
        //check to see if location is the same as previous in order to group
        if (lastlt != thesigns[i].lt || lastlg != thesigns[i].lg) {
            marker = createMarker(lastlt, lastlg, popuptext);
            map.addOverlay(marker);
            lastlt = thesigns[i].lt;
            lastlg = thesigns[i].lg;
            popuptext = "";
        }
        popuptext = popuptext + "<p><a href='/sign.html?id=" + thesigns[i].id + "'>Sign #" + thesigns[i].id + "</a><br />" + thesigns[i].loc + "</p>"
    }
    marker = createMarker(lastlt, lastlg, popuptext);
    map.addOverlay(marker);
}

