$(document).ready(function(){

		$("body.dc-home").animate( { backgroundColor:'#2a2a2a' }, 1000)
                         .animate( { backgroundColor:'#1f1f1f' }, 1000);




		$("#content-info h2").animate( { color:'#38BEF8' }, 1000)
                                  .animate( { color:'#CCC' }, 1000);

		$(".message").animate( { backgroundColor:'black',color:'#FFFFFF'  }, 4000)
                             .animate( { backgroundColor:'#7EDF7D',color:'#000'}, 2000)
                             .fadeOut("10000")
;

		$(".error").animate( { backgroundColor:'black',color:'#FFFFFF' }, 3000)
                           .animate( { backgroundColor:'red',color:'#000' }, 3000);

		$("body.dc-home #prelude").animate( { backgroundColor:'#DDD' }, 1000)
                           .animate( { backgroundColor:'#555' }, 3000);

		$("#sidebar ul").hide();
		$("#search h2").hide();
		$("#search form").show();
		$("#sidebar h2").click(function(){
			var target = $(this).next('#sidebar ul')
			$("#sidebar ul:visible").not(target).slideUp();
			target.slideToggle();
			$("#footer").blur();
     		});

		$("#search input").hide();
		$("#search p").prepend("<span title=\"Recherche\">&nbsp;</span>");
		$("#search span").hoverIntent((function () {
			$(this).css("cursor","pointer")
			           // .animate( { backgroundColor:'#CCFF37' }, 1500)
                 }),(function () {
			//$(this).animate( { backgroundColor:'#DDD' }, 1500)
                 }));
		$("#search span").toggle(function(){
			$("#search input").fadeIn("8000");$(this).show();
     		},function(){
			$("#search input").fadeOut("8000");$(this).show();
                 });


		$("#sidebar h2").hoverIntent((function () {
			$(this).css("cursor","pointer")
                                  .animate( { color:'#CCFF37' }, 1500)}),
                                                (function () {
			$(this).animate( { color:'#444'}, 1500);
		}));

		$("p.day-date").remove();
		$("div.post").removeAttr('id');
		var post_id = 0;
			$("div.post").each(function(){
				$(this).attr('id', "post_" + post_id).wrap("<div class=\"post-container\"></div>");
				post_id++;
		});
		var post_id = 0;
			$("h2.post-title").each(function(){
				$(this).attr('id', "post-title_" + post_id);
				post_id++;
		});
		var post_id = 0;
			$("div.post-container").each(function(){
				$(this).attr('id', "container_" + post_id);
				$('#post-title_' + post_id).insertBefore('#post_' + post_id);
				post_id++;
		});

		$("#main div.post").hide();
		$("body.dc-post #main div.post,body.dc-page #main div.post").fadeIn("15000");
		$("#main h2.post-title").click(function(){
			var target = $(this).next('#main div.post')
			$("#main div.post:visible").not(target).slideUp();
			target.slideToggle();
		});
		$("h2.post-title").hoverIntent((function () {
			$(this).css("cursor","pointer")
                                    .animate( { backgroundColor:'#2A2A2A' }, 500);
		}),(function () {
			$(this).animate( {backgroundColor:'#1F1F1F' }, 500);
		}));



		$("#comments h3").click(function(){
			var target = $(this).next('#comments dl')
			$("#comments dl:visible").not(target).slideUp();
			target.slideToggle();
		});

		$("#comments h3").hoverIntent((function () {
			$(this).css("cursor","pointer")
                                    .animate( { color:'#008dd6' }, 500);
		}),
                                                (function () {
			$(this).css("cursor","pointer")
                                    .animate( { color:'#ccff42 '}, 500);
		}));


		$("#top h1 a").hoverIntent((function () {
			$(this).css("cursor","pointer")
                                    .animate( { color:'#008dd6' }, 1000);
		}),
                                  (function () {
                                   $(this).css("cursor","pointer")
                                    .animate( { color:'#ccff42 '}, 1000);
		}));

		$("#sidebar a").hoverIntent((function () {
			$(this).css("cursor","pointer")
                                    .animate( { color:'#fff'}, 500)
		}),
                                                (function () {
                                   $(this).css("cursor","pointer")
                                    .animate( { color:'#008dd6' }, 500);
		}));

		$("body.dc-archive #content ul:not(:first)").hide();

		$("body.dc-archive #content h3").click(function(){
			var target = $(this).next('#content ul')
			$("#content ul").not(target).slideUp();
			target.slideToggle()
		});


		$("body.dc-archive #content h3").hoverIntent((function () {
			$(this).css("cursor","pointer")
                                    .animate( { color:'#008dd6' }, 1000);
		}),
                                  (function () {
                                   $(this).css("cursor","pointer")
                                    .animate( { color:'#ccff42 '}, 1000);
		}));

	});
