function active_taille_menu () {
if (document.getElementById("sep_scroll")) {	
		document.getElementById("sep_scroll").onmousedown = disableselect;
		document.getElementById("sep_scroll").onmouseup = endDrag;	
		var_ok = 0;				
}	
}


function detectMouse(e){
    if(parseInt(navigator.appVersion) >=4){
        if(navigator.appName == 'Netscape'){
		coo_y = e.pageY;
       } else{		
			if (IE7 == true || IE6 == true || IE8 == true) {
			coo_y = (window.event.clientY)+(document.documentElement.scrollTop);
			} else {		
			coo_y =  window.event.y;	   
	        }
		}
    }
	return coo_y;
	
}

function doDrag(e) {
//coo_y = detectMouse(e);
coo_y =mousePos.y;
position = $("#menu_gauche").position();
hauteur = $("#menu_gauche").css("height");
taille_nav = parseInt(parseInt(coo_y)- parseInt(position.top))-200;
//document.getElementById("menu_gauche").style.height = 500+"px";
modif_menu_gauche (taille_nav+140);
}


function endDrag(e) {	
hh = parseInt($("#menu_gauche .scroll-pane").css("height"));
setCookie("lat_scrollpane",hh,365);

if (document.all){
document.onmousemove=null;
} else {
window.onmousemove=null;		
}
var_ok = 0;
return true;
}


function disableselect(e){
if (document.all){
	document.onmousemove=doDrag;
	document.onmouseup=endDrag; 
	document.onselectstart= Function ('return false');
	//document.onselectstart = false;
	}else {
	window.onmousemove=doDrag;
	window.onmouseup=endDrag;
	}
//document.body.style.cursor="move";
//document.onmousemove = detectMouse;

var_ok = 1;
//document.onselectstart = false;
return false;	
}


function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    {
    c_start=c_start + c_name.length+1;
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    }
  }
return "";
}

function setCookie(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toUTCString())+";path=/";
}

function checkCookie(lecookie){
lavaleur=getCookie(lecookie);
	if (lavaleur!=null && lavaleur!="" && lecookie=="username") {
		document.getElementById("nav").style.width = lavaleur+"px";
	} else {
		if (document.getElementById("menu_"+lecookie) && lavaleur!=null && lavaleur!="" ) {
		document.getElementById("menu_"+lecookie).style.display = lavaleur;
		}	 
	}
}

function donne_valeur_scroll () {
taille_scroll = 0;
if(document.documentElement.scrollTop){
taille_scroll = document.documentElement.scrollTop;
}else if(window.pageYOffset) {
taille_scroll = window.pageYOffset;
}else if (document.body.scrollTop) {
taille_scroll = document.body.scrollTop;
}
return taille_scroll;
}


