$().ready(function() {
	var reg = /^.*[&|\?]origineInscription=([^&]*)/i;
	if (reg.test(document.URL)) {
		reg.exec(document.URL);
		var expdate = new Date() ;
		expdate.setTime( new Date() + ( 24*60*60*1000 ) );
		document.cookie = "origineInscription=" + RegExp.$1 + ";path=/;expires=" + expdate.toGMTString();
		//jQuery.post("/ajax/origine-inscription.do", { origineInscription: RegExp.$1 });
	}
	var reg = /^.*\.(google|bing|yahoo)\.[a-z]+\/.*[&|\?][q|p]=([^&]*)/i;
	if (reg.test(document.referrer)) {
		reg.exec(document.referrer);
		jQuery.post("/ajax/ajouter-analytics-moteur-recherche.do", { page: window.location.pathname, moteur: RegExp.$1, motsCles: decodeURIComponent(RegExp.$2.replace(/\+/g, " ")) });
		var regForum = /.*\/forum\/.*/;
		if (regForum.test(document.URL)) {
			var expdate = new Date() ;
			expdate.setTime( new Date() + ( 24*60*60*1000 ) );
			document.cookie = "origineInscription=Moteur de recherche Forum;path=/;expires=" + expdate.toGMTString();
		}
	}
	$('.stat').click(function() { 
		jQuery.post("/ajax/ajouter-analytics.do", { page: window.location.pathname, infos: $(this).attr("href"), code: $(this).attr("name") });
	});
	$(':image[src*=/paiement/]').click(function() { 
		jQuery.post("/ajax/site-paiement-ligne.do");
	});
});
