
// JavaScript Document

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

function open_page(url){
	window.open(url, 'pop', 'toolbar=0, location=0,  directories=0, status=0, scrollbars=1, resizable=1, copyhistory=0, menuBar=0, width=700, height=550');
}

function menu(etat, no){
	var obj2 = document.getElementById("im_" + no);
	if(etat == 1) {
		obj2.style.visibility="visible";
	} else {
		obj2.style.visibility="hidden";
	}
}

function test_size(){
	var obj = document.getElementById("tab");
	//alert(obj.offsetHeight);
	//window.parent.resisze(obj.offsetHeight);
	window.parent.ouvre_mainframe(obj.offsetHeight);
}


var holdMenu = "";
var oldH;


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 comfirmation(url, phrase) {
	if(confirm('Voulez-vous vraiment supprimer ' + phrase + ' ?')){
		document.location.href=url;
	} 
}

