function valid( Fields, Messages, formNo) {
  // This function validates the content of fields depending on their types
  var frm = window.document.forms[formNo];
  for (var i=0; i<Fields.length ; i++) {
    var FType=eval ( 'frm.'+Fields[i]+'.type' ) ;
    switch (FType) {
      case "text" :
        if ( eval ( 'frm.'+Fields[i]+'.value' ) =='') {
          alert(Messages[i]);
          eval('frm.'+Fields[i]+'.focus()');
          return false;
        } //This Closes the if
        break; //Closes the case
      case "password" :
      	if ( eval ( 'frm.'+Fields[i]+'.value' ) =='') {
          alert(Messages[i]);
          eval('frm.'+Fields[i]+'.focus()');
          return false;
        } //This Closes the if
        break; //Closes the case
      case "textarea" :
        if ( eval ( 'frm.'+Fields[i]+'.value' ) =='') {
	  alert(Messages[i]);
          eval('frm.'+Fields[i]+'.focus()');
          return false;
        } //This Closes the if
        break; //Closes the case
      case "select-one" :
        chk = 'false';
        if ( eval ( 'frm.'+Fields[i]+'.options[frm.'+Fields[i]+'.selectedIndex].text') !='Select choice' ) {
          chk = 'true';
        } //Closes the if
        if (chk=='false') {
            alert(Messages[i]);
            return false;
        } //Closes the if
        break; //Closes the case
      case "select-multiple":
        if ( eval ( 'frm.'+Fields[i]+'.selectedIndex')==-1) {
          alert(Messages[i]);
          return false;
        } //Closes the if
        break //Closes the case
      default:
        switch (eval ( 'frm.'+Fields[i]+'[0].type' ) ) {
          case "radio" :
            chk = 'false';
            for (var m=0; m < eval ('frm.'+Fields[i]+'.length') ; m++) {
              if ( eval ( 'frm.'+Fields[i]+'['+m +'].checked') ) {
                chk = 'true';
              } //Closes the if
            } //Closes the for Loop
            if (chk=='false') {
              alert(Messages[i]);
              return false;
            } //Closes the if
            break; //Closes the case
          case "checkbox":
            chk = 'false';
            for (var m=0; m < eval ('frm.'+Fields[i]+'.length') ; m++) {
              if ( eval ( 'frm.'+Fields[i]+'['+m +'].checked') ) {
                chk = 'true';
              } //Closes the if
            } //Closes the for Loop
            if (chk=='false') {
              alert(Messages[i]);
              return false;
            } //Closes the if
            break; //Closes the case
      } //This closes the first switch
    } //This closes the switch
  } //This closes the for Loop
  return true;
} //This closes the function
