//notifies the user for empty required strFieldID in the FORM strFormID
function isEmptyField(strFormID, strFieldID){
	thisForm = document.forms[strFormID];
	thisField = thisForm[strFieldID];
	//alert(thisField.id)
	if (thisField.value  == ''){
		alert(thisField.name + ' is required. Please enter a value.');
		return false
	}else{
		return true
	}
}

//notifies the user for a non numeric value, entered in a numeric field strFieldID in the FORM strFormID
function isNumericField(strFormID, strFieldID){
	thisForm = window.document.forms[strFormID];
	thisField = thisForm[strFieldID];
	if (isNaN(thisField.value)){
		alert(thisField.name + ' is numeric. Please enter a numeric value.');
		return false
	}else{
		return true
	}
}

//checks If one of the password fields is empty, both password fields are equal and the length of the password is with in the limits
//strFormID - the FORM name; strFieldID1, strFieldID2 - password fields; nMinLen, nMaxLen - required minimum and maximum length of the password
function isPasswordOK(strFormID, strFieldID1, strFieldID2, nMinLen, nMaxLen){
	thisForm = window.document.forms[strFormID];
	fldPassword1 = thisForm[strFieldID1];
	fldPassword2 = thisForm[strFieldID2];
	if (fldPassword1.value.length < nMinLen || fldPassword1.value.length > nMaxLen){
		alert('The password must be between ' +  nMinLen + ' and ' + nMaxLen + ' characters. Please enter a valid password.');
		return false
	}else{
		if (fldPassword1.value!=fldPassword2.value){
		alert('Please retype the password again. Both values must match.');
		return false
		}else{
		return true
		}
	}
}

