$(document).ready(function(){	
	//Remove no-js Class from Body
	$('body').removeClass('no-js');
	
	//preload images
    var preload = new Array();
    $('img.roll').each(function (i) {
        //let's preload
        var img = new Image();
        img.src = this.src.replace(/([_-])off([._-])/, '$1over$2');
        preload.push(img);
    });
	$('img.roll').live("mouseover", function () { // over
		$(this).attr('src',this.src.replace(/([_-])off([._-])/, '$1over$2'));
	});
	$('img.roll').live("mouseout", function () { // out
		$(this).attr('src',this.src.replace(/([_-])over([._-])/, '$1off$2'));
	});
	
	//Projet teaser hover
	/*$("#main .right .projets .projet").hover(function(){
		$(this).children(".teaser").animate({'margin-top':'-77px','height':'102px'},500);
	},function(){
		$(this).children(".teaser").animate({'margin-top':'0px','height':'25px'},500);
	});*/
	
	//Projets Main hover
	$("#main .full .projets .projet").hover(function(){
		$(this).children(".teaser").animate({'margin-top':'-115px','height':'148px'},500);
	},function(){
		$(this).children(".teaser").animate({'margin-top':'0px','height':'33px'},500);
	});
	
	//Project Teaser Cycle
	$("#projets-cycle").cycle({
		fx: 'scrollHorz',
		speed: 500,
		pause:1,
		timeout:7000
	});
	
	$('#word_cycle').cycle({
		fx: 'scrollHorz',
		speed: 'fast',
		pager: '#word_pager',
		prev:    '#word_prevnext a.prev',
        next:    '#word_prevnext a.next',
		timeout: 0,
		pagerAnchorBuilder: function(idx, slide) { 
			// return selector string for existing anchor 
			return '#word_pager a:eq(' + idx + ')'; 
		} 
	});

});
