/**
 * Fonctions Javascript diverses
 * author Olivier Troboe
 * 13/06/08
 * copyright (c) 2008 Copyright AVISTEL - All rights reserved
 */

// Flag exécution du showhide
var get_data = false;

//Affiche / Cache un élément en modifiant sa taille
function showhide(id, height) 
{
	if (document.getElementById)
	{
		obj = document.getElementById(id);
		if (obj.style.display == "none")
		{
			obj.style.height = height+"px";
			obj.style.display = "";
			get_data = true;
		}
		else
		{
			obj.style.display = "none";
			get_data = false;
		}
	}
}

// Affiche un élément
function show(obj,height)
{
	if ((obj) && (obj.style.display == "none"))
	{
		obj.style.height = height+"px";
		obj.style.display = "";
	}
}

// Rafraichissement d'une page
function refresh(url)
{
	document.location.replace(url);
}

// Vide une liste déroulante
function vide_liste(liste) 
{
	//Suppression de l'élément d'option
	var option = liste.getElementsByTagName("option");
	var Length = option.length;
	for (i=0;i<Length;i++) {
		liste.removeChild(option[option.length-1]);
	}
}


