$(document).ready(function(){

	if (!($.browser.msie) || (($.browser.msie) && (parseInt($.browser.version) > 8))) {
		$(".pave, #contactform, .bouton img, .realisations .item").corner();
		$("#partenaires img").corner("3px");
	}
	
	$("#contactform").validate(); 
	
	$('#rsociaux img').tipsy({title: 'alt', gravity: 's', fade: false});

	var move = -20;
	var zoom = 1.2;
	$('.item').hover(function() {
		width = $('.item').width() * zoom;
		height = $('.item').height() * zoom;
		$(this).find('.img').stop(false,true).animate({'width':width, 'height':height, 'top':move, 'left':move}, {duration:200});
		$(this).find('div.caption').stop(false,true).fadeIn(200);
	},
	function() {
		$(this).find('.img').stop(false,true).animate({'width':$('.item').width(), 'height':$('.item').height(), 'top':'0', 'left':'0'}, {duration:100});	
		$(this).find('div.caption').stop(false,true).fadeOut(200);
	});

});

$.validator.addMethod("phone", function(ph, element) {
	if (ph == null) {
		return false;
	}
	var stripped = ph.replace(/[\s()+-]|ext\.?/gi, "");
	return ((/\d{10,}/i).test(stripped));
}, "Veuillez entrer un numéro de téléphone valide.");
