﻿$(document).ready(function() { 

if ($('.GmapCanvas').size() != 0) {

    $(window).bind("unload", GUnload);

    $('.GmapCanvas').each(function() {

        var item = $(this);

        var latitude = item.attr('latitude');
        var longitude = item.attr('longitude');

        var tag = item.html();
        item.html('');

        var googleMapUID_holder = item.attr('id');

        if (GBrowserIsCompatible()) {

            var map = new GMap2(document.getElementById(googleMapUID_holder));

            map.setUIToDefault();

            var address = tag;
            var point = new GLatLng(latitude, longitude);
            var zoom = 11;

            var marker = new GMarker(point, zoom);
            map.addOverlay(marker);

            // marker.openInfoWindowHtml(address);

            map.setCenter(point, zoom);
        }

        item.css('visibility', 'visible');

    });
}

});
