$(document).ready(function() {
  lightbox('<?=__racineweb__?>'); 
  menu();
  plusmoins();
  $(".diaposlide").easySlider({
    auto: true,
		continuous: true,
		controlsShow:false
  });
  $(".infoperso").fancybox({
    'overlayOpacity'	:	0.7,
		'overlayColor'		:	'#FFF',
		'hideOnContentClick': false,
		'showCloseButton':false,
		'width':963,
		'height':660,
		'frameWidth':963,
		'frameHeight':660,
		'padding':0,
    'margin':0,
    'autoScale':false,
    'autoDimensions':true
	});
	$(".linkunder").fancybox({
    'overlayOpacity'	:	0.7,
		'overlayColor'		:	'#FFF',
		'hideOnContentClick': true,
		'showCloseButton':false,
		'width':768,
		'height':547,
		'padding':0,
    'margin':0,
    'autoScale':false,
    'autoDimensions':true
	});
	$(".com").click(function(){		
    $("#infocommentaire").slideDown('slow');
  });
	$(".com").click(function(){		
    $("#infocommentaire").slideDown('slow');
  });
  $("#diapo2").click(function(){
    if($("#diapo2").css("height")=="271px")
    $("#diapo2").animate({height:"55px"},"slow");
    else		
    $("#diapo2").animate({height:"271px"},"slow");
  });
  $(".jour").hover(function(){		
    $(this).find(".tooltip").fadeIn('slow');
  },function(){		
    $(this).find(".tooltip").fadeOut('slow');
  }
  );
  $(".jourdebut").hover(function(){		
    $(this).find(".tooltip").fadeIn('slow');
  },function(){		
    $(this).find(".tooltip").fadeOut('slow');
  }
  );
  $(".jourfin").hover(function(){		
    $(this).find(".tooltip").fadeIn('slow');
  },function(){		
    $(this).find(".tooltip").fadeOut('slow');
  }
  );
  
  $.post('tpl/lastweet.php', function(data) {
    $('#tweettxt').html(data);
  });
  
})
function validateAdhesion(obj){
  if(obj.tel.value==""){
    alert("Veuillez indiquer votre téléphone")
    obj.tel.focus();
    return false;
  }
  if(!estuneadressemail(obj.email.value)){
    alert("Veuillez indiquer votre email");
    obj.email.focus();
    return false;
  }
  if(obj.nom.value==""){
    alert("Veuillez indiquer votre nom")
    obj.nom.focus();
    return false;
  }
  if(obj.prenom.value==""){
    alert("Veuillez indiquer votre prénom")
    obj.prenom.focus();
    return false;
  }
  if(obj.entreprise.value==""){
    alert("Veuillez indiquer votre entreprise")
    obj.entreprise.focus();
    return false;
  }
  return true;
}
function estuneadressemail(monemail)
{
flag=false;
	if(monemail!="")
	{
	longueur=monemail.substring(monemail.lastIndexOf("."),monemail.length).length
		if(monemail.indexOf("@")!=-1&&(longueur==3||longueur==4))
		{
			if(monemail.indexOf("@")<monemail.lastIndexOf(".")+1)
				flag= true;
		}
	}
return flag;
}
