﻿jQuery(function () {
	//_trackEvent(category, action, optional_label, optional_value);
	if (wffBasket) {
		wffBasket.callbacks.add.push(function (type) {
			_gaq.push(['_trackEvent', 'basket', 'add', type]);
		});
	}
	jQuery('#dietSearchForm .dsFilter').click(function () {
		_gaq.push(['diet', 'filter', jQuery(this).attr('name')]);
	});
	jQuery('input[type=submit][value=Recommend]').click(function () {
		_gaq.push(['Recommend a friend', 'submitted']);
	});

	if (jQuery("link[rel=canonical]").length > 0) {
		_gaq.push([jQuery("link[rel=canonical]").attr("href"), 'product detail']);
	}
	jQuery('#mealsMenu .brochure').click(function () {
		_gaq.push(['brochure_cta', 'click', 'left']);
	});
	jQuery('#userMenu .brochureTop').click(function () {
		_gaq.push(['brochure_cta', 'click', 'top']);
	});
	jQuery('.quickAdd form').submit(function () {
		_gaq.push(['shop-by-meal', 'add', $('#code').val()]);
	});
});
