window.onload=function(){
Nifty("ul#nav a","small transparent top");
Nifty("div#boxright,div#boxleft","small transparent top");
}

function checkEmail(val) {
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(val))
	return (true)
else
	return (false)
}

$(function() {
  $('#contactform').submit(function(e) {
    if (checkEmail($("#email").val()) == true && $("#pseudo").val() != '' && $("#sujet").val() != '' && $("#message").val() != '' && $("#security").val() == $("#code").val() ) {
      return true;
    } 
	else 
	{
		var msg='';
		
		if (checkEmail($("#email").val()) == false)
		{
			msg=msg + "Veuillez entrer une adresse e-mail valide ! \n";
		}
		if ($("#pseudo").val() == '' )
		{
			msg=msg + "Veuillez entrer votre prénom ! \n";
		}
		if ($("#sujet").val() == '' )
		{
			msg=msg + "Veuillez entrer un sujet ! \n";
		}
		if ($("#message").val() == '')
		{
			msg=msg + "Veuillez entrer un message ! \n";
		}
		if ($("#security").val() != $("#code").val())
		{
			msg=msg + "Veuillez saisir un code securité correct !";
		}
		alert(msg);
		
	}
    return false;
  });
});
jQuery(function() {
	$('.twitter-follow').css('background-position', '0 0');
	$('.twitter-follow').hover(function(){
		$(this).stop().animate({
			backgroundPosition: '-100px 0px'
		},100);
	},function(){
		$(this).stop().animate({
			backgroundPosition: '0px 0px'
		},100);
	});

	$('.facebook-follow').css('background-position', '0 -70px');
	$('.facebook-follow').hover(function(){
		$(this).stop().animate({
			backgroundPosition: '-100px -70px'
		},100);
	},function(){
		$(this).stop().animate({
			backgroundPosition: '0px -70px'
		},100);
	});

	$('.rss-follow').css('background-position', '0 -140px');
	$('.rss-follow').hover(function(){
		$(this).stop().animate({
			backgroundPosition: '-100px -140px'
		},100);
	},function(){
		$(this).stop().animate({
			backgroundPosition: '0px -140px'
		},100);
	});
});
