var formSubmitted = false;

function isblank(s)
{
	l = s.length;
	for(var i=0;i < l; i++){
		var c = s.charAt(i);
		if ((c !=' ') && (c != '\n') && (c != '\t')) return false;
	}
	return true;
}
function isemail(s)
{
	l = s.length;
	for(var i=0; i < l; i++)
	{
		var c = s.charAt(i);
		if (c =="@") 
		{
			return false;
		}
	}
	return true;
}
function verify(f)
{

  rtg = false;

  // test 1 - rating
  rating1 = document.uoform.RATING_VALUE_1.value;
  if (rating1>0 && rating1<=10) {
    rtg = true;
  }
  else {
    alert("Please select a rating value for Service & Support.")
    return false;
  }
  
 rating2 = document.uoform.RATING_VALUE_2.value;
  if (rating2>0 && rating2<=10) {
    rtg = true;
  }
  else {
    alert("Please select a rating value for Features.")
    return false;
  }
  rating3 = document.uoform.RATING_VALUE_3.value;
  if (rating3>0 && rating3<=10) {
    rtg = true;
  }
  else {
    alert("Please select a rating value for Setup & ease of use.")
    return false;
  }
  rating4 = document.uoform.RATING_VALUE_4.value;
  if (rating4>0 && rating4<=10) {
    rtg = true;
  }
  else {
    alert("Please select a rating value for Overall.")
    return false;
  }
  
  
  
  if(f.SUMMARY.value == "" || f.SUMMARY.value == null || isblank(f.SUMMARY.value)) {
    alert("Please enter a one-line summary")
    return false;				  
  }
  if(f.PROS.value == "" || f.PROS.value == null || isblank(f.PROS.value)) {
    alert("Please enter Pros")
    return false;				  
  }
  if(f.CONS.value == "" || f.CONS.value == null || isblank(f.CONS.value)) {
    alert("Please enter Cons")
    return false;				  
  }
  if(f.OPINION.value == "" || f.OPINION.value == null || isblank(f.OPINION.value)) {
    alert("Please enter your opinion")
    return false;				  
  }
  
  if (confirm("Please make sure you have filled in the form correctly. Click 'OK' to submit, 'Cancel' to return to edit the form")) {
    return true;
  }
  else {
    return false;
  }

  return true;

}	