// JavaScript Document
<!-- Begin

function CopyAddress(){
	if(document.Application.CompRegAddress.value.length!=0) 
    {
		document.Application.CompMailAddress.value = document.Application.CompRegAddress.value;
		document.Application.MailCity.value = document.Application.RegCity.value;
		document.Application.MailState.value = document.Application.State.value;
		document.Application.MailZip.value = document.Application.RegZip.value;
    }
}


function checkFields(){
	var err;
	var mesg;
	err = 0;	
	mesg = "";

	if(document.Application.CompName.value.length==0) {
		err++;
		mesg = mesg + err + ") Company Name\n";	}

	if(document.Application.CompRegAddress.value.length==0) {
		err++;
		mesg = mesg + err + ") Company Registered Address\n";	}
		
	if(document.Application.State.value.length==0) {
		err++;
		mesg = mesg + err + ") State\n";	}

	if((document.Application.CompTel3.value.length<4) ||
		isNaN(document.Application.CompTel3.value)) {
		err++;
		mesg = mesg + err + ") Company Tel\n";	}

	if((document.Application.CompFax3.value.length<4) ||
		isNaN(document.Application.CompFax3.value)) {
		err++;
		mesg = mesg + err + ") Company Fax\n";	}

	if((document.Application.CompEmail.value.length==0) || 
	((document.Application.CompEmail.value.indexOf('@') == 0) ||
	(document.Application.CompEmail.value.indexOf('@') == -1) ||
	(document.Application.CompEmail.value.indexOf('.') == -1))) {
		err++;
		mesg = mesg + err +  ") Company Email\n";		
	}


	if(document.Application.ContactName.value.length==0) {
		err++;
		mesg = mesg + err + ") Contact Person Name\n";	}

		
	if (err == 0) return true ;
	else {
		if (err > 1) alert("Please check that the following\nare entered correctly: \n\n" + mesg);
		else alert("Please check that this is entered correctly : \n\n" + mesg);
		return false;
	}
}

//  End -->