<!--
function DoSubmit(obj) {
var companyname	= document.getElementById('COMPANYNAME').value;
var town		= document.getElementById('TOWN').value;
var county		= document.getElementById('COUNTY').value;
var nomineepostcode	= document.getElementById('NOMINEE_POSTCODE').value;
var nomineename		= document.getElementById('NOMINEE_NAME').value;
var nomineeemail	= document.getElementById('NOMINEE_EMAIL').value;			
var nomineetown		= document.getElementById('NOMINEE_TOWN').value;

var strMailFilter   = /^.+@.+\..{2,3}$/;
var strIllegalChars = /[\(\)\<\>\,\;\:\\\/\*\+\=\"\[\]]/;
var submitform = true;
var error      = '******************** Nominate/Promotion ********************\n\n';
	error         += ' The following error(s) occured :   \n\n';
	if (companyname.length < 1) {
	error     += '    + Name must be at least 1 character long  \n';
	submitform = false;
	}
	if (companyname.length > 40) {
	error     += '    + Name cannot be longer than 40 characters  \n';
	submitform = false;
	}
	if (town.length < 3) {
	error     += '    + Town must be at least 3 characters long  \n';
	submitform = false;
	}
	if (town.length > 30) {
	error     += '    + Town cannot be longer than 30 characters  \n';
	submitform = false;
	}
	if (county.length < 3) {
	error     += '    + County must be at least 3 characters long  \n';
	submitform = false;
	}
	if (county.length > 30) {
	error     += '    + County cannot be longer than 30 characters  \n';
	submitform = false;
	}
	if (nomineename.length < 5) {
	error     += '    + Name must be at least 5 characters long  \n';
	submitform = false;
	}
	if (nomineename.length > 40) {
	error     += '    + Name cannot be longer than 40 characters  \n';
	submitform = false;
	}
	if (nomineetown.length < 3) {
	error     += '    + Town must be at least 3 characters long  \n';
	submitform = false;
	}
	if (nomineetown.length > 30) {
	error     += '    + Town cannot be longer than 30 characters  \n';
	submitform = false;
	}
	if (nomineeemail.length > 80) {
	error     += '    + Email is max 80 characters  \n';
	submitform = false;
	}
	if (nomineeemail.length > 1 && nomineeemail.match(strIllegalChars)) {
	error     += '    + Email address contains illegal characters  \n';
	submitform = false;
	}
	if (nomineeemail.length > 1 && !nomineeemail.match(strIllegalChars) && !(strMailFilter.test(nomineeemail))) {
	error     += '    + Email address is invalid  \n';
	submitform = false;
	}
	test = nomineepostcode
	size = test.length
	test = test.toUpperCase();
	while (test.slice(0,1) == " ") //Strip leading spaces
	{test = test.substr(1,size-1);size = test.length
	}
	while(test.slice(size-1,size)== " ") //Strip trailing spaces
	{test = test.substr(0,size-1);size = test.length
	}
	obj.NOMINEE_POSTCODE.value = test; //write back to form field
	if (size < 6 || size > 8){ //Code length rule
	error	+= (test + " is not a valid postcode - wrong length \n");
//	document.details.pcode.focus();
	submitform = false;
	}
	if (!(isNaN(test.charAt(0)))){ //leftmost character must be alpha character rule
	error	+= (test + " is not a valid postcode - cannot start with a number \n");
//	document.details.pcode.focus();
	submitform = false;
	}		
	if (isNaN(test.charAt(size-3))){ //first character of inward code must be numeric rule
	error	+= (test + " is not a valid postcode - alpha character in wrong position \n");
//	document.details.pcode.focus();
	submitform = false;
	}
	if (!(isNaN(test.charAt(size-2)))){ //second character of inward code must be alpha rule
	error	+= (test + " is not a valid postcode - number in wrong position \n");
//	document.details.pcode.focus();
	submitform = false;
	}
	if (!(isNaN(test.charAt(size-1)))){ //third character of inward code must be alpha rule
	error	+= (test + " is not a valid postcode - number in wrong position \n");
//	document.details.pcode.focus();
	submitform = false;
	}
	if (!(test.charAt(size-4) == " ")){//space in position length-3 rule
	error	+= (test + " is not a valid postcode - no space or space in wrong position \n");
//	document.details.pcode.focus();
	submitform = false;
	}
	count1 = test.indexOf(" ");count2 = test.lastIndexOf(" ");
	if (count1 != count2){//only one space rule
	error	+= (test + " is not a valid postcode - only one space allowed \n");
//	document.details.pcode.focus();
	submitform = false;
	}
	if (submitform) {
	obj.submit();
	}
	else {
	error += '\n************************* REGISTRATION *************************\n\n';
	alert (error);
	return false;
	}
}
-->

