//-------------------------------------------
// éèëê - test UTF-8
//-------------------------------------------

/*function trim(str, chars) {
	return ltrim(rtrim(str, chars), chars);
}
 
function ltrim(str, chars) {
	chars = chars || "\\s";
	return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
}
 
function rtrim(str, chars) {
	chars = chars || "\\s";
	return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
}*/

$( document ).ready( function()
{
	// ajout du lien Recherche
	var recherche = $( 'div#recherche form' ) ;
	var lien = $( '<a></a>' ).attr( { 'href': '#' , 'class': 'bouton_recherche' } ).text( 'OK' ) ;
	lien.appendTo( recherche ).each( function()
	{
		this.onclick = function()
		{
			document.getElementById( 'formulaireRecherche' ).submit() ;
		}
	} ) ;

	// ajout du lien Connexion
	var connexion = $( 'div#connexion form a:first' ) ;
	var lien = $( '<a></a>' ).attr( { 'href': '#' , 'class': 'bouton_connexion' } ).text( 'OK' ).each( function()
	{
		this.onclick = function()
		{
			document.getElementById( 'formulaireConnexion' ).submit() ;
		}
	} ) ;
	connexion.before( lien ) ;

	// ajout du lien Inscription
/*	var inscription = $( 'form#formulaireInscription' ) ;
	var lien = $( '<a></a>' ).attr( { 'href': '#' , 'class': 'bouton_inscription' } ).text( 'Inscription' ) ;
	lien.appendTo( inscription ).each( function()
	{
		this.onclick = function()
		{
			document.getElementById( 'formulaireInscription' ).submit() ;
		}
	} ) ;
*/	
	// mise en place de certains boutons demandant confirmation
	var lien_de_confirmation = $( 'a.confirmation' ) ;
	lien_de_confirmation.each( function()
	{
		var href_lien = this.href ;
		this.href = '#' ;
		this.onclick = function()
		{
			if ( confirm( 'Vous allez effectuer une action critique, voulez-vous continuer ?' ) )
			{
				self.location = href_lien ;
			}
		} ;
	} ) ;
	
	$( 'form.confirmation' ).submit( function()
	{
		var sortie = false ;
		if ( confirm( 'Vous allez effectuer une action critique, voulez-vous continuer ?' ) )
		{
			sortie = true ;
		}
		return sortie ;
	} ) ;
} ) ;

function actif_login(a)
{
	if	( a.value=="Pseudo")
	{
		a.value="" ;
	}
}

//-------------------------------------------