$(document).ready(function () {
	calendrier();
	mark();
	newsletter();
	
	try {
		var pageTracker = _gat._getTracker("UA-12612747-1");
		pageTracker._trackPageview();
	} catch(err) {
	}
});

function newsletter() {
	$('#bNewsletter').unbind('click').click(function (e) {
		e.preventDefault();
		if ($('#email').val() != '') {
			$('#newsletter').load('newsletter.php?email=' + $('#email').val(), null, function () {
				newsletter();
			});
		}
	});
}

function calendrier() {
	$('#calendrier a[rel$=calendrier]').unbind('click').click(function (e) {
		e.preventDefault();
		$('#calendrier').load(this.href, null, function () {
			calendrier();
		});
	})
}

function mark() {
	$('.mark a').unbind('click').click(function (e) {
		e.preventDefault();
		$(this).parent().load(this.href, null, function () {
			mark();
		})
	});
}

function twitter() {
	new TWTR.Widget({
	  version: 2,
	  type: 'profile',
	  rpp: 4,
	  interval: 6000,
	  width: 200,
	  height: 300,
	  theme: {
	    shell: {
	      background: 'white',
	      color: '#000000'
	    },
	    tweets: {
	      background: 'white',
	      color: '#000000',
	      links: '#4aed05'
	    }
	  },
	  features: {
	    scrollbar: false,
	    loop: false,
	    live: false,
	    hashtags: true,
	    timestamp: true,
	    avatars: false,
	    behavior: 'all'
	  }
	}).render().setUser('etiquettesvin').start();
}
