function forms_setActive() {

	for (var i=0; i<document.forms.length; i++) {

		for (var h=0; h<document.forms[i].elements.length; h++) {

			switch (document.forms[i].elements[h].type) {
				case 'text':
				case 'password':
				case 'textarea':
					// Activation de la surveillance de focus
					document.forms[i].elements[h].onfocus = form_setFocus;
					document.forms[i].elements[h].onblur = form_setBlur;
					break;
					
				case 'submit':
					// Activation de la surveillance de focus
					document.forms[i].elements[h].onmouseover = form_setFocus;
					document.forms[i].elements[h].onmouseout = form_setBlur;
					break;
			}
		}
	}
}


function form_setFocus() {

	this.className += " active";
	

	switch (this.type) {
		case 'text':
		case 'password':
		case 'textarea':
			// Si texte par défaut
			if (this.title && this.value == this.title) {
				// Vidage
				this.value = '';
			}
			break;
	}
}

// Etat normal
function form_setBlur() {
	// Class
	this.className = this.className.replace(/ active/g, "");
	// Type
	switch (this.type) {
		case 'text':
		case 'textarea':
			// Si texte par défaut
			if (this.title=="Votre identifiant" && this.value.length < 1)
			{
				this.value = this.title;
			}
			break;
	}
}
$(document).ready(function() {
	forms_setActive();
});