var parseUri =  function (str) {
  this.url = str;
  this.options = {
    strictMode: false,
    key: ["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],
    q:   {
      name:   "queryKey",
      parser: /(?:^|&)([^&=]*)=?([^&]*)/g
    },
    parser: {
      strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,
      loose:  /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/
    }
  }
  
  this.parse = function(){
    var o   = this.options,
      m   = o.parser[o.strictMode ? "strict" : "loose"].exec(this.url),
      uri = {},
      i   = 14;

    while (i--) uri[o.key[i]] = m[i] || "";

    uri[o.q.name] = {};
    uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) {
      if ($1) uri[o.q.name][$1] = $2;
    });

    return uri;
  }
  
  this.hier = function(strD){
    var u = strD;
    var c = u.split('/');
    c[0] = 'home';
    for(i = 0; i < c.length; i++){
     if(c[i].length == 0){
      c.splice(i,1);
     }
    }
    if (c[c.length - 1].match(/[^0-9]/g)) {
    }else{
      c.splice(c.length - 1,1);
    }
    return c.join(':');
    
  }

  this.type = function(strD){
    var u = strD;
    var c = u.split('/');
    c[0] = 'home';
    for(i = 0; i < c.length; i++){
     if(c[i].length == 0){
      c.splice(i,1);
     }
    }
    return 
    
  }

  
  this.itemID = function(strD){
    var u = strD;
    var c = u.split('/');
    c.reverse();
    for(i = 0; i < c.length; i++){
     if(c[i].length == 0){
      c.splice(i,1);
     }
    }
    if (c[0].match(/[^0-9]/g)) {
      return '';
      }else{
      return c[0];
    }
  }
  
};


function arena_click(o){
  var s=s_gi(s_account);
  s.linkTrackVars='products,eVar14,events';
  s.linkTrackEvents='event5';
  s.events='event5';
  s.eVar14= o;
  s.products = o;
  s.tl(this,'o','Arena Click');
}


function hottopics_click(o){
  var s=s_gi(s_account);
  s.linkTrackVars='products,eVar14,events';
  s.linkTrackEvents='event5';
  s.events='event5';
  s.eVar14= o;
  s.products = o;
  s.tl(this,'o','Hottopics Click');
}


function sumitem_click(o,t){
  var a = new parseUri(o.href);
  var adid = a.itemID(o.href);
  var s=s_gi(s_account);
  s.linkTrackVars='products,eVar15,events';
  s.linkTrackEvents='event4';
  s.events='event4';
  s.eVar15= adid;
  s.products = adid;
  s.tl(this,'o','Ad Click');
}


function partner1_click(o){
  var s=s_gi(s_account);
  s.linkTrackVars='products,eVar16,events';
  s.linkTrackEvents='event9';
  s.events='event9';
  s.eVar16=o;
  s.tl(this,'o','Partner Click');
}


function partner2_click(o){
  var s=s_gi(s_account);
  s.linkTrackVars='products,eVar16,events';
  s.linkTrackEvents='event10';
  s.events='event10';
  s.eVar16=o;
  s.tl(this,'o','Partner Click');
}
