/****************************************************************************************
@author => Keegan Watkins December 2008
@modified => Jeremy Brown January 2009
****************************************************************************************/
// Fired on DOM ready
$(function() {
	// Create array to hold the highlight positions, determined based on number of highlights
	var positions = ($(".highlight").length === 3) ? ["left","middle","right"] : ["left","right"];
	// Reference to parent container, determined based on number of highlights
	var parent = ($(".highlight").length === 3)  ? "#three" : "#two";
	// Create array to store collection of highlight elements
	var highlights = $(parent).find(".highlight");
	// Loop through that array, and for each element...
	for (var i = 0; i < highlights.length; i++) {
		// Set the ID to position i.e "left", "middle" ,or "right"
		$(highlights[i]).attr("id", positions[i])
	}
	// Attach click handler to all links within the highlights section
	$(parent + " a").click(function() {
		// Build string for analytics in the form "hightlight:[position of hightlight here]:[text of header link here]"
		var webtrends = "highlight : " + $(this).parents(".highlight").attr("id") + " : " + $(this).parents("div.highlight").find("table thead tr th a").text();
		// Call analytics function, passing in the string built above
		dcsMultiTrack('DCSext.NAV_mktgcontent',webtrends);
	});
	
	
	$('#featuretracker a').click(function() {
		// Build string for analytics in the form "hightlight:[position of hightlight here]:[text of header link here]"
		var featureortext = $('#featuretracker a').text() == '' ? $('#featuretracker img:first').attr('src') : $(this).text();
		var webtrends = "feature : " + featureortext;
		// Call analytics function, passing in the string built above
		dcsMultiTrack('DCSext.NAV_mktgcontent',webtrends);
	}); 
});