// Global Regular Expression to check all e-mails against.
var emailExp = /^[\w\-\.\+]+\@[\w\-\.]+\.[a-zA-Z]{2,4}$/;

function checkForm()
{
	$errors="";

	// Check Name
	if (document.mailCall.cName.value==""){ // Name is Empty
		$errors += "Required Company name field was left empty.\n\n";
		document.mailCall.cName.focus();
	}
	// Check Contact
	if (document.mailCall.cContact.value==""){ // Name is Empty
		$errors += "Required Contact Person field was left empty.\n\n";
		document.mailCall.cContact.focus();
	}
	
	// On errors, display alert. Do not submit/Delay form execution
	if ($errors != ""){
		window.scrollBy(0,-50);		
		alert($errors);
		
		// Set focus to first error printed.
		return false;
	}
	

	// No problems, continue to submission.
	return true;
}
function clrStatus()
{
	document.getElementById('cNameSpn').innerHTML = "&nbsp;&nbsp;";
	document.getElementById('cEmailSpn').innerHTML = "&nbsp;&nbsp;";
	document.getElementById('cEmailVSpn').innerHTML = "&nbsp;&nbsp;";
	document.getElementById('cTypeSpn').innerHTML = "&nbsp;&nbsp;";
}

function checkReset()
{
	if (window.confirm("This will reset all data entered."))
	{ 
		clrStatus();
		return true;
	}
	else
	{
		return false;
	}
}
	
