/*custom fadein*/
(function($) {
	$.fn.customFadeIn = function(speed, callback) {
		$(this).fadeIn(speed, function() {
			if(jQuery.browser.msie)
				$(this).get(0).style.removeAttribute('filter');
			if(callback != undefined)
				callback();
		});
	};
	$.fn.customFadeOut = function(speed, callback) {
		$(this).fadeOut(speed, function() {
			if(jQuery.browser.msie)
				$(this).get(0).style.removeAttribute('filter');
			if(callback != undefined)
				callback();
		});
	};
})(jQuery);

$(document).ready(function() {
		QueryLoader.selectorPreload = "body";
		QueryLoader.init();

		$("a").hide();
		$(".logoNew").hide();
		// not ie
		if (!jQuery.browser.msie) {
			$("#erase").animate({ width:"990px" },{ queue:false, duration:200 })
					.animate( { height:"525px" }, 200 )
		    	    .animate( { opacity:1 }, 200);
			setTimeout(
				function () {
					$("#target img").animate( { opacity:0 }, 500);
					$("body .containerLogo").animate({opacity:0}, 500);
					$("body h1").animate( { opacity:0 }, 500,
						function() {
							$("#target").addClass("good").animate( { opacity:1 }, 100 );
							$("body h1").html("<img src='./img/intro_next.png' title='On devient coté'/>");

							$("body h1").animate( { opacity:1}, 700,
									function(){
										$("body").addClass("emak");
										 $("body.emak .logo").hide(0);
										 $("body.emak .logoNew").show();
										$("body .containerLogo").animate({opacity:1}, 3500);
										$("#erase a.link").show("slow");
									});
							})
						}
				,5500);
		}
 		// is IE
		else {
			$("#erase").animate({ width:"990px" },{ queue:false, duration:200 })
					.animate( { height:"525px" }, 200 )
		    	    .customFadeIn(200);
			setTimeout(
				function () {
					$("#target img").customFadeOut(500);
					$("body .containerLogo").customFadeOut();
					$("body .logo").hide();
					$("body h1").customFadeOut(700);
					$("#target").addClass("good").customFadeIn(100);
					$("body h1").html("<img src='./img/intro_next.png' title='On devient coté'/>");
					$("body h1").customFadeIn(700);
					$("body").addClass("emak");
				
					$("body.emak .logoNew").show();
					$("body .containerLogo").customFadeIn(3500);
					$("#erase a.link").show("slow");
					}
				,5500);
		}
		});




