/*
 *
 * graph.js
 *
 * Verification javascript for graph query form.
 *
 */

function verify()
{
   var valid = true;
   var msg = "";

   if (! isSelected(document.data_query.species))
   {
      valid = false;
      msg += 'Please select at least one bird SPECIES and add it to the "My Query" form on the right.\n\n';
   }

   if (! isSelected(document.data_query.startYear))
   {
      valid = false;
      msg += 'Select a STARTing and ENDing year for the time range to display.\n\n';
   }

   if (! (isSelected(document.data_query.region) ||
          isSelected(document.data_query.country) ||
          isSelected(document.data_query.circle_id)))
   {
      valid = false;
      msg += 'Please select one of: REGION, COUNTRY, or COUNT CIRCLE before continuing.\n\n';
   }

   if (! valid)
   {
      alert(msg);
   }

   return valid;
}

