function submitPLA(){
  if(!isNotEmpty(document.LoansAssessment.amount.value) && !isNumeric(document.LoansAssessment.amount.value) || !isNumeric(document.LoansAssessment.amount.value) ){
	return showError("You must enter a loan value using numbers only",document.LoansAssessment.amount);
  }
  if((document.LoansAssessment.amount.value < 500) || (document.LoansAssessment.amount.value > 100000)){
  	return showError("You must enter a loan value between 500 and 100000",document.LoansAssessment.amount);
  }
  if(!isNotEmpty(document.LoansAssessment.C1DoBDay.value) && !isNumeric(document.LoansAssessment.C1DoBDay.value) || !isNumeric(document.LoansAssessment.C1DoBDay.value)){
	return showError("You must enter a day using numbers only",document.LoansAssessment.C1DoBDay);
  }
  if(!inRange(document.LoansAssessment.C1DoBDay.value,1,31)){
	return showError("You must enter a valid day using numbers only",document.LoansAssessment.C1DoBDay);
  }
  if(!isNotEmpty(document.LoansAssessment.C1DoBMonth.value) && !isNumeric(document.LoansAssessment.C1DoBMonth.value) || !isNumeric(document.LoansAssessment.C1DoBMonth.value) ){
	return showError("You must enter a month using numbers only",document.LoansAssessment.C1DoBMonth);
  }
  if(!inRange(document.LoansAssessment.C1DoBMonth.value,1,12)){
	return showError("You must enter a valid month using numbers only",document.LoansAssessment.C1DoBMonth);
  }
  if(!isNotEmpty(document.LoansAssessment.C1DoBYear.value) && !isNumeric(document.LoansAssessment.C1DoBYear.value) || !isNumeric(document.LoansAssessment.C1DoBYear.value)){
	return showError("You must enter a year using numbers only",document.LoansAssessment.C1DoBYear);
  }
  if(document.LoansAssessment.C1DoBYear.value.length!=4){
	return showError("You must enter a four digit year",document.LoansAssessment.C1DoBYear);
  }
  return true;
}

function showError(msg,element){
	alert(msg);
	element.focus();
	element.select();
	return false;
}

function isNotEmpty(input){
	var inputStr = new String(input);
	if(trim(inputStr)!="")return true;
	return false;
}

function isNumeric(input){
	var reInteger = /^[0-9]+$/;
	if (!reInteger.test(trim(input.toString()))) return false;
	return true;
}

function inRange(input,start,end){
	if(input.length == 2 && input.charAt(0)=='0'){
		input = input.charAt(1); //little fix to get around users entering 01 for 1 etc
	}
	var i = parseInt(input);
	if(i>=parseInt(start) && i<=parseInt(end)) return true;
	return false;
}

function trim(strInput) {
	var tmpInput = strInput;
	if (tmpInput != "") {
		var ch = tmpInput.substring(0, 1);
		while (ch == " ") { 
		 	tmpInput = tmpInput.substring(1, tmpInput.length);
	 		ch = tmpInput.substring(0, 1);
		}
		ch = tmpInput.substring(tmpInput.length-1, tmpInput.length);
		while (ch == " ") { 
	 		tmpInput = tmpInput.substring(0, tmpInput.length-1);
	 		ch = tmpInput.substring(tmpInput.length-1, tmpInput.length);
		}
	}
	return tmpInput;
}