
/*------------------------------------------------------------------------------------------
verifierLogin(mode, data)
	- mode 0, "requete" : demander au serveur la verification d'un login ( data = login )
	- mode 1, "reponse" : afficher un message selon que le login est valide ( data = true )
			ou invalide ( data = false )
------------------------------------------------------------------------------------------*/

var verifierGuildeReqHTTP;


/*------------------------------------------------------------------------------------------
verifierLoginReponse() : appelle par le XML Request
------------------------------------------------------------------------------------------*/

function verifierGuildeReponse() {
	
	try {
	// seulement si requete terminee et statut OK
	if (verifierGuildeReqHTTP.readyState == 4 && verifierGuildeReqHTTP.status == 200) {
		
		var responseXML = verifierGuildeReqHTTP.responseXML;
		
		var response =responseXML.getElementsByTagName('node')[0].getAttribute("result");
		var guilde =responseXML.getElementsByTagName('node')[0].getAttribute("guilde");
		
		document.getElementById('messageResponse').innerHTML = response;
		
		if (response == "")
			document.getElementById('registerPartTwo').className = 'visible';
		else
			document.getElementById('registerPartTwo').className = 'hidden';
	}
	} catch (error){  }
}



/*------------------------------------------------------------------------------------------
verifierLogin() : appelle par la page
------------------------------------------------------------------------------------------*/
function verifierGuilde(guilde) {
	
	url  = 'ajax_inscription/verifierGuilde.xml.php?guilde=' + guilde;
	
	verifierGuildeReqHTTP = chargerXMLDoc(url, verifierGuildeReponse);
}



