(function($){
        $._ideas={animate:function(options){var el = $(options.el);var el_id = el.attr('id');if (!$._ideas.instances[el_id]){return this;}options = $.extend(options, $._ideas.instances[el_id] || {});var frames;var animate=function(el){var h = options.h;if(!frames){frames = [];total = 0;for (var i=0; i<options.TotalFrame; i ++){frames[frames.length] = (0 - total);total += h;}if(options.AR){for (var j=options.TotalFrame; j>=0; j--) {frames[frames.length] = (0 - total);total -= h;}}}}
		animate(el);if ($._ideas.instances[el_id]['current_frame'] > options.TotalFrame*2){delete $._ideas.instances[el_id];options.callBack();return;}else{$._ideas.instances[el_id]['current_frame'] = $._ideas.instances[el_id]['current_frame'] + 1;}el.css('background-position','0 '+ frames[$._ideas.instances[el_id]['current_frame']] + 'px ');$._ideas.instances[el_id]['options'] = options;
                window.setTimeout(function(){$._ideas.animate(options);},parseInt(1000/options.speed));
            }}
	$.fn.dessinAnimate=function(options){
            options=$.extend({h:260,speed:3,AR:true,TotalFrame:6,callBack:function(){}},options);
                var el = $(this), el_id = el.attr('id');if (!$._ideas.instances){$._ideas.instances = {};}
		if (!$._ideas.instances[el_id]) {$._ideas.instances[el_id] = {current_frame: -1};}options.el = this;var get_rate = function() {return parseInt(1000 / options.speed);}
            window.setTimeout(function(){$._ideas.animate(options);}, get_rate(options.fps));
}})(jQuery);
$(document).ready(function(){
   $('#lettres div').css('opacity',0);$('#forbusiness').css('marginTop',80);$('#menu').css('marginTop',150);$('.sousmenu').hide();
   $('#menu>li').hover(function(){$(this).addClass('over');$('.sousmenu',this).slideToggle(500);},function(){$('.sousmenu',this).slideToggle(500);$(this).removeClass('over');});
   $('#cmenu').ready(function(){$('#lettres div').animate({opacity:1},3000);animation = window.setTimeout(function(){$('#lettres div').show('slow');$('#ideas').dessinAnimate({speed:15,callBack:function(){$('#ombre').animate({height:'toggle'},1000,function(){$('#forbusiness').animate({marginTop: 0},1000,"easeOutBounce",function(){$("#ombre").hide();$('#menu').animate({marginTop: 0},1000,function(){});})});}})},1000);})
});


