/**
 * FlashTracker prototype
 * @param metricsTracker prototype instance 
 * @param isLoggedFunction js function 
function FlashTracker(metricsTracker, isLoggedFunction){
	
	if(metricsTracker){
		this.metricsTracker = metricsTracker;
	}else{
		throw "ArgumentException: metricsTracker required";	
	}
	
	if(isLoggedFunction){
		this.isLogged = isLoggedFunction;
	}else{
		throw "ArgumentException: isLoggedFunction required";	
	}

}
 */

/**
 * FlashTracker prototype
 * @param trackMediaEventFunction js function 
 * @param trackHomeSliderEventFunction js function 
 * @param isLoggedFunction js function 
 */
function FlashTracker(trackMediaEventFunction, trackHomeSliderEventFunction , isLoggedFunction){
	
	if(trackMediaEventFunction && trackHomeSliderEventFunction && isLoggedFunction){
		this.metricsTracker = {
			trackMediaEvent : trackMediaEventFunction,
			trackHomeSliderEvent : trackHomeSliderEventFunction
		};
		this.isLogged = isLoggedFunction;
	}else{
		throw "ArgumentException";	
	}

}

/**
 * 
 */
FlashTracker.prototype.trackMediaEvent = function(trackerEvent){
    trackerEvent.userLogged = this.isLogged();
	this.metricsTracker.trackMediaEvent(trackerEvent);
}

/**
 * 
 */
FlashTracker.prototype.trackHomeSliderEvent = function(trackerEvent){
	trackerEvent.userLogged = this.isLogged();
	this.metricsTracker.trackHomeSliderEvent(trackerEvent);
}

