if (Garmin == undefined) var Garmin = {};
/**
 * @class Garmin.Player
 * This isn't really a class in the sense that you can create them.  It's just a collection of static methods
 * that you can use to access the swf.  
 * Since Flash can't call methods on objects - it can only call static methods we figured this should be done
 * in the same way.
 * 
 * @constructor
 */
Garmin.Player = function() {};
Garmin.Player = {
	/**
	 * @member Garmin.Player
	 * Flash calls this method to inform the JS controller that it's been initialized and is ready
	 * for whatever might be coming it's way
	 * @Inbound
	 */
	controllerInitialized: function () {
	    log('swf is initialized');
	    
	    if($('ad') != undefined) {
	        $('ad').style.display = 'none';
	    }
	    $('activityMap').style.visibility = 'visible';
	},
	
	/**
	 * @member Garmin.Player
	 * Chart calls this to get the new context information from the main controller 
	 * and then returns it to the caller <br/><br/>
	 * ServerBound and then returns to the View
	 * 
	 * @param {String} context that we want to request from the main controller
	 * @return {Array} of measurements for the context that was requested
	 * 
	 * @ServerBound
	 * @ViewBound
	 */
	requestContext: function(context) {
		var json = player.controlSWF.getEncodedMeasurements(context);
		return json;
	}, 
	
	/**
	 * @param {int} index you want to seek to
	 */
	seek: function(index) {
		player.seek(index);
	}
};