/*
Le premier visionnage d'une page du site avec IE6
redirige automatiquement vers /web/guest/redirection-ancien-navigateur
*/
if(manageCookie("alertnav")!="ok"){
	if(jQuery.browser.msie){
		  if(jQuery.browser.version.number<7){
				jQuery.cookie("alertnav", "ok", { expires: 7 });
				document.location.href="/web/guest/redirection-ancien-navigateur";
		  }
	}
}

jQuery(document).ready(

	/*
	This function gets loaded when all the HTML, not including the portlets, is
	loaded.
	*/

	function() {
	
	initMenusAccordeon()
	
    jQuery("div.maintenance").parents("div.portlet").addClass("portletMaintenance");
	
	jQuery("#navigation ul li a span").each(function(){ 
	  /** 
	   * Place la premiere lettre de chaque mot du menu dans un span
	   */ 
	   // Parse the text into an array 
	   var arr = this.innerHTML.split(/\s+|-+/); 
	   // Generate span's for each item in the array 
	   for( var i = 0; i < arr.length; i++ ) 
	   {
		arr[i] = "<span>" + arr[i].substr(0,1) + "</span>" + arr[i].substr(1); 
	   }    
	   // 4. Replace the contents of the original link 
	   this.innerHTML = arr.join(" "); 
	})
	
	
	jQuery(".nav-menu ul.level-1>li>a:contains('Maintenance')").each(function(){ 
		jQuery(this).addClass("maintenance");
	})
	
	}
);

Liferay.Portlet.ready(

	/*
	This function gets loaded after each and every portlet on the page.

	portletId: the current portlet's id
	jQueryObj: the jQuery wrapped object of the current portlet
	*/

	function(portletId, jQueryObj) {
	}
);

jQuery(document).last(

	/*
	This function gets loaded when everything, including the portlets, is on
	the page.
	*/

	function() {
	}
);

