// misc links
$("a.track,footer a").click(function(e) {
	var cat="Links";
	var action="Click";
	
	if(this.id){
		var label=this.id;
	} else {
		var label=this.href;
	}
	
	trackLink(cat, action, label);
});

// which videos get launched?
// case studies are setup so the link to launch the lightbox of the video is tagged with the video class
// who we are is setup so the p element wrapped around the link to launch the lightbox of the video is tagged with the video class
$("a.video,p.video a").click(function(e) {
	var cat="Videos";
	var action="Play";
	
	if(this.id){
		var label=this.id;
	} else {
		var label=this.href;
	}
		
	trackLink(cat, action, label);
});

// which bio gets viewed the most?
$("#team-wrapper ul.links a").click(function(e) {
	var cat="Team";
	var action="View Bio";
	var label = this.href.split('#')[1].replace('-', ' ');
	
	trackLink(cat, action, label);
});

$('form').submit(function(e) {
	var cat="Form";
	var action="Submitted";
	var label=this.id;
	
	trackLink(cat, action, label);
});

function trackLink(cat, action, label) {
	// for testing:
	//alert('cat => ' + cat + ' action => ' + action + ' label => ' + label);
	
	pageTracker._trackEvent(cat,action,label);
}