function SetEleval(theForm, fieldName, val)
{
     if (theForm == null) return false
     
     for (i = 0; i < theForm.elements.length; i++)
     {
          if (theForm.elements[i].name == fieldName)
          {
               theField = theForm.elements[i];                        
               type = eval("theField.type");

               if (type != null)
               {          
                    if ((type == "text") || (type == "textarea") ||
                        (type == "hidden") || (type == "password")) 
                    {
                         theField.value = val
                    }
                    else if (type == "radio") 
                    {
                         if (theField.value == val)                        
                              theField.checked = true;
                    }
                    else if (type == "checkbox")
                    {
                         theField.checked = (val != "")? true:false;
                    }
                    else if (type == "select-one")
                    {
                         for(j=0; j < theField.length; j++)
                         {    
                              if (theField.options[j].value == val)
                              {
                                   theField.options[j].selected = true;
                              }
                         }
                    }

               }
          }    
     }          
     return true;
}
