
function getTxtAideRecherche()
{
	var txt_aide_recherche = '';
	
	txt_aide_recherche += '<table class="table_aide_recherche" cellspacing="0" cellpadding="0" border="0">';

	txt_aide_recherche += '<tr>';
	txt_aide_recherche += '<td class="table_aide_recherche_titre">Comment effectuer la recherche d&#39;un cours ?';
	txt_aide_recherche += '</td>';
	txt_aide_recherche += '</tr>';

	txt_aide_recherche += '<tr>';
	txt_aide_recherche += '<td class="table_aide_recherche_titre1">Chercher au moins un mot parmi une liste, en les s&eacute;parant par un espace';
	txt_aide_recherche += '</td>';
	txt_aide_recherche += '</tr>';

	txt_aide_recherche += '<tr>';
	txt_aide_recherche += '<td class="table_aide_recherche_texte1">';
	txt_aide_recherche += '<span class="table_aide_recherche_ex">ex : circuits pneumatiques</span> <br /><span class="table_aide_recherche_texte2">cherche les cours qui contiennent au moins l&#39;un de ces mots.</span>';
	txt_aide_recherche += '</td>';
	txt_aide_recherche += '</tr>';


	txt_aide_recherche += '<tr height="6px">';
	txt_aide_recherche += '<td>&nbsp;';
	txt_aide_recherche += '</td>';
	txt_aide_recherche += '</tr>';

	txt_aide_recherche += '<tr>';
	txt_aide_recherche += '<td class="table_aide_recherche_titre1">Indiquez les mots qui doivent &ecirc;tre obligatoirement pr&eacute;sents avec un +';
	txt_aide_recherche += '</td>';
	txt_aide_recherche += '</tr>';


	txt_aide_recherche += '<tr>';
	txt_aide_recherche += '<td class="table_aide_recherche_texte1">';
	txt_aide_recherche += '<span class="table_aide_recherche_ex">ex : +circuits +pneumatiques</span><br/><span class="table_aide_recherche_texte2">les deux mots doivent &ecirc;tre pr&eacute;sents.</span>';
	txt_aide_recherche += '</td>';
	txt_aide_recherche += '</tr>';

	txt_aide_recherche += '<tr height="6px">';
	txt_aide_recherche += '<td>&nbsp;';
	txt_aide_recherche += '</td>';
	txt_aide_recherche += '</tr>';

	txt_aide_recherche += '<tr>';
	txt_aide_recherche += '<td class="table_aide_recherche_titre1">Eliminez les r&eacute;sultats inutiles avec un -';
	txt_aide_recherche += '</td>';
	txt_aide_recherche += '</tr>';



	txt_aide_recherche += '<tr>';
	txt_aide_recherche += '<td class="table_aide_recherche_texte1">';
	txt_aide_recherche += '<span class="table_aide_recherche_ex">ex : +circuits +pneumatiques -s&eacute;quentielle</span><br /><span class="table_aide_recherche_texte2">les deux mots &#39;circuits&#39; et &#39;pneumatiques&#39; doivent &ecirc;tre pr&eacute;sents, mais pas le mot &#39;s&eacute;quentielle&#39;.</span>';
	txt_aide_recherche += '</td>';
	txt_aide_recherche += '</tr>';

	txt_aide_recherche += '<tr height="6px">';
	txt_aide_recherche += '<td>&nbsp;';
	txt_aide_recherche += '</td>';
	txt_aide_recherche += '</tr>';



	txt_aide_recherche += '<tr>';
	txt_aide_recherche += '<td class="table_aide_recherche_titre1">Chercher des parties de mots avec *';
	txt_aide_recherche += '</td>';
	txt_aide_recherche += '</tr>';


	txt_aide_recherche += '<tr>';
	txt_aide_recherche += '<td class="table_aide_recherche_texte1">';
	txt_aide_recherche += '<span class="table_aide_recherche_ex">ex : &eacute;lectr*</span><br /><span class="table_aide_recherche_texte2">cherche tous les mots commen&ccedil;ant par &#39;&eacute;lectr&#39;.</span>';
	txt_aide_recherche += '</td>';
	txt_aide_recherche += '</tr>';

	txt_aide_recherche += '<tr height="6px">';
	txt_aide_recherche += '<td>&nbsp;';
	txt_aide_recherche += '</td>';
	txt_aide_recherche += '</tr>';


	txt_aide_recherche += '<tr>';
	txt_aide_recherche += '<td class="table_aide_recherche_titre1">Chercher des r&eacute;sultats exacts avec &quot;';
	txt_aide_recherche += '</td>';
	txt_aide_recherche += '</tr>';



	txt_aide_recherche += '<tr>';
	txt_aide_recherche += '<td class="table_aide_recherche_texte1">';
	txt_aide_recherche += '<span class="table_aide_recherche_ex">ex : &quot;circuits pneumatiques&quot;</span><br /><span class="table_aide_recherche_texte2">cherche l&#39;entit&eacute; exacte &#39;circuits pneumatiques&#39;.</span>';
	txt_aide_recherche += '</td>';
	txt_aide_recherche += '</tr>';

	txt_aide_recherche += '<tr height="6px">';
	txt_aide_recherche += '<td>&nbsp;';
	txt_aide_recherche += '</td>';
	txt_aide_recherche += '</tr>';


	txt_aide_recherche += '<tr>';
	txt_aide_recherche += '<td class="table_aide_recherche_titre1">Majuscules ou minuscules';
	txt_aide_recherche += '</td>';
	txt_aide_recherche += '</tr>';


	txt_aide_recherche += '<tr>';
	txt_aide_recherche += '<td class="table_aide_recherche_texte1">';
	txt_aide_recherche += 'Aucune importance, cela ne fait aucune diff&eacute;rence.';
	txt_aide_recherche += '</td>';
	txt_aide_recherche += '</tr>';


	txt_aide_recherche += '</table>';


	return txt_aide_recherche;
}

