       function checkfiemail(company,fullaname,mail,phone) {
        var field = mail.value;
        var status = true;
		var p_company = company.value;		
		var p_fullaname = fullaname.value;
		var p_phone = phone.value;
 
  
		if (company.value == "" || company.value == "null" || company.value == " "){ 
			var errstr="Please enter a company name " 
			   field = prompt(errstr, p_company); 
				company.value = field; 
				company.focus() 
				company.select() 
				return false; 
		}
		if (fullaname.value == "" || fullaname.value == "null" || fullaname.value == " "){ 
			var errstr="Please enter your full name " 
			   field = prompt(errstr, p_fullaname); 
				fullaname.value = field; 
				fullaname.focus() 
				fullaname.select() 
				return false; 
		}
 
       var mailPat=/^(.+)@(.+)$/
       var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
       var validChars="\[^\\s" + specialChars + "\]"
       var quotedUser="(\"[^\"]*\")"
       var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
       var atom=validChars + '+'
       var word="(" + atom + "|" + quotedUser + ")"
       // The following pattern describes the structure of the user
       var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
   var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")
   var matchArray=field.match(mailPat)
   if (matchArray==null) {
        field = prompt("User E-mail address seems incorrect (check @ and .'s)",field);
        mail.value = field;
        return false;
   }
   var user=matchArray[1]
   var domain=matchArray[2]
   // See if "user" is valid 
   if (user.match(userPat)==null) {
           // user is not valid
           field = prompt("User E-mail: The name preceding @ does not seem to be valid.",field)
           mail.value = field
           return false
   }
   var IPArray=domain.match(ipDomainPat)
   if (IPArray!=null) {
           // this is an IP address
          for (var i=1;i<=4;i++) {
            if (IPArray[i]>255) {
                field = prompt("User E-mail: Destination IP address is invalid!",field)
                mail.value = field
                return false
            }
             }
    return true
   }
   // Domain is symbolic name
   var domainArray=domain.match(domainPat)
   if (domainArray==null) {
        field = prompt("User E-mail: The domain name does not seem to be valid.",field)
        mail.value = field
        return false
   }
   var atomPat=new RegExp(atom,"g")
   var domArr=domain.match(atomPat)
   var len=domArr.length
   if (domArr[domArr.length-1].length<2 || 
           domArr[domArr.length-1].length>3) {
                   // the address must end in a two letter or three letter word.
                   field = prompt("User E-mail: The address must end in a three letter domain or two letter country.",field)
                   mail.value = field
                   return false
   }
   // Make sure there is a host name preceding the domain.
   if (len<2) {
           var errStr="User E-mail: This address is missing a hostname!"
           field = prompt(errStr,field)
           mail.value = field
           return false
   }
		if (phone.value == "" || phone.value == "null" || phone.value == " "){ 
			var errstr="Please enter your phone number " 
			   field = prompt(errstr, p_phone); 
				phone.value = field; 
				phone.focus() 
				phone.select() 
				return false; 
		}
return true;
    }