/**
 * Librarie javascript de l'authentification
 *
 * @author		Julie Tétard <julie@2jstudio.com> 
 * @version		E-cog 3.0
 * @package		public
 * @subpackage	auth
 * @category	js
 * @internal	last modified
 */


/**
 * Attache événements
 */
ECOG_smartAttachEvent(window, 'load', ECOG_auth_initEvents, false);



/**
 * Fonctions d'initalisation
 */
 
	/**
	 * Fonction initialisant les actions
	 *
	 * @return		-
	 */
	function ECOG_auth_initEvents() 
	{
		ECOG_smartAttachEvent($('e_auth'), 'submit', ECOG_auth_checkValidate, false);
	}



/**
 * Fonctions d'exécution
 */

	
	/**
	 * Fonction atteignant l'url
	 *
	 * @param		object		event		Objet évenement
	 * @return		-
	 */
	function ECOG_auth_checkValidate(event) {
		//
		var warn = Array();
		if ($('e_login').value == '' || $('e_login').value == $('e_login').title) {
			warn.push('votre identifiant');
		}
		if ($('e_password').value == '' || $('e_password').value == $('e_password').title) {
			warn.push('votre mot de passe');
		}
		if (warn.length > 0) {
			alert('Vous devez renseigner ' + warn.join(' et '));
			ECOG_formStopSubmit(event);
		}
	}
	
