$(function() {
	// watch for change of highlight
	$('#content-highlights-and-features').find('.highlight').live('click', function() {
		var highlight = $(this).attr('rel');
		// update the video player
		updateVideoPlayer(highlight);
		return false;
	});
});

/**
 * Grab content dynamically to fill the video block.
 */
function updateVideoPlayer(highlight) {
	$.post(DATA_SERVER+'/ajax/product.php?action=getProductFeature', { highlight: highlight }, function(data) {
		$("#highlight-info").html(data);
		// update all associated coloring
		$('#content-highlights-and-features').find('.highlight').removeClass('selected');
		$('#content-highlights-and-features').find(".highlight[rel='"+highlight+"']").addClass('selected');
		/*
		 use the following if you are using a custom video player:
		var flashvars   = { introImageUrl: img, videoUrl: video, showIntroImage: true };
		var params      = { wmode: "transparent", scale: "noscale", allowScriptAccess: "sameDomain" };
		var attributes  = { id : "highlightsPlayer" };
		swfobject.embedSWF("/public/flash/product/highlights/videoplayer.swf", "videoPlayer", "240", "204", "9.0", "/public/flash/expressInstall.swf", flashvars, params, attributes);
		*/
	});
}
