$(document).ready( function () {
  $("#formCpteSideHead").click(function() {
    toggleConnexion();
    return false;
  });

  $("#showformSide a").click(function() {
    togglePasswordForm();
    return false;
  });

  $("#PassSide a").click(function() {
    togglePasswordForm();
    return false;
  });

} ) ;

$.onAjax( function () {
	$(".formulaireAjax").formulaireAjax();

  // Le traitement des formulaires de connexion se fera en AJAX
  $("#formCpteSide form").formulaireAjax( function () {
      // Si la connexion est un succès, on rafraîchit la page
    if (!$("*", this).length)
      window.location.href = window.location.href;
    else
      $(this).addClass('courant');
  } );

  $("#PassSide form").formulaireAjax( function () {
    // Si la connexion est un succès, on rafraîchit la page
    if (!$("*", this).length)
      window.location.href = window.location.href;
    else
      $(this).addClass('courant');
  } );

} ) ;

function toggleConnexion()
{
//  alert($("#showformSide").elem.style.display);
  $("#showformSide").toggle();
  return false;
}

function togglePasswordForm()
{
  $("#formCpteSide").toggle();
  $("#PassSide").toggle();
}

