function frm_subscription_Validator(theForm)
{

var alertsay = "";

//--- EMAIL VALIDATION -----------------------------------------------------------------
// check if email field is blank
if (theForm.frm_email.value == "")
{
alert("SVP entrez votre courriel; Si vous n'avez pas de courriel, SVP communiquer avec nous./ Please enter your email; If you dont have an email please call us");
theForm.frm_email.focus();
return (false);
}


// test if valid email address, must have @ and .
var checkEmail = "@.";
var checkStr = theForm.frm_email.value;
var EmailValid = false;
var EmailAt = false;
var EmailPeriod = false;
for (i = 0;  i < checkStr.length;  i++)
{
ch = checkStr.charAt(i);
for (j = 0;  j < checkEmail.length;  j++)
{
if (ch == checkEmail.charAt(j) && ch == "@")
EmailAt = true;
if (ch == checkEmail.charAt(j) && ch == ".")
EmailPeriod = true;
	  if (EmailAt && EmailPeriod)
		break;
	  if (j == checkEmail.length)
		break;
	}
	// if both the @ and . were in the string
if (EmailAt && EmailPeriod)
{
		EmailValid = true
		break;
	}
}
if (!EmailValid)
{
alert("Votre courriel doit contenir un \"@\" et un \".\". / your email must contain \"@\" et un \".\".");
theForm.frm_email.focus();
return (false);
}


//******************************************************************
//--- PHONE VALIDATION ----------------------------------------------
//******************************************************************

// check to see if the field is blank
if (theForm.frm_telephone.value == "")
{
alert("Vous devez entrer votre numéro de téléphone - You must enter a phone number.");
theForm.frm_telephone.focus();
return (false);
}

// require at least 3 characters be entered
if (theForm.frm_telephone.value.length < 10)
{
alert("Votre numéro doit avoir 10 chiffres - Your number must have 10 digits");
theForm.frm_telephone.focus();
return (false);
}

// allow ONLY alphanumeric keys, no symbols or punctuation
// this can be altered for any "checkOK" string you desire
var checkOK = "1234567890()-. ";
var checkStr = theForm.frm_telephone.value;
var allValid = true;
for (i = 0;  i < checkStr.length;  i++)
{
ch = checkStr.charAt(i);
for (j = 0;  j < checkOK.length;  j++)
if (ch == checkOK.charAt(j))
break;
if (j == checkOK.length)
{
allValid = false;
break;
}
}
if (!allValid)
{
alert("Utilisez la formule suivante, please us this form : 888-456-4569. ");
theForm.frm_telephone.focus();
return (false);
}

//--- TESTING - DEBUG ----------------------------------------------------

//alertsay = "All Validations have succeeded. "
//alertsay = alertsay + "This is just a test page. There is no submission page."
//alert(alertsay);
//return (false);
// replace the above with return(true); if you have a valid form to submit to
}
