//==================================================== 
// Source:
// http://www.echoecho.com/jsforms01.htm
//==================================================== 

//==================================================== 
// In an effort to know which files will be affected
// if this file were to change, here's a list of files
// that currently rely on this scipt:
//
// /pa/clinics/voucher_form.php
//==================================================== 

function isEmpty(str){
	if (str==null || str==""){
		return true;
	} else {
		return false;
	}
}
function isEmail(str){
		apos=str.indexOf("@");
		dotpos=str.lastIndexOf(".");
		lastpos=str.length-1;
		if (apos<1 || dotpos-apos<2 || lastpos-dotpos>3 || lastpos-dotpos<2){
			return false;
		} else {
			return true;
		}
}

function matchesRegEx(str, regex){
	var reg = new RegExp(regex);
	if (reg.test(str)) {
		return true;
	} else {
		return false;	
	}
}
//==================================================== 
//USE TO VALIDAT THE WHOLE FORM
//==================================================== 
