$(document).ready(function() {
	$('#nav').children().hover(function() {
		$(this).siblings().stop().fadeTo(500,0.3);
	}, function() {
		$(this).siblings().stop().fadeTo(500,1);
	});
	$('.social').children().hover(function() {
		$(this).siblings().stop().fadeTo(500,0.3);
	}, function() {
		$(this).siblings().stop().fadeTo(500,1);
	});
});

$(document).ready(function() {
	$('.fade').hover(
	function(){
		$(this).stop().fadeTo('slow',0.6);
	},
	function(){
		$(this).stop().fadeTo('slow',1);
	});
});

$(document).ready(function() { 
    // setup ul.tabs to work as tabs for each div directly under div.panes 
    $("#nav").tabs("#inner > div.pane",{
        effect: 'fade',
        speed: 'slow'
    }); 
});

$(document).ready(function() { 
    $("div.portfolio").scrollable({
    	easing: 'easeInSine',
    	size:1,
    	speed:'1000'
    });
});

$(document).ready(function(){
   $("#contactform").validate({

	   submitHandler: function() {
			SendForm();
			
		}

	   
   });
});

$(document).ready(function(){
   $(document).pngFix();
});

$(document).ready(function(){
   $("a[rel^='prettyPhoto']").prettyPhoto();
});


/**********************************/
/* function SendForm() */
/**********************************/
function SendForm(){
		$('contactname').disabled='disabled';

		new Ajax.Request('FormContact.php',{
			method: 'post',
			asynchronous: true,
			contentType:  'application/x-www-form-urlencoded',
			encoding:     'UTF-8',
			parameters: { nom: $F('contactname'),sujet: $F('subject'),email: $F('email'),message: $F('message')},
			onSuccess: function(){MailOK();}, 
			onFailure: function(response){alert(response.responseText+' '+response.status);}
		});

		function MailOK(){
			alert('Le message a bien été envoyé.\nMerci !');
		}
}

