/* Nécessite les scripts
JSFX_Layer.js; JSFX_Browser.js; JSFX_FloatingLayer.js
*/ 
var larg_ecran_utile = null;   
var posXi_menu = null;
var posX_menu = null;

//alert( larg_ecran_utile + " - " + posX_menu + " - " + posXi_menu);
 
var name = "#contener_menu";
var menuYloc = null;  
var posX_menu = 0;
var posXi_menu = 0;

jQuery(document).ready(function(){	
  	//alert ("ok"); 
	larg_ecran_utile = parseInt(jQuery("#page").width());
	posX_menu =	(parseInt((jQuery(window).width() - larg_ecran_utile)/2)) + "px";
	posXi_menu = (parseInt(((jQuery(window).width() - larg_ecran_utile)/2)+ larg_ecran_utile) - 43) + "px";		
	//alert(jQuery(window).width() + " - " + larg_ecran_utile + " - " + posX_menu + " - " + posXi_menu);
	//menuXloc = parseInt(jQuery(name).css("left").substring(0,jQuery(name).css("left").indexOf("px")));
	menuYloc = parseInt(jQuery(name).css("top").substring(0,jQuery(name).css("top").indexOf("px")));
	jQuery(window).scroll(function () {   
		//offsetx = menuXloc+jQuery(document).scrollLeft()+"px";
		//jQuery(name).animate({left:offsetx},{duration:500,queue:false});
		offsety = menuYloc+jQuery(document).scrollTop()+"px";
		jQuery(name).animate({top:offsety},{duration:500,queue:false});
	});
}); 

// --- Affichage du menu au survol de la souris sur le bouton menu --------------------------------	
/* Temporisation au survol de la souris
http://www.developpez.net/forums/d675714/webmasters-developpement-web/javascript/bibliotheques-frameworks/jquery/mouseover-pendant-x-secondes/
<a href="#" onmouseover="attente=setTimeout(function(){alert('Test');},500);" onmouseout="clearTimeout(attente)">Test</a>
*/

function affMenu() { 
	jQuery(document).ready(function(){	
		jQuery("#contener_menu").css("left",posX_menu);
		jQuery("#bouton_menu").css("visibility","hidden");
		jQuery("#menu").css("width","auto");
		jQuery("#menu").css("visibility","visible");
	});  
} 

// --- Masquage du menu au click de la souris sur le menu -----------------------------------------	  

function cacheMenu() {	
	jQuery(document).ready(function(){		
		jQuery("#contener_menu").css("left",posXi_menu); 
		jQuery("#contener_menu").css("visibility","hidden");
		jQuery("#bouton_menu").css("visibility","visible");
		jQuery("#menu").css("width","0px");
		jQuery("#menu").css("visibility","hidden");	 
	});
} 

