// Copyright information must stay intact
// FormCheck v1.10
// Copyright NavSurf.com 2002, all rights reserved
// Creative Solutions for JavaScript navigation menus, scrollers and web widgets
// Affordable Services in JavaScript consulting, customization and trouble-shooting
// Visit NavSurf.com at http://navsurf.com

function formCheck_raceregistration(formobj)
{
  // name of mandatory fields
  var fieldRequired = Array("fname", "lname", "city", "email");

  // field description to appear in the dialog box
  var fieldDescription = Array("First Name", "Last Name", "City", "E-mail Address");

  // dialog message
  var alertMsg = "Please complete the following required fields:\n";
  var l_Msg = alertMsg.length;
  for (var i = 0; i < fieldRequired.length; i++)
	{
    var obj = formobj.elements[fieldRequired[i]];
    if (obj)
		{
      if (obj.type == null)
			{
        var blnchecked = false;
        for (var j = 0; j < obj.length; j++)
				{
          if (obj[j].checked)
					{
            blnchecked = true;
          }
        }
        if (!blnchecked)
				{
          alertMsg += " - " + fieldDescription[i] + "\n";
        }
        continue;
      }
      switch(obj.type)
			{
        case "select-one":
          if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == "")
					{
            alertMsg += " - " + fieldDescription[i] + "\n";
          }
          break;
        case "select-multiple":
          if (obj.selectedIndex == -1)
					{
            alertMsg += " - " + fieldDescription[i] + "\n";
          }
          break;
        case "text":
        case "textarea":
          if (obj.value == "" || obj.value == null)
					{
            alertMsg += " - " + fieldDescription[i] + "\n";
          }
          break;
        default:
      }
    }
  }
  if (alertMsg.length == l_Msg)
	{
    return true;
  }
	else
	{
    alert(alertMsg);
    return false;
  }
}