

	function NullCheck(StringValue, strMsg)
	{
		if (StringValue == "")
		{  
			if (fCheck)
			{                     
				alert(strMsg);
				fCheck = false;
			}
		}
	}


	function EmailCheckOptional( StrValue, isRequired )
	{

		if ( (isRequired == 0) && (StrValue.length == 0) ) {
			return;
		}

        if (fCheck)
        {   

			var disallowStr = ",!#$%^<>&*;:~` '\"\\|/"

			for ( var i = 0 ; i < StrValue.length ; i++ ){
				for ( var n = 0 ; n < disallowStr.length ; n++ ){
					if ( disallowStr.substring(n, n + 1) == StrValue.substring(i, i + 1) ) {
						alert("An illegal character [ " + disallowStr.substring(n, n + 1) + " ] was found in the email address");
						fCheck = false;
						return
					}
				}
			}

            var myArr = StrValue.split("@");

            if ( myArr.length != 2 ) {
                alert("there must be a single '@' symbol in the email address");
                fCheck = false;
				return;
            }

            if ( myArr[0].length == 0 ) {
                alert("no user has been specified within the email address \( ie: USER@domain.com\)");
                fCheck = false;
				return;
            }

            if ( myArr[1].length == 0 ) {
                alert("no domain has been specified within the email address \( ie: user@DOMAIN.com\)");
                fCheck = false;
				return;
            }

            var dotArr = myArr[1].split(".")

            if ( dotArr.length < 2 ) {
                alert("please provide a suffix for the domain in your email address \( ie: .com, .org or country code\) ");
                fCheck = false;
				return;
            }

			for (i=0; i<dotArr.length; i++) {
				if ( dotArr[i].length < 1 ) {
					alert(error_prefix + "Each element in the domain must be at least one character long \( ie: @a.b.com\)");
					fCheck = false;
					return;
				}
			}

		}
	}