function validateRequired(field, txt)
{
  	with (field)
  	{
  		if (value==null||value=="")
 			colorizeField(field, 0, txt);
		else
			colorizeField(field, 1);
  	}
}

// returns true if the string is empty
function isEmpty(str){
	return (str.value == '') || (str.length == 0);
}
// returns true if the string is a valid email
function isEmail(str){
	if(isEmpty(str)) return false;
	var re = /^[^\s()<>@,;:\/]+@\w[\w\.-]+\.[a-z]{2,}$/i
	return re.test(str);
}
// returns true if the string only contains characters A-Z or a-z
function isAlpha(str){
	var re = /[^a-zA-Z]/g
	if (re.test(str)) return false;
	return true;
}
// returns true if the string only contains characters 0-9
function isNumeric(str){
	var re = /[\D]/g
	if (re.test(str)) return false;
	return true;
}
// returns true if the string only contains characters A-Z, a-z or 0-9
function isAlphaNumeric(str){
	var re = /[^a-zA-Z0-9]/g
	if (re.test(str)) return false;
	return true;
}
// returns true if the string's length equals "len"
function isLength(str, len){
	return str.length == len;
}
// returns true if the string's length is between "min" and "max"
function isLengthBetween(str, min, max){
	return (str.length >= min)&&(str.length <= max);
}

function requiredField(field, txt)
{
// 	var field=document.getElementById(field);
	var valid=true;

	if(isEmpty(field)) {
		valid = false;
		prepareField(field,0,txt);
// 		continue;
	}else{
		prepareField(field,1,txt);
	}
	return valid;
}

