// REQUIERT Prototype.js
// REQUIERT Tween.js

window.onload = function  () {
	// Fermer tous les détails
	$('liste').select('div.contact_cadre').each(closeContact);
}
function openCloseContact (id) {
	var element = $(id);
	if (element) {
		var obj = element.down ('.contact_ligne2');;
		if (obj.style.height == '0px') {
			openContact (id);
		} else  {
			closeContact (id);
		}
	}
}

function openContact (id) {
	var element = $(id);
	if (element) {
		// Ouvrir le calque
		var obj = element.down ('.contact_ligne2');
		if (obj) {
			var h = obj.scrollHeight;	
			sizeTween = new Tween (obj.style,'height',Tween.regularEaseInOut,0,h,0.5,'px');
			sizeTween.start();
		}
	}
}

function closeContact (id) {
	var element = $(id);
	if (element) {
		// Ouvrir le calque
		var obj = element.down ('.contact_ligne2');
		if (obj) {
			var h = obj.scrollHeight;	
			sizeTween = new Tween (obj.style,'height',Tween.regularEaseInOut,h,0,0.7,'px');
			sizeTween.start();
		}
	}
}