$(document).ready(function(){
	// slider accueil
		$('#slider').Horinaja({capture:'slider',delai:0.5,duree:5,leftright:true,pagination:false});
		
		$('.fade').hover(function() {
		var fade = $('> div', this);
		  fade.fadeIn(200);
		}, function () {
		var fade = $('> div', this);
		  fade.fadeOut(200);
		});	
		$('.cache').click(function(){
			$('#globalContent').after('<div class="bigArt" style="display:block;"></div><a href="javascript:closeArt()" id="closeArt" style="display:block;"><img src="image/artwork/'+$(this).attr('id')+'.jpg"/></a>');
					$('div.bigArt').css({'width':$(document).width()+'px','height':$(document).height()+'px','opacity':'0'});
					$('div.bigArt').fadeTo(2000,0.7,function(){
					$('div.bigArt + a').css({'width':$(document).width()+'px','top':($(document).scrollTop()+40)+'px','opacity':'0'});
					$('div.bigArt + a').fadeTo(2000,1);					
					});
			return false;
		});
  	$('.cache').hover(function(){
		$(this).fadeTo("slow", 0.10);
	},function(){$(this).fadeTo("slow", 1);});
});
function closeArt(){
					$('div.bigArt').fadeOut('slow',function(){$(this).remove();});
					$('div.bigArt + a').fadeOut('slow',function(){$(this).remove();});
}
function contact(){
	$('#formContact').slideToggle('slow');
}
function contactPost(){
 $.ajax({
   type: "POST",
   url: "../php/ajax/post.contact.php",
   data:$("#formC").serialize(),
   beforeSend:function(s){	   
		$('#formC input').attr("disabled", "disabled");
		$('#formC').fadeTo("slow", 0.33);
   },
   complete: function(s){
		$('#formContact').slideToggle('slow');
	   /*$('#form'+id).replaceWith(s);*/
   }
 });
}