// JavaScript Document
function checkForBlank(ctr, msg)
{
	if(ctr.value=='')
	{
		alert("Please insert the "+msg);
		ctr.focus();
		return true;
	}
	else return false;
}

function isEmailAddress(ctr)
{
  var result = true;
  var theStr = new String(ctr.value)
  var index = theStr.indexOf("@");
  if (index > 0)
  {
    var pindex = theStr.indexOf(".",index);
    if ((pindex > index+1) && (theStr.length > pindex+1))
	result = false;
  }
  if(result==true){
	  alert("Please enter a complete email address in the form: yourname@yourdomain.com");
	  ctr.focus();
  }
  return result;
}
function processpage(){
	if(!checkForBlank(document.dform.name,'Name') &&
	!checkForBlank(document.dform.email,'Email')&&
	!isEmailAddress(document.dform.email) && 
	!checkForBlank(document.dform.qn,'Message')){
		document.dform.submit();
		return true;
	}
	return false;
}
