  var YWATracker = YWA.getTracker("1000569960045");
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-16019512-1']);
  _gaq.push(['_initData']);
  (function() {
	  var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
	  ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
	  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
  
  var MaksimerGoalTable = [['gratis-analyse/takk/','02'],['kontakt/takk/','03'], ['sjekkliste-for-sokemotoroptimalisering-seo/takk/','04']];
  function MaksimerTrackEvent(c, e, l, v)	{
	  if(window.console)	console.log(c+" "+e+" "+l+" ");
	try {
		if(v)	{
			_gaq.push(['_trackEvent',c, e, l, v]);
		} else {
			_gaq.push(['_trackEvent',c, e, l]);
		}
	} catch(err)	{}
	return true;
  }
  function MaksimerTrackYWAGoal(p)	{
    for(var i=0; i<MaksimerGoalTable.length; i++)	{
    	if(MaksimerGoalTable[i][0] == p)	{
    		YWATracker.setAction(MaksimerGoalTable[i][1]);
    	}
    }
  }
  
  $(document).ready(function() {
	  $("a[href^=mailto]").each(function(i)	{
			$(this).click(function() {
				return MaksimerTrackEvent("Klikk epost link", window.location.pathname, this.href);
			});
	  });
	  $("a[href^=http://www.twitter.com]").each(function(i)	{
		  $(this).click(function() {
			  console.log("foo");
			  return MaksimerTrackEvent("Twitter klikk", window.location.pathname, this.href);
		  });
	  });
	  $("h2 a").each(function(i)	{
		  $(this).click(function() {
			  return MaksimerTrackEvent("Tekstlink klikk", window.location.pathname, this.href);
		  });
	  });
	  $("p a").each(function(i)	{
		  $(this).click(function() {
			  return MaksimerTrackEvent("Tekstlink klikk", window.location.pathname, this.href);
		  });
	  });
	  $("#bottomNav ul li ul li a").each(function()    {
	      $(this).click(function() {
	    	  return MaksimerTrackEvent("Footer navigasjon", window.location.pathname, this.href);
		  });
	  });
	  $("input[name^=cf_field_2]").each(function()    {
	      $(this).click(function() {
	    	  return MaksimerTrackEvent("Bunnskjema - startet utfylling", window.location.pathname, this.href);
		  });
	  });
	  $("#feature li a").each(function()    {
		  $(this).click(function() {
			  return MaksimerTrackEvent("Forside navigasjon", window.location.pathname, this.href);
		  });
	  });
	  $("#tjenester li ul li").each(function()    {
		  $(this).click(function() {
			  return MaksimerTrackEvent("Tjenester navigasjon", "Underside", this.href);
		  });
	  });
	  $("#tjenester li a").each(function()    {
		  $(this).click(function() {
			  return MaksimerTrackEvent("Tjenester navigasjon", "Overskrift", this.href);
		  });
	  });
	  $("#logo a").each(function()    {
		  $(this).click(function() {
			  return MaksimerTrackEvent("Logo klikk", window.location.pathname, this.href);
		  });
	  });
	  
	  
	  if(typeof MaksimerTrackGoalPageView != "undefined") {
		  MaksimerTrackYWAGoal(MaksimerTrackGoalPageView);
		  _gaq.push(['_trackPageview'], "/"+MaksimerTrackGoalPageView);
	  } else {
		  _gaq.push(['_trackPageview']);
	  }
	  
	  if (typeof(_vis_opt_GA_track) == "function") { _vis_opt_GA_track(); }
	  
	  YWATracker.submit();
  });