<SCRIPT LANGUAGE="JavaScript">
<!--
bName = navigator.appName;
bVer = parseInt(navigator.appVersion);

// info sur le check
function checkForm(form) {
        var ErrMsg = "Information not valid:\n";
        var lenInit = ErrMsg.length;
        var str = form.Email.value;
        
		if (isMini(form.Company)==true) ErrMsg += " - Company : Please type 2 characters minimum\n";
		if (isEmpty(form.Company)==true) ErrMsg += " - Company : Please fill in this field\n"; 
		if (isAuth(form.Company)==false) ErrMsg += " - Company : One character of this field is not valid\n";
 		if (isEmpty(form.Name)==true) ErrMsg += " - Name : Please fill in this field\n";
 		if (isMini(form.Name)==true) ErrMsg += " - Name : Please type 2 characters minimum\n";
		if (isAuth(form.Name)==false) ErrMsg += " - Name : One character of this field is not valid\n";
		if (isEmpty(form.FName)==true) ErrMsg += " - First name : Please fill in this field\n";
 		if (isMini(form.FName)==true) ErrMsg += " - First name : Please type 2 characters minimum\n";
		if (isAuth(form.FName)==false) ErrMsg += " - First name : One character of this field is not valid\n";
		if (isEmpty(form.Phone)==true) ErrMsg += " - Phone : Please fill in this field\n";
		if (isMini(form.Phone)==true) ErrMsg += " - Phone : Please type 2 characters minimum\n";
		if (isAuth(form.Phone)==false) ErrMsg += " - Phone : One character of this field is not valid\n";
		if (isEmail(form.Email)==false) ErrMsg += " - Email :  "+ str +" is not valid\n";
		if (isMini(form.City)==true) ErrMsg += " - City : Please type 2 characters minimum\n";
		if (isEmpty(form.City)==true) ErrMsg += " - City : Please fill in this field\n"; 
		if (isAuth(form.City)==false) ErrMsg += " - City : One character of this field is not valid\n";
		if (isMini(form.PostalCode)==true) ErrMsg += " - Zip Code : Please type 2 characters minimum\n";
		if (isEmpty(form.PostalCode)==true) ErrMsg += " - Zip Code : Please fill in this field\n"; 
		if (isAuth(form.PostalCode)==false) ErrMsg += " - Zip Code : One character of this field is not valid\n";
		if (isEmpty(form.Addr1)==true) ErrMsg += " - Address : Please fill in this field\n";
		if (isMini(form.Addr1)==true) ErrMsg += " - Address : Please type 2 characters minimum\n";
		if (isAuth(form.Addr1)==false) ErrMsg += " - Address : One character of this field is not valid\n";
		if (form.Country.value=="default") ErrMsg += " - Country : Please select your country\n";
		if (ErrMsg.length > lenInit) 
			{ 
				alert(ErrMsg);
				return false;
			} else 
        { 
			form.B1.value="In Progress...";
			return true;
		}
} 

// Check l'email
function isEmail(obj) {
  var field = obj; 
  var str = field.value;
  var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/;
  var reg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/;
  if (!reg1.test(str) && reg2.test(str))
  return true;
  return false;
}

// check si champ vide
function isEmpty(obj) {
        var champ = obj.value + "";													
        if (champ.length == 0) return true;
        return false;
}
function resolution() {
	if ((bName == "Microsoft Internet Explorer" && bVer >= 4) || (bName == "Netscape" && bVer >= 4)) {
		resolution = screen.width; 
		document.FrontPage_Form1.resol.value=resolution;
	} else {
		void(0)
	}	
}	

// check caracteres minimum (2)
function isMini(obj) {
        var champ = obj.value + "";
        if (champ.length < 2) return true;
        return false;
}


//check caractere interdit <>
function isAuth(obj) {
		if (obj.value.indexOf("<") && obj.value.indexOf(">")) return true;
		return false;
}
//-->
</SCRIPT>


