function validateForm(){

	     var frm = document.queryform;

                      if (frm.firmname.value == ''){

		              alert('Please, enter Name and Legal status!');
		              frm.firmname.focus();
		              return false;
                      }
                      if (frm.activity.value == ''){

		              alert('Please, enter Sphere of company activity according to court registration and a short description of the current business!');
		              frm.activity.focus();
		              return false;
                      }
                      if (frm.startdate.value == ''){

		              alert('Please, enter Activity starting date!');
		              frm.startdate.focus();
		              return false;
                      }
                      if (frm.staffcount.value == ''){

		              alert('Please, enter Total number of personnel by the last quarter of the current year!');
		              frm.staffcount.focus();
		              return false;
                      }
                      if (frm.branch.value == ''){

		              alert('Please, enter Sector (branch)!');
		              frm.branch.focus();
		              return false;
                      }
                      if (frm.projectshortdesc.value == ''){

		              alert('Please, enter Short description of the project !');
		              frm.projectshortdesc.focus();
		              return false;
                      }
                      
                      
                      if (frm.projectperiod.value == ''){

		              alert('Please, enter Term of execution!');
		              frm.projectperiod.focus();
		              return false;
                      }
                      
                      if (frm.sum3.value == ''){

		              alert('Please, fill the table with Expected quantity of the necessary or forthcoming investment expenses!');
		              frm.land3.focus();
		              return false;
                      }
                      
                      if (frm.sum4.value == ''){

		              alert('Please, fill the table with Expectations for sources of finance of the investment expenses in item 3.!');
		              frm.money4.focus();
		              return false;
                      }


                      if (frm.sum5.value == ''){

		              alert('Please, fill the table with Funds invested up to the moment!');
		              frm.land5.focus();
		              return false;
                      }
                      
                      if (frm.sum6.value == ''){

		              alert('Please, fill the table with Sources of financing of the acquired in item 5 ASSETS!');
		              frm.ownmoney6.focus();
		              return false;
                      }
                      
                      
                      if (frm.salesincomesum.value == ''){

		              alert('Please, enter Total Operative sales income!');
		              frm.salesincomesum.focus();
		              return false;
                      }
                      
                      if (frm.expensesum.value == ''){

		              alert('Please, enter Total Operative Expenses for the activity!');
		              frm.expensesum.focus();
		              return false;
                      }
                      if (frm.address.value == ''){

		              alert('Please, enter Return address!');
		              frm.address.focus();
		              return false;
                      }
                      if (frm.contactperson.value == ''){

		              alert('Please, enter Contact person!');
		              frm.contactperson.focus();
		              return false;
                      }
                      if (frm.phone.value == ''){

		              alert('Please, enter phone!');
		              frm.phone.focus();
		              return false;
                      }
                      if (!ValidateEmail(frm.email.value)){

		                    alert('Please, enter valid E-mail!');
		                    frm.email.focus();
		                    return false;

	                      }

return true;
}








/////
// E-mail validation
/////
	function ValidateEmail (emailStr) {
		var emailPat=/^(.+)@(.+)$/
		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 + ")"
		var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
		var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")
		var matchArray=emailStr.match(emailPat)
		if (matchArray==null) {
			return false
		}
		var user=matchArray[1]
		var domain=matchArray[2]


		if (user.match(userPat)==null) {
			// user is not valid
			return false
		}

		/* if the e-mail address is at an IP address (as opposed to a symbolic
		   host name) make sure the IP address is valid. */
		var IPArray=domain.match(ipDomainPat)
		if (IPArray!=null) {
			// this is an IP address
			  for (var i=1;i<=4;i++) {
				if (IPArray[i]>255) {
				return false
				}
			}
			return true
		}

		// Domain is symbolic name
		var domainArray=domain.match(domainPat)
		if (domainArray==null) {
			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>5) {
		   // the address must end in a two letter or three letter word.
		   return false
		}

		// Make sure there's a host name preceding the domain.
		if (len<2) {
		   return false
		}

		return true;
	}
//////
	//
//////
