/* BaseModule javascript process */
var BaseModule = 
{
	init : function() 
	{
		/* Superfish section */
		
		$j("ul.menu").superfish
		(
		    {
				delay:         0,                	// the delay in milliseconds that the mouse can remain outside a submenu without it closing 
			    animation:     {opacity:'show'},   	// an object equivalent to first parameter of jQuery’s .animate() method 
			    speed:         'fast',           	// speed of the animation. Equivalent to second parameter of jQuery’s .animate() method 
			    autoArrows:    true,               	// if true, arrow mark-up generated automatically = cleaner source code at expense of initialisation performance 
			    dropShadows:   true,               	// completely disable drop shadows by setting this to false 
			    disableHI:     true,              	// set to true to disable hoverIntent detection 
			    onInit:        function(){},       	// callback function fires once Superfish is initialised – 'this' is the containing ul 
			    onBeforeShow:  function()
			    {
			    	$j('a', $j(this).parent()).addClass('hover_nav');			    				    	
			    },       
			    onShow:        function(){
			    	$j('.pagination li.current a').trigger('click')			    	
			    },       // callback function fires once reveal animation completed – 'this' is the opened ul 
			    onHide:        function()
			    {
			    	$j('a', $j(this).parent()).removeClass('hover_nav');
			    }    				
		    }
		); 		
		
		/* Added target blank to Centre de réussite menu */
		
		$j("#top_menu_3, #bottom_link_3").attr('target', '_blank')
				
		if( $j.browser.msie && parseInt(jQuery.browser.version) == 7)
		{
			$j('#top #top_menu ul li ul').css('margin-top', '0px');
		}
		
		
		/* Search text */
		
		BaseModule._findDefaultValue =  $j("#top_search_text").val();
		
		$j("#top_search_text")					
			.click
			(
				function()
				{
					if($j(this).val() == BaseModule._findDefaultValue)
					{
						$j(this).val('');
					}
				}
			)
			.blur
			(
				function()
				{
					if($j(this).val() == '')
					{
						$j(this).val(BaseModule._findDefaultValue);
					}							
				}
			)
		;		
	}
};