function aide()
{
}

function addImgPreload(dirbase,urlImg)
{
	var img = "";

	if (dirbase == "")
		img = "./imagestyle/" + urlImg;
	else
		img = dirbase + urlImg;

	ImgPreload[ImgPreload.length] = img;
}


function preLoadImages(urlImg)
{
	var imgs = new Array(urlImg.length);

	for (var i=0; i < urlImg.length; i++)
	{
	  imgs[i] = new Image();
	  imgs[i].src =  urlImg[i];
	}
}

function rechercherChange()
{
	if (isRechercherOk())
		btnOkRechercher(true);
	else
		btnOkRechercher(false);
}

function btnOkRechercher(enabled)
{
	var elt = document.getElementById("btn_ok_rech");

	if (enabled)
		elt.src='./imagestyle/btn_ok.gif';
	else
		elt.src='./imagestyle/btn_ok_disabled.gif';
}

function isRechercherOk()
{
	txt = getValueInputformulaire('form_recherche','input_recherche');

	if (txt == '')
	{
		return(false);
	}
	else
		return(true);
}

function mouseoutBtnOkRecherche()
{
	if (isRechercherOk())
		btnOkRechercher(true);
	else
		btnOkRechercher(false);
}


function mouseoverBtnOkRecherche()
{
	var elt = document.getElementById("btn_ok_rech");

	if (isRechercherOk())
		elt.src='./imagestyle/btn_ok_over.gif';
	else
		btnOkRechercher(false);
}



function clavierRechercher(ev)
{
	var code = ev.keyCode;

	if (code==13)
	{
		Rechercher();
	}

}

function Rechercher()
{
	if (isRechercherOk())
		document.form_recherche.submit();
}


function clavierIndentification(ev)
{
	var code = ev.keyCode;

	if (code==13)
	{
		identificationGanesha();
	}
}

function btnOkIdent(enabled)
{
	var elt = document.getElementById("btn_ok_ident");

	if (enabled)
		elt.src='./imagestyle/btn_ok.gif';
	else
		elt.src='./imagestyle/btn_ok_disabled.gif';
}

function identificationChange()
{
	if (isLoginGaneshaOk())
		btnOkIdent(true);
	else
		btnOkIdent(false);
}

function mouseoutBtnOkIdent()
{
	if (isLoginGaneshaOk())
		btnOkIdent(true);
	else
		btnOkIdent(false);
}


function mouseoverBtnOkIdent()
{
	var elt = document.getElementById("btn_ok_ident");

	if (isLoginGaneshaOk())
		elt.src='./imagestyle/btn_ok_over.gif';
	else
		btnOkIdent(false);
}


function isLoginGaneshaOk()
{
	login = getValueInputformulaire('form_login','txtuser');
	pwd   = getValueInputformulaire('form_login','txtpassword2');

	if ( (pwd == '') || (login == '') || (login == ' > Identifiant') || (pwd == ' > passe') )
	{
		return(false);
	}
	else
		return(true);
}


function LoginGanesha()
{
	if (isLoginGaneshaOk())
	{
		login = getValueInputformulaire('form_login','txtuser');
		pwd   = getValueInputformulaire('form_login','txtpassword2');

		setValueInputformulaire('form_login','txtpassword',pwd);
		setValueInputformulaire('form_login','txtpassword2','');

		return(true);
	}
	else
	{
		alert ('L\'identifiant ou le mot de passe est vide !');
		return(false);
	}
}


function identificationGanesha()
{
	if (isLoginGaneshaOk())
	{
		LoginGanesha();

		document.form_login.submit();
	}
}




function caddie()
{
	location.href = coderPageUrl('Caddie.php');
}

function compteClient()
{
	location.href = coderPageUrl('CompteClient.php');
}



function remplacerChamp (champ, test, val)
{
	if (champ.value == test)
		champ.value = val;
}



function chargement ()
{
	Tooltip.init();

	elt = document.getElementById("input_recherche");
	if (elt)
	{
		doSetCaretPosition(elt,elt.value.length);

		rechercherChange();
	}

	onLoad_Page();


	// image du domaine initialement actif
	imagesDomaineInitiale();

}



function montreCoursDomaine(id)
{
	var sURL = new String(unescape(document.location.href));

	var newURL = "";

	if (isMenuDomaineVisible(id))
		id = -1;

	var index = sURL.indexOf("?");

	if(index == -1)
	{
		newURL = sURL + "?domaineid=" + id;
	}
	else
	{
		newURL = sURL.substring(0,index);

		var args = sURL.substring(index + 1, sURL.length).split("&");

		var domaineTrouve = false;

		for(i=0; i < args.length; i++)
		{
			var key = args[i].split("=")[0];

			var keyVal = args[i].split("=")[1];

			//alert(key + "=" + keyVal);

			if (key == "domaineid")
			{
				keyVal = id;
				domaineTrouve = true;
			}

			var newKeyVal  = new String(keyVal);

			//alert("avant " + newKeyVal);

			var indexDiese = newKeyVal.indexOf("#");
			if (indexDiese != -1)
			{
				newKeyVal = newKeyVal.substring(0,indexDiese);
			}

			//alert("apres " + newKeyVal);

			if (i == 0)
				newURL += "?" + key + "=" + newKeyVal;
			else
				newURL += "&" + key + "=" + newKeyVal;
		}

		if (domaineTrouve == false)
			newURL =  newURL + "&domaineid=" + id;
	}


	//alert(newURL);

	location.href = newURL;

}

