var EMAIL_MSG;
var NUMERIC_MSG;
var ALPHANUMERIC_MSG;
var ALPHA_MSG;
var PASSWORD_MSG;


var arrList_checkRequired,arrList_checkDay,arrList_checkYear,arrList_alpha,arrList_numeric,arrList_alphaNumeric,arrList_pwd;
var str_checkRequired,str_checkDay, str_checkYear, str_numeric,str_alphaNumeric,str_alpha, str_pwd;
var errorMsg;
var tempday;

function CheckValidity(checkStr, checkOK)
{
	/*
	THIS FUNCTION CHECKS EACH CHARACTER IN A STRING PARAMETER (checkStr)
	FOR PRESENCE IN ANOTHER QUALIFYING STRING PARAMETER (checkOK).
	IF EACH CHARACTER IN THE STRING IS IN THE QUALIFIER, THE FUNCTION RETURNS TRUE
	AND THE STRING IS VALID
	*/
	var i,j;
	var ch;
	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)
			return false;
	}
	return (true);
}


function isWhitespace (s)
{
	/*
	THIS FUNCTION CHECKS FOR PRESENCE
	IF IT DOES NOT PASS THE isEmpty Function IT CHECKS
	FOR DISPLAYABLE CHARECTERS
	*/
	var i;
	var c;
	// Is s empty?
	if (isEmpty(s)) return true;
	// Search through string characters one by one until we find a non-whitespace character.
	// When we do, return false; if we do not, return true.
	for (i = 0; i < s.length; i++)
	{
		// Check that current character is not whitespace.
		c = s.charAt(i);
		if (c > ' ' ) return false;
	}
	// All characters are whitespace.
	return true;
}
function isEmpty(s)
{
	return ((s == null) || (s.length == 0))
}

var Phone, Zip;
Phone = "604-639-5999"
Zip = "90210-"


function isAlphanumeric (s)

{   var i;

    if (isEmpty(s))
       if (isAlphanumeric.arguments.length == 1) return defaultEmptyOK;
       else return (isAlphanumeric.arguments[1] == true);

    // Search through string's characters one by one
    // until we find a non-alphanumeric character.
    // When we do, return false; if we don't, return true.

    for (i = 0; i < s.length; i++)
    {
        // Check that current character is number or letter.
        var c = s.charAt(i);

        if (! (isLetter(c) || isDigit(c) ) )
        return false;
    }

    // All characters are numbers or letters.
    return true;
}

function isAlphabetic (s)

{   var i;

    if (isEmpty(s))
       if (isAlphabetic.arguments.length == 1) return defaultEmptyOK;
       else return (isAlphabetic.arguments[1] == true);

    // Search through string's characters one by one
    // until we find a non-alphabetic character.
    // When we do, return false; if we don't, return true.

    for (i = 0; i < s.length; i++)
    {
        // Check that current character is letter.
        var c = s.charAt(i);

        if (!isLetter(c))
        return false;
    }

    // All characters are letters.
    return true;
}

function isLetter (c)
{   return ( ((c >= "a") && (c <= "z")) || ((c >= "A") && (c <= "Z")) )
}

function isDigit (c)
{   return ((c >= "0") && (c <= "9"))
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}



