// track outbound links in analytics

$('a').click(function() {
  var $a = $(this);
  var href = $a.attr('href');
 
  // see if the link is external
  if ( (href.match(/^http/)) && (! href.match(document.domain)) ) {
 
    // if so, register an event
    var category = 'Outgoing'; // set this to whatever you want
	
	var slug = document.location.href; 
	var page = slug.substring(23); 
		
    pageTracker._trackEvent(category, href, page);
  }
  
});

	$('#words .word').click(function() {
				
				label = $(this).text();
			
				pageTracker._trackEvent('Label', 'Add Label', label);
				pageTracker._trackPageview('/goal/label.html');
				pageTracker._setCustomVar(
					1,                   // This custom var is set to slot #1
					"Label",     // The name acts as a kind of category for the user activity
					label,               // This value of the custom variable
					1                    // Sets the scope to visitor-level
				); 
	
		return false;	
	});		

	$('#themes .wrap div').click(function() {
			
				pageTracker._trackPageview('/goal/theme.html');
				style = $(this).attr('class');

				pageTracker._setCustomVar(
					2,                   // This custom var is set to slot #1
					"Theme",     // The name acts as a kind of category for the user activity
					style,               // This value of the custom variable
					1                    // Sets the scope to visitor-level
				); 

	
		return false;	
	});		
		
			$('#wtfform #submit').click(function() {
				
				twitter = $('#twitter').val();
				name = $('#name').val();
				email = $('#email').val();
				url = $('#url').val();
				user = $('#remember:checked').val();
				
				alltogether = twitter +' | '+ name +' | '+ email +' | '+ url;
				
				pageTracker._setCustomVar(
					3,                   // This custom var is set to slot #1
					"User",     // The name acts as a kind of category for the user activity
					alltogether,               // This value of the custom variable
					1                    // Sets the scope to visitor-level
				); 

				
				return false;
		});

