$(function() {
	var pageTracker = window._pageTracker;
	$('#links-diffuseurs a').fancybox();
	$('.gallery').each(function() {
		$(this).find('a').fancybox();
	});
	function findFirstPrev(elem, selector) {
		var found = $(elem).filter(selector);
		if (found.length) {
			return found;
		} else if ($(elem).prev().length) {
			return findFirstPrev($(elem).prev(), selector);
		} else {
			return $();
		}
	}
	$("form").each(function (i) {
		$(this).submit(function (event) {
			var elem = findFirstPrev(this, ".title1, .title3").clone().find("em").remove().end(),
				url = "/add-to-cart#" + $("input[name=hosted_button_id]", this).val() + "-" + escape(elem.text().toLowerCase().replace(/^\s\s*/, '').replace(/\s\s*$/, ''));
				
			pageTracker._trackPageview(url);
		});
	});
			/*imageLoading:			'_js/jquery-lightbox/images/lightbox-ico-loading.gif',		// (string) Path and the name of the loading icon
			imageBtnPrev:			'_js/jquery-lightbox/images/lightbox-btn-prev.gif',			// (string) Path and the name of the prev button image
			imageBtnNext:			'_js/jquery-lightbox/images/lightbox-btn-next.gif',			// (string) Path and the name of the next button image
			imageBtnClose:			'_js/jquery-lightbox/images/lightbox-btn-close.gif',		// (string) Path and the name of the close btn
			imageBlank:				'_js/jquery-lightbox/images/lightbox-blank.gif'				// (string) Path and the name of a blank image (one pixel)*/
});
