// site_global_params.js
// fichier javascript avec les paramètres récurrents du site

$(document).ready(function(){
	
	// construit le menu de navigation principal -------------------------------------
    $(".menuvertical li").hover(
			function(){ $("ul", this).fadeIn("fast"); }, 
			function() { } 
		);
    if (document.all) {
        $(".menuvertical li").hoverClass("sfHover");
    }
	// ---- fin

	$("#login_form input[@name=login]").focus(
			function() { if(this.value == 'Votre email') this.value = '';  }
			);
	$("#login_form input[@name=mdp]").focus(
			function() { if(this.value == 'Mot de passe') this.value = '';  }
			);
	$("#login_form").submit(
			function() {
				var formx = $("input[@name=login]",this);
				if(formx.val() == '' || formx.val() == 'Votre email') {
					$(formx).focus();
					return false;
				}
				var formx = $("input[@name=mdp]",this);
				if(formx.val() == '' || formx.val() == 'Mot de passe') {
					$(formx).focus();
					return false;
				}
			});
	
	// construit le form de perte de mot de passe -------------------------------------
    $(".link_passlost").toggle(
			function(){
				$("#link_passlost_form").attr('action','club_votre_compte_actions.php');
				$("#link_passlost_form").slideToggle("slow");
			},
			function(){
				$("#link_passlost_form").slideToggle("fast");
			}
		);
	// ---- fin
	//

});

$.fn.hoverClass = function(c) {
	return this.each(function(){
		$(this).hover( 
			function() { $(this).addClass(c);  },
			function() { $(this).removeClass(c); }
		);
	});
};

function getelementheight(cherche) {
	var maxh = 0;
	$(cherche).each(function(i){
		var height = $(this).height();
		//alert(height+'/ maxh:'+maxh);
		maxh = Math.max(height,maxh);			
	});
	//alert('maxh:'+maxh);
	return maxh;
}


//coin arrondi
// JavaScript Document
$(document).ready(function(){
  var settings = {
	  tl: { radius: 8 },
	  tr: { radius: 8 },
	  bl: { radius: 8 },
	  br: { radius: 8 },
	  antiAlias: true,
	  autoPad: false,
	  validTags: ["div"]
  }
  $(".rounded").curvy(settings);
});
  // or 
  // $(".myBox").curvy("20px");
  // or 
  // $(".myBox").curvy("20px top bottom");
  // or 
  // $(".myBox").curvy("20px tr tl br bl");
  