/**
* @fileoverview Utils for NetRelations wrapper for Google Maps API. 
*/

// Create NetR namespace if it doesn't exist
if (typeof(NetR) === 'undefined') { 
	var NetR = {}; 
}

/**
* Must contain functions loadMarkersfromXML and addEvent
*/
NetR.GMapsUtil = function () {
	/**
	* Performs Ajax call to get XML data for markers
	* @requires jQuery
	* @param {string} XMLPath URL for XML document
	*/
	function loadMarkersFromXML(XMLPath) {
		$.ajax({
			type: 'GET',
			dataType: 'xml',
			url: XMLPath,
			success: function (xml) {
				NetR.GMaps.createMarkers(xml);
			}
		});
	}
	/**
	* AddEvent function
	*/
	function addEvent(target, eventName, action) {
		$(target).bind(eventName, action);
	}

	return {
		loadMarkersFromXML: loadMarkersFromXML,
		addEvent: addEvent
	}
}();

