$(document).ready(function(){

 $("#sidebar .widget-title").click(function(){
  if ($(this).parent().hasClass("closed")) {
   $(this).parent().find(".widget-content").slideDown();
   $(this).parent().removeClass("closed");
  }
  else {
   $(this).parent().find(".widget-content").slideUp("",function() {
    $(this).parent().addClass("closed");  
   });
  }
 });
   
 $('a[rel*=lightbox]').lightBox(); 
 
 $("a.email").click(function() {
  var target = $(this).attr("href").replace("-at-","@");
  target = target.replace("-dot-",".");
  $(this).attr("href",target);
 });
 
 $("form.concours").submit(function() {
  var nom = $("form.concours #name").val();
  var email = $("form.concours #email").val();
  if ((nom == '') || (email == '')) {
   $("div.error-message").show('slow');
   return false;
  }
  else {
   var action = $(this).attr("action")+"&action=save";
   $(this).attr("action",action);
  } 
 });
 
});

