function empty(field)
{// detect type of field and call appropriate function to see if empty
   if (field.type == "text" ||
      field.type == "password" ||
      field.type == "textarea") return emptyt(field);
   else if (field[0].type == "radio") return emptyr(field);
   else if (field.type.indexOf("select") < 99) return emptys(field);
}
function emptyt(field)
{// validate inputs, textareas
   if (field.value == '') return true;
   else return false;
}
function emptyr(field)
{// validate radios
   var field_empty = true;
   for (i=0;i<field.length;i++)
   {
      if (field[i].checked) field_empty = false;
   }
   return field_empty;
}
function emptys(field)
{// validate selects ... check for blank, nbsp, space, hyphen, html-nbsp
   var val = field.options[field.selectedIndex].text;
   if (
         (val.length == 0) || 
         (
            (val.length == 1) && 
            (
               (val.charCodeAt(0) == 160) ||
               (val.charCodeAt(0) == 32) ||
               (val.charCodeAt(0) == 45)
            )
         ) ||
         (val == '&nbsp;')
      ) return true;
   else return false;
}

/* 
   if (
      empty(form.field1) ||
      empty(form.field2)
      )

or, if id specified

   if (
      empty(document.getElementById('field1')) ||
      empty(document.getElementById('field2'))
      )
*/
