/*******************************************************************************************************/
/*                                                                                                     */
/*  Description................:  Fonctions Javascript générales.                                      */
/*  Type.......................:  Fichier Javascript                                                   */
/*  Auteur.....................:  Maxime Jobin                                                         */
/*  Date de création...........:  2009-10-23                                                           */
/*  Date de modification.......:  2009-10-23                                                           */
/*                                                                                                     */
/*******************************************************************************************************/

/*****************************************************************************/
/* FONCTIONS                                                                 */
/*****************************************************************************/

/*=============================================================================*
	Affiche/Masque un DIV.
/*=============================================================================*/
  function ToogleDiv(divID)
  {
		var divToToogle = document.getElementById(divID);
		if(divToToogle.style.display == '')
			divToToogle.style.display = 'none';
		else
			divToToogle.style.display = '';			
  }

/*=============================================================================*
	Affiche/Masque le div de connexion.
/*=============================================================================*/
  function ToogleDivConnexion()
  {
		var divConnexion = document.getElementById('divConnexion');
		var aConnexion = document.getElementById('aConnexion');
		var txtAdminMdp = document.getElementsByTagName('input')[2];
		if(divConnexion.style.display == 'block')
		{
			divConnexion.style.display = 'none';
			aConnexion.style.display = 'block';
		}
		else
		{
			divConnexion.style.display = 'block';			
			aConnexion.style.display = 'none';
			txtAdminMdp.focus();
		}
  }
	
	/*=============================================================================*
		Transforme un bouton en texte d'attente
	/*=============================================================================*/
	function boutonToAttenteText(bouton_id)
	{
		var bouton = document.getElementById(bouton_id);
		var spanPatienter = document.createElement("span");
		var texte = document.createTextNode("Veuillez patienter...");
		spanPatienter.appendChild(texte);
		bouton.style.display = "none";
		spanPatienter.style.display = "block";
		spanPatienter.style.fontWeight = "bold";
		spanPatienter.style.color = "#c1c1c1";
		spanPatienter.style.margin = "5px";
		bouton.parentNode.insertBefore(spanPatienter,bouton);
	}
	
	/*=============================================================================*
		Cache le texte Rechercher du champ de recherche
	/*=============================================================================*/
	function hideRechercheText(bouton_id)
	{
		var txt = document.getElementById(bouton_id);
		txt.style.background = "white";
	}
	
	/*=============================================================================*
		Remet le texte Rechercher du champ de recherche
	/*=============================================================================*/
	function showRechercheText(bouton_id)
	{
		var txt = document.getElementById(bouton_id);
		if(txt.value == "")
			txt.style.background = "white url('/prado-themes/Basic/images/rechercher.gif') no-repeat";
	}






