<!--
window.onload = function() {
	var htmlStyle = document.getElementsByTagName('html')[0].style;
	var bodyStyle = document.body.style;
	bodyStyle.scrollbarFaceColor = htmlStyle.scrollbarFaceColor = '#90CA33';
	bodyStyle.scrollbarArrowColor = htmlStyle.scrollbarArrowColor = '#fff';
	bodyStyle.scrollbarTrackColor = htmlStyle.scrollbarTrackColor = '#90CA33';
	bodyStyle.scrollbarShadowColor = htmlStyle.scrollbarShadowColor = '#fff';
	bodyStyle.scrollbarHighlightColor = htmlStyle.scrollbarHighlightColor = '#90CA33';
	bodyStyle.scrollbar3dlightColor = htmlStyle.scrollbar3dlightColor = '#90CA33';
	bodyStyle.scrollbarDarkshadowColor = htmlStyle.scrollbarDarkshadowColor = '#90CA33';
}

function VerifMail(TheMail) {
	ChaineReg=/^[a-z0-9._-]+@[a-z0-9.-]{2,}[.][a-z]{2,3}$/;
 	if (ChaineReg.exec(TheMail.toLowerCase()) == null) return false; else return true;
}

function resetColor(champ) {
	$(champ).style.backgroundColor = "#FFF";
}

function validerPrivatif() { 
	if (verifPrivatif()==true) document.logSAPrivatif.submit();
}

function verifPrivatif()	{
	var retour = true;

	if (document.getElementById("logSAPrivatif").value=="" || document.getElementById("mdpSAPrivatif").value=="") {
		retour = false;
	}
	return retour;
}

function verifReturnPrivatif(evt) {
	var keycode = evt.keyCode ? evt.keyCode : evt.which ? evt.which : evt.charCode;
	if (keycode==13) { validerPrivatif(); }
}


function showRestore() {
	$("ClientLogin").style.display = 'none';
	$("ClientPerdu").style.display = '';
	$("emailRestore").focus();
}

/*
function validerRestore() {
	if (verifRestore()==true) {
		// AjaXX PoWaa
		var xmlHttp = new Ajax.Request("sa-color-espace-client-restore.php",{parameters: Form.serialize(document.forms[1]), asynchronous:false});
		var reponse = xmlHttp.transport.responseText;
		$("emailRestore").value = "";

		$("ClientLogin").style.display = '';
		$("ClientPerdu").style.display = 'none';
		$("logSAPrivatif").focus();
		
		if (reponse.length>1) alert(reponse);

	}
}
*/

function validerRestore() {
	if (verifRestore()==true) {
		// AjaXX PoWaa
		var emailRestore = document.getElementById("emailRestore").value;
		var myAjax = new Ajax.Request("sa-color-espace-client-restore.php", { method: 'get', parameters: 'emailRestore='+emailRestore, onComplete: afficheRecup }); 
		$("emailRestore").value = "";

		$("ClientLogin").style.display = '';
		$("ClientPerdu").style.display = 'none';
		$("logSAPrivatif").focus();
		
		// if (reponse.length>1) alert(reponse);

	}
}

function afficheRecup(originalRequest) {
	if (originalRequest.responseText.length>0) alert(originalRequest.responseText);
}

function verifRestore()	{
	var retour = true;
	if (VerifMail($("emailRestore").value)==false) {
		$("emailRestore").focus();
		$("emailRestore").style.backgroundColor = "#FFFDD0";
		retour = false;
	}
	return retour;
}

function goSearch() {
	if (verifSearch()) document.search.submit(); else event.returnValue=false;
}

function verifSearch() {
	if (document.getElementById("txtSearch").value.length < 3) {
		alert("Veuillez saisir un mot significatif pour lancer la recherche...");
		document.getElementById("txtSearch").focus();
		return false;
	}
	return true;
}

function verifReturnSearch(evt) {
	var keycode = evt.keyCode ? evt.keyCode : evt.which ? evt.which : evt.charCode;
	if (keycode==13) goSearch(); 
}

//-->