function akqa()
{
  this.url = "https://s2.srtk.net/www/delivery/ti.php?trackerid=784&cb=786241180&_sr_amount=1&_sr_orderid=";
  this.track = function(trackingString, obj) {
    if(trackingString) {
      var img = new Image;
      img.src = this.url + trackingString;
      if(!obj) { obj = {} }

      if($.isFunction(obj.callback)) {
        return setTimeout(function() { obj.callback.call() } , 500);
      } else if(obj.redirect) {
        setTimeout('document.location = "' + obj.redirect + '"', 500);
        return false;
      } else {
        return true; //continue
      }
    } else {
      return true;
    }
  }
}

var akqa = new akqa();
$(document).ready(function(){
  if($("#universityNav a[href='/university/grilling-videos/']")) {
      $("#universityNav a[href='/university/grilling-videos/']").click(function(event) {
        event.preventDefault();
        akqa.track('KUGrillingVideos', {redirect:this.href});
      });
    }

  if($("#universityNav a[href='/university/article/27']")) {
    $("#universityNav a[href='/university/article/27']").click(function(event) {
      event.preventDefault();
      akqa.track('KUGrillingBasics', {redirect:this.href});
    });
  }

  if($("#universityNav a[href='/university/article/20']")) {
    $("#universityNav a[href='/university/article/20']").click(function(event) {
      event.preventDefault();
       akqa.track("KUGetReadyToGrill", {redirect:this.href});
    });
  }

  if($("#universityNav a[href='/university/article/15']")) {
    $("#universityNav a[href='/university/article/15']").click(function(event) {
      return akqa.track("KUTipsForGrill", {redirect:this.href});
    });
  }

  if($("#utilityRecipesLinkLogo")) {
    $("#utilityRecipesLinkLogo").click(function(event) {
      event.preventDefault();
       akqa.track("MainGRecipes", {redirect:this.href});
    });
  }
  
  if($(".adSignUpText a")) {
    $(".adSignUpText a").click(function(event) {
      event.preventDefault();
      akqa.track('PromoLogin', {redirect:this.href});
    });
  }
  
  if($("#utilityNav a[href^='/login']")) {
    $("#utilityNav a[href^='/login']").click(function(event) {
      event.preventDefault();
       akqa.track("MainLogin", {redirect:this.href});
    });
  }
  
  if($("#wordpress form")) {
    $("#wordpress form").submit(function(event) {
      event.preventDefault();
      var formEle = this;
      akqa.track('PromoSignUp', {callback:function() { formEle.submit(); }});
    });
  }
  
  if($("#utilityNav a[href^='/user/register']")) {
    $("#utilityNav a[href^='/user/register']").click(function(event) {
      event.preventDefault();
      return akqa.track("MainSignUp", {redirect:this.href});
    });
  }
  
  if($("#footerTwitterLink")) {
    $("#footerTwitterLink").click(function(event) {
       akqa.track("ShareTwitter");
    });
  }
  
  if($("#footerFBLink")) {
    $("#footerFBLink").click(function(event) {
       akqa.track("ShareFacebook");
    });
  }
  
  
  /*
  It will override existing onClick
  
  if($("#BVRRDisplayContentNoReviewsID a")) {
    $("#BVRRDisplayContentNoReviewsID a").click(function(event) {
      akqa.track("RateReview");
    });
  }
  */
  
  if($(".productImage a[href$='details/kingsford-original-charcoal']")) {
    $(".productImage a[href$='details/kingsford-original-charcoal']").click(function(event) {
      event.preventDefault();
      akqa.track('ProdKOC', {redirect:this.href});
    });
  }
  
  if($(".productImage a[href$='details/kingsford-charcoal-hickory']")) {
    $(".productImage a[href$='details/kingsford-charcoal-hickory']").click(function(event) {
      event.preventDefault();
      akqa.track('ProdKCH', {redirect:this.href});
    });
  }
  
  if($(".productImage a[href$='details/kingsford-charcoal-mesquite']")) {
    $(".productImage a[href$='details/kingsford-charcoal-mesquite']").click(function(event) {
      event.preventDefault();
      akqa.track('ProdKCM', {redirect:this.href});
    });
  }
  
  if($(".productImage a[href$='details/kingsford-match-light-charcoal']")) {
    $(".productImage a[href$='details/kingsford-match-light-charcoal']").click(function(event) {
      event.preventDefault();
      akqa.track('ProdKMLC', {redirect:this.href});
    });
  }
  
  if($(".productImage a[href$='details/kingsford-match-light-mesquite']")) {
    $(".productImage a[href$='details/kingsford-match-light-mesquite']").click(function(event) {
      event.preventDefault();
      akqa.track('ProdKMLCM', {redirect:this.href});
    });
  }
  
  if($(".productImage a[href$='details/kingsford-wood-chips-mesquite']")) {
    $(".productImage a[href$='details/kingsford-wood-chips-mesquite']").click(function(event) {
      event.preventDefault();
      akqa.track('ProdKWCM', {redirect:this.href});
    });
  }
  
  if($(".productImage a[href$='details/kingsford-wood-chips-hickory']")) {
    $(".productImage a[href$='details/kingsford-wood-chips-hickory']").click(function(event) {
      event.preventDefault();
      akqa.track('ProdKWCH', {redirect:this.href});
    });
  }
  
  if($(".productImage a[href$='details/kingsford-bbq-bag']")) {
    $(".productImage a[href$='details/kingsford-bbq-bag']").click(function(event) {
      event.preventDefault();
      akqa.track('ProdKBBSUCB', {redirect:this.href});
    });
  }
  
  if($(".productImage a[href$='details/kingsford-charcoal-lighter-fluid']")) {
    $(".productImage a[href$='details/kingsford-charcoal-lighter-fluid']").click(function(event) {
      event.preventDefault();
      akqa.track('ProdKCLF', {redirect:this.href});
    });
  }
  
  if($(".productImage a[href$='details/kingsford-competition-briquets']")) {
    $(".productImage a[href$='details/kingsford-competition-briquets']").click(function(event) {
      event.preventDefault();
      akqa.track('ProdKOC', {redirect:this.href});
    });
  }
  
  if($("#kingsfordUAd")) {
    $("#kingsfordUAd").click(function(event) {
      event.preventDefault();
      akqa.track('PromoVote');
    });
  }
  
  if($("a[href='/promotions/article/168']")) {
    $("a[href='/promotions/article/168']").click(function(event) {
      event.preventDefault();
      akqa.track('PromoKPChase', {redirect:this.href});
    });
  }
  
  if($(".navHeritage")) {
    $(".navHeritage").click(function(event) {
      event.preventDefault();
      akqa.track('Heritage', {redirect:this.href});
    });
  }

});
