var ns4=(document.layers)?true:false;
var ie4=(document.all)?true:false;
var ie5=(document.getElementbyID)?true:false;
function trimSpace(x) {
	var emptySpace = / /g;
	var trimAfter = x.replace(emptySpace,"");
	return(trimAfter);
}
//====================================================
/*Email Validation function*/
function emailValidate(incomingString, defaultValue) {
	if(trimSpace(incomingString).length == 0 || incomingString.search
		(/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i) == -1 || incomingString==defaultValue)
	{
		return false;
	}
	else
		return true;
}
//====================================================
//====================================================
/*TEXT Validation function*/
function textValidate(incomingString, defaultValue) 
	{
	if(trimSpace(incomingString).length == 0 || incomingString.search(/[^a-zA-Z ]/g) != -1 || incomingString==defaultValue)
	{
		return false;
	}
	else
		return true;
}
//====================================================

function validate3()
{
	if(document.frm3.fname.value=="")
	{
		alert("Entrez votre Pernom. Merci.");
		document.frm3.fname.focus();
		document.frm3.fname.select();
		return false;
	}
	if(document.frm3.lname.value=="")
	{
		alert("Entrez votre Nom. Merci.");
		document.frm3.lname.focus();
		document.frm3.lname.select();
		return false;
	}
	if(document.frm3.email.value=="")
	{
		alert("Entrez votre Email. Merci.");
		document.frm3.email.focus();
		document.frm3.email.select();
		return false;
	}
	if(!emailValidate(document.frm3.email.value,''))
	{
		alert("Verifiez votre Email. Merci");
		document.frm3.email.focus();
		document.frm3.email.select();
		return false;
	}
	if(document.frm3.attempt.value=="")
	{
		alert("Veuillez retaper correctement le code de sécurité !");
		document.frm3.attempt.focus();
		document.frm3.attempt.select();
		return false;
	}

	
	return true;
}

