
  function isEmpty(str) 
  {
    // Check whether string is empty.
    for (var intLoop = 0; intLoop < str.length; intLoop++)
       if (" " != str.charAt(intLoop))
              return false;
    
    return true;
   }
  
   function checkRequired(f) 
   {
    var strError = "";
    for (var intLoop = 0; intLoop < f.elements.length; intLoop++)
      if (null!=f.elements[intLoop].getAttribute("required")) 
          if ((f.elements[intLoop].type == "checkbox" && !f.elements[intLoop].checked) || (f.elements[intLoop].type != "checkbox" && isEmpty(f.elements[intLoop].value)))
              strError += "  " + f.elements[intLoop].name + "\n";
      if ("" != strError) {
          alert("Los siguientes datos requeridos son necesarios:\n" + strError);
          return false;
      } 
      else
          return true       
   }
