var login_modifie = false;
function verifier_login()
{
	if( login_modifie == false )
		{
		login_modifie = true;
		$( "identification_identifiant" ).value = "";
		$( "identification_mot_de_passe" ).value = "";
		}
}



function identifier_retour( reponse )
{
	var tempo = $( 'tempo_login' );
	$( 'tempo_login' ).innerHTML = reponse.responseText;
	if( $( 'login-on' ) == null )
		{
		tempo.innerHTML = "";
		$( 'identification_identifiant' ).disabled = false;
		$( 'identification_mot_de_passe' ).disabled = false;
		$( 'identification_go' ).disabled = false;
		Element.hide( 'identification_message_en_cours' );
		Element.show( 'identification_message_pb' );
		}
	else
	{
		$( 'bloc_login' ).innerHTML = $( 'login-on' ).outerHTML;
		recharger_ajax( reponse );
	}
}

function deconnecter_retour( reponse )
{
	var tempo = $( 'tempo_login' );
	login_modifie = false;
	$( 'tempo_login' ).innerHTML = reponse.responseText;
	$( 'bloc_login' ).innerHTML = $( 'login-off' ).outerHTML;
	recharger_ajax( reponse );
	$('identification_mot_de_passe').value="xxxx";
}

function recharger_ajax( reponse )
{	
	var ptr = $( 'tempo_ajax' );
	ptr.innerHTML = reponse.responseText;
	var block_ajax = getElementsByClassName(ptr, "reload_ajax");
	ptr.innerHTML = "";	
	for (var indice in block_ajax)
	{  
		if(typeof(block_ajax[indice])=="string")
		{
			$( indice ).innerHTML = block_ajax[indice];
		}		
	}	 
}

function getElementsByClassName( ptr, clsName ) 
{ 
	var arr = new Array(); 
	var elems = ptr.getElementsByTagName("*");
	for ( i = 0; ( elem = elems[i] ); i++ )
	{		
		if ( elem.className == clsName )
		{
			if( typeof( elem.innerHTML ) != "undefined" )
			{
				var id = elem.getAttribute("id");
				arr[id] = elem.innerHTML;	
			}
		}
	}
	return arr;
}

