$().ready(function() {
				$('#coda-slider-1').codaSlider({autoSlideInterval:5000});
				$('#coda-slider-2').codaSlider({autoSlideInterval:7000,autoHeight:true});
			});	
	
	
$(document).ready(function() {
	$("#topnav li").prepend("<span></span>"); //Throws an empty span tag right before the a tag
	$("#topnav li").each(function() { //For each list item...
		var linkText = $(this).find("a").html(); //Find the text inside of the a tag
		$(this).find("span").show().html(linkText); //Add the text in the span tag
	}); 
	$("#topnav li").hover(function() {	//On hover...
		$(this).find("span").stop().animate({ 
			marginTop: "-40" //Find the span tag and move it up 40 pixels
		}, 250);
	} , function() { //On hover out...
		$(this).find("span").stop().animate({
			marginTop: "0" //Move the span back to its original state (0px)
		}, 250);
	});
});

$(window)._scrollable();







$(document).ready(function(){  	  
	$('body').prepend(' <div id="toc" > <a href="#global" class="top_link" title="Revenir en haut de page"><img src="images/fleche.png" /></a></div>');  
 
	$('.top_link').css({  
	'position'              :   'fixed',  
	'right'                 :   '0px',  
	'bottom'                :   '0px',  
	 'display'               :   'none',  
	 'padding'               :   '10px',  	
	 'opacity'               :   '0.9',  
	 'z-index'               :   '2000'  
	});
	$(window).scroll(function(){  
		 posScroll = $(document).scrollTop();  
		 if(posScroll >=200)  
			 $('.top_link').fadeIn(600);  
		 else  
			 $('.top_link').fadeOut(600);  
	}); 
});  
	 
	/*
	$(document).ready(function() {
		var domaine = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");

		//Chargement du scrit GoogleAnalytics via JQuery
		$.getScript(domaine + "google-analytics.com/ga.js", function() {

			//Enregistrement de la visite dans GoogleAnalytics
			try {
				var pageTracker = _gat._getTracker("UA-2868406-1");
				pageTracker._trackPageview();
			} catch (err) { }

			//Recupere tous les balises a ayant un href
			$('a[href]').each(function() {
				var href = $(this).attr('href');
				var extensions = /\.(zip|exe|pdf|doc*|xls*|ppt*|mp3|hcf|html|pp5|pp6)$/i;

				//Liens externes
				if ((href.match(/^https?\:/i)) && (!href.match(document.domain))) {
					$(this).click(function() {
						var lienExterne = href.replace(/^https?\:\/\//i, '');
						pageTracker._trackEvent('Externe', 'Clic - Externe', lienExterne);
					});
				}
				//Liens mailto
				else if (href.match(/^mailto\:/i)) {
					$(this).click(function() {
						var lienMailTo = href.replace(/^mailto\:/i, '');
						pageTracker._trackEvent('Email', 'Clic - Email', lienMailTo);
					});
				}
				//Téléchargements
				else if (href.match(extensions)) {
					$(this).click(function() {
						var extension = (/[.]/.exec(href)) ? /[^.]+$/.exec(href) : undefined; //Récupération de l'extension
						var lienTelechargement = href.replace(/^https?\:\/\/(www.)mydomain\.com\//i, ''); //Suppression du domaine
						lienTelechargement = lienTelechargement.replace(/\.\.\//g, ''); //Suppression 
						pageTracker._trackEvent('Téléchargement', 'Clic - ' + extension, lienTelechargement); 
					});
					
				}
			});
		});
	});*/

jQuery(function( $ ){
	/**
	 * Demo binding and preparation, no need to read this part
	 */
	//borrowed from jQuery easing plugin
	//http://gsgd.co.uk/sandbox/jquery.easing.php
	$.easing.elasout = function(x, t, b, c, d) {
		var s=1.70158;var p=1;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
	};
	
	// Reset the screen to (0,0)
	$.scrollTo( 0 );
	
	// TOC, shows how to scroll the whole window
	$('#toc a').click(function(){//$.scrollTo works EXACTLY the same way, but scrolls the whole screen
		
		$.scrollTo( this.hash, 1000, { easing:'elasout' });
		$(this.hash).find('span.message').text( this.title );
		return false;
	});
	
	
	
});
