// <div class='ambermap' latitude="" longitude="" 

(function($) {       
    
    function error(message)
    {               
        if (window.console && window.console.debug)
            window.console.error(message);
    }
    
    $.fn.ambermap = function(url, data) {    
                       
        // var google = google;      // prevents it from throwing an error if it doesn't exist
        //        
        //        if (google == undefined)
        //        {
        //            error("[ambermaps] Google maps was not loaded");
        //            return;
        //        }
        
        return this.each(function() {        
            var map = new google.maps.Map2(this);
			map.disableDragging();
			map.disableDoubleClickZoom();
                                                
			var centerPoint = new google.maps.LatLng($(this).attr("latitude"),$(this).attr("longitude"));
			map.setCenter(centerPoint, 14);
			var centerIcon = new GIcon(G_DEFAULT_ICON);
			centerIcon.image = "http://s7.amberalert.com/wordpress/wp-content/themes/wp-amber/images/alert-map-ico.jpg";
			centerIcon.iconSize = new GSize(32, 32);
			markerOptions = { icon:centerIcon,clickable:false };
			map.addOverlay(new GMarker(centerPoint,markerOptions));
        });
        
        return this;
    }
    
})(jQuery)