/**!
 * \file Tracker.js
 * \brief This file consists of Tracker class that can work inside MENA site to track information for tracking systems
 * \version 1.0
 */
Tracker = {

  distributionModel: 'Talfazat',
  customerType: 'guest',
  
  deferred_array: [],
  timer: null,
  
  getURL: function(location, trigger, module, destination)
  {
    var url = '/' + this.distributionModel;
    url += '/' + 'qq.lang_' + Helper.getLang();
    url += '/' + 'qq.usr_' + this.customerType;
    url += '/' + (typeof location == 'string' ? location : Helper.getLocation());
    url += '/' + module;
    url += '/' + trigger;
    if (typeof destination == 'string' || typeof destination == 'number') 
      url += '/' + destination;
    
    return url;
  },
  
  trackTellAFriend: function(matchId)
  {
    pageTracker._trackPageview(this.getURL(null, 'send_to_friend', 'send_to_friend', matchId));
  },
  
  trackAddedFTC: function(matchId)
  {
    pageTracker._trackPageview(this.getURL(null, 'added_ftc_product', 'page', matchId));
  },
  
  trackBottomBlocksMoreLink: function(name)
  {
    pageTracker._trackPageview(this.getURL(null, 'more_link', 'bottom_blocks', name));
  },
  
  trackSubscribeNow: function(name)
  {
    pageTracker._trackPageview(this.getURL(null, 'subscribe_now', 'merchandising_area', name));
  },
  
  trackProduct: function(name)
  {
    pageTracker._trackPageview(this.getURL(null, 'watch', 'channel_list', name));
  },
	
  trackWatch: function(module, name)
  {
    pageTracker._trackPageview(this.getURL(null, 'watch', module, name));
  },
	
  trackWatchFree: function(module, name)
  {
    pageTracker._trackPageview(this.getURL(null, 'watch_free', module, name));
  },
  
  trackProgram: function(module, name)
  {
    pageTracker._trackPageview(this.getURL(null, 'watch', module, name));
  },
  
  trackGenre: function(module, name)
  {
    pageTracker._trackPageview(this.getURL(null, 'select_genre', module, name));
  },
  
  trackAlternativeBanner: function()
  {
    pageTracker._trackPageview(this.getURL(null, 'banner_link', 'epg', null));
  },
	
  trackTab: function(tabName)
  {
    pageTracker._trackPageview(this.getURL(null, 'tab_link', 'bottom_tabs', tabName));
  }
}