function checkEmpty(field, msg)
{
      var value = field.value;
      if (!(value=="")) { // if syntax is valid
        return true;
      }
      alert(msg); 
      field.focus();
      field.select();
      return false;
}

// The below function is used because when using a 'select' box on a form, you
// cannot use the field.select() method. If you do, 'true' is always returned.
function checkNone(field, msg)
{
      var value = field.value;
      if (!(value=="none")) { // if syntax is valid
        return true;
      }
      alert(msg); 
      field.focus();
      return false;
}

function validRateThisPage(form) 
{
    if(    checkNone(form.score,"Please select a score out of 5 for this page.") &&
        checkEmpty(form.why,"Please enter a few words about why you have given this score.") )
          return true;
    else
        return false;
}