var holdMenu = "";
var oldH;

function voleur(e)
{ return false; }

function bien()
{ return true; }

function disable(){
	document.onselectstart=new Function ("return false");	
	if (window.sidebar){
		document.onmousedown=voleur;
		document.onclick=bien;
	}
}

function open_pop(id){
	var url="view_photo.php?path="+id;
	window.open(url, 'zoom', 'toolbar=0, location=0,  directories=0, status=0, scrollbars=0, resizable=1, copyhistory=0, menuBar=0, width=600, height=450');
}

var oldGamme = "gamme1";

function style_gamme(idGamme){
	var ligne = document.getElementById(oldGamme);
	ligne.className = "ligne_gamme";
	oldGamme = idGamme;
	var ligne = document.getElementById(idGamme);
	ligne.className = "ligne_gamme_on";
	
}

function ouvre(id){
	
	if(holdMenu){
		var objHold = document.getElementById(holdMenu);
		sizeTween = new Tween(objHold.style,'height',Tween.regularEaseInOut,oldH,0,0.3,'px');
		sizeTween.start();
	}
	
	if(holdMenu != id){
	
		var obj = document.getElementById(id);
		var h = obj.scrollHeight;
		holdMenu = id;
		oldH = h;
		
		//sizeTween = new Tween(obj.style,'height',Tween.elasticEaseOut,0,h,1.2,'px');
		sizeTween = new Tween(obj.style,'height',Tween.regularEaseInOut,0,h,0.7,'px');
		sizeTween.start();	
	} else {
		holdMenu = "";
	}
}

function montre(id) {
	var d = document.getElementById(id);	
	if (d) {		
		var h = d.scrollHeight;
		d.style.height=h + 'px';
		oldH = h;
		holdMenu = id;
		}
}

function cherche(){
	var mc = document.getElementById('mc').value;
	
	var url = "resultats.php?mc=" + mc;
	document.location.href=url;
	
}