var _gaq = _gaq || [];

var azisaka = {
  init: function() {
    this.app();
    this.analytics.init();
  },

  app: function() {
    $('#social-networks a').hover(function() {
      var label = document.createElement('div');
      $(label).addClass('social-label').hide().text($(this).text());

      $(this).parent().append(label);
      $(label).fadeIn('fast');

    }, function() {
      $(this).parent().find('.social-label').remove();
    });

    $('#recommendations blockquote').hover(function() {
      var border = document.createElement('div');
      $(border).addClass('blockquote-border').css({ 'height': $(this).css('height') }).hide();
      $(this).append(border);
      $(border).fadeIn(400);
    }, function() {
      $(this).find('.blockquote-border').remove();
    });
  },

  analytics: {
    init: function() {
      _gaq.push(['_setAccount', 'UA-15636756-1']);
      _gaq.push(['_trackPageview']);
      _gaq.push(['_setDomainName', '.com.br']);

      var ga = document.createElement('script');
      ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
      ga.setAttribute('async', 'true');
      document.documentElement.firstChild.appendChild(ga);
    }
    //   this.scopeLinks();
    // },
    //
    // ping: function(category, action) {
    //   _gaq.push(['_trackEvent', category, action, 'click']);
    //   _gaq.push(['_trackPageview', "/#" + category + action])
    // },
    //
    // scopeLinks: function() {
    //   j('a[rel~=analytics]').click(function() {
    //     var href = j(this).attr('href');
    //     var rel = j(this).attr('rel').split(' ');
    //
    //     Analytics.ping(rel[1], href);
    //   });
    // }
  }
};

$(function() {
  azisaka.init();
});