

function submitOrFailForm(errors,theForm){
  if(errors!=''){
  	alert('Please amend or enter the following:'+errors);
	return false;
  }
  else{
  	return true;
  }
}

function isBlank(theInput){
if ((theInput.value == "")||(theInput.value == null)){
  return true;
}
  return false;
}

function isNotEmail(theInput){
//alert('in not email')
	if(isBlank(theInput)){
		return true;
	}
	if((theInput.value.indexOf('@')!=-1)&&(theInput.value.indexOf('.')!=-1)){
		return false;
	}
	return true;
}

function isNotANumber(theInput){
	if(isBlank(theInput)){
		return true;
	}
	for (i=0;i< theInput.value.length;i++){
		if((theInput.value.charAt(i)<'0')||(theInput.value.charAt(i)>'9')){
			if(theInput.value.charAt(i)!=' '){
				return true;
			}
		}
	}
	return false;
}

function isNotSelected(theInput){
//	alert(theInput.length);
	for (i=1;i< theInput.length;i++){
		if (theInput[i].selected==true){
			return false;
		}
	}
	return true;
}

function isNotChecked(theInput){
	//alert(theInput.length);
	for (i=0;i< theInput.length;i++){
		if (theInput[i].checked==true){
			return false;
		}
	}
	return true;
}