$(document).ready(function(){

$("div#preload").load("assets/templates/default/img.html", function () {
$("#loading").animate({opacity: 0}, 2000, function(){
	$("a#tirage").animate({opacity: 1}, 300);
	}
)});


/* TIRAGE ORACLE 	*/
$("a#tirage").click(
	function () {	
	
		var imgChemin = "oracle/";
		var totalNum = 33; //the total number of images in a folder.
		var rndNum = Math.floor(Math.random() * totalNum)+1;
	
		$("div#oracle").html("<img src=\"" + imgChemin + rndNum + ".jpg\" alt=\"\" />"); 
		$("div#description").css("display","none"); 
		
		$("div#description").load( imgChemin +"oracle_"+ rndNum +".html", 
					
					function() {
					$("div#description").css("display", "block"); 
					$("#oracle img").animate({opacity: 1}, 400); 
					$("a#tirage").css('display','none');
					//$("p#unparjour").css('display','inline');
					}
			);
		

		return false	
	}
);

	
/* CARTE ALEATOIRE

var imgChemin = "oracle/";
var totalNum = 33; //the total number of images in a folder.
var rndNum = Math.floor(Math.random() * totalNum)+1;
	
$("div#oracle").html("<img src=\"" + imgChemin + rndNum + ".jpg\" alt=\"\" />"); 
	*/

	
	
	
/* SLIDESHOW */
$('#citation').cycle({
		fx: 'fade',
		slideExpr:     'p',
		speed: 1000,
		timeout:7000
});

$('div.intro').cycle({
		fx: 'fade',
		speed: 1000,
		timeout:7000
});

});


