/*!
 * HTML5 Placeholder jQuery Plugin v1.8.2
 * @link http://github.com/mathiasbynens/Placeholder-jQuery-Plugin
 * @author Mathias Bynens <http://mathiasbynens.be/>
 */
(function(f){var e='placeholder' in document.createElement('input'),a='placeholder' in document.createElement('textarea');if(e&&a){f.fn.placeholder=function(){return this};f.fn.placeholder.input=f.fn.placeholder.textarea=true}else{f.fn.placeholder=function(){return this.filter((e?'textarea':':input')+'[placeholder]').bind('focus.placeholder',b).bind('blur.placeholder',d).trigger('blur.placeholder').end()};f.fn.placeholder.input=e;f.fn.placeholder.textarea=a}function c(h){var g={},i=/^jQuery\d+$/;f.each(h.attributes,function(k,j){if(j.specified&&!i.test(j.name)){g[j.name]=j.value}});return g}function b(){var g=f(this);if(g.val()===g.attr('placeholder')&&g.hasClass('placeholder')){if(g.data('placeholder-password')){g.hide().next().attr('id',g.removeAttr('id').data('placeholder-id')).show().focus()}else{g.val('').removeClass('placeholder')}}}function d(h){var l,k=f(this),g=k,j=this.id;if(k.val()===''){if(k.is(':password')){if(!k.data('placeholder-textinput')){try{l=k.clone().attr({type:'text'})}catch(i){l=f('<input>').attr(f.extend(c(this),{type:'text'}))}l.removeAttr('name').data('placeholder-password',true).data('placeholder-id',j).bind('focus.placeholder',b);k.data('placeholder-textinput',l).data('placeholder-id',j).before(l)}k=k.removeAttr('id').hide().prev().attr('id',j).show()}k.addClass('placeholder').val(k.attr('placeholder'))}else{k.removeClass('placeholder')}}f(function(){f('form').bind('submit.placeholder',function(){var g=f('.placeholder',this).each(b);setTimeout(function(){g.each(d)},10)})});f(window).bind('unload.placeholder',function(){f('.placeholder').val('')})}(jQuery));

$(document).ready( function () { 
	/* MENU ACCORDEON */
    // On cache les sous-menus sauf celui qui a un élément avec la classe "current_view" : 
    $(".navigation ul.subMenu").not(':has(li a.current_view)').hide();
    $(".navigation ul.subMenu:has(li a.current_view)").prev('a').addClass("open");
    $(".navigation ul.subMenu").each(function() {
    	if ($(this).prev('.current_view').length != 0) {
    		$(this).show();
            $(this).prev('a').addClass("open");
        }
    });
    
    // On modifie l'évènement "click" sur les liens dans les items de liste qui portent la classe "toggleSubMenu" : 
    $(".navigation > li.toggleSubMenu > a span").click( 
    	function() {
            $(".navigation ul.subMenu").not(':has(li a.current_view)').slideUp("normal");
            if ($(this).parent().next("ul.subMenu:visible").length == 0) { 
            	$(this).parent().next("ul.subMenu").slideDown("normal");
                $(this).parent().addClass("open");
        	}
            else { $(this).parent().removeClass("open"); }
            return false;
    	}  
	);
 	/* FIN MENU ACCORDEON */
   
    /* placeholder dans les input de recherche du layout */
    $('input').placeholder();
 
    /*
    $("#InscritIndexForm").validate({
        errorElement: "div",
        errorClass: "error-message",
        rules: {
            "data[Inscrit][email]": {
                required: true,
                email: true
            }
        }
    });
    */
});

