function emailcheck(emailtext)
{
	l=emailtext.indexOf("@");
	j=emailtext.indexOf(".",l);
	k=emailtext.indexOf(",");
	kk=emailtext.indexOf(" ");
	jj=emailtext.lastIndexOf(".") + 1;
	ll=emailtext.indexOf(":");
	mm=emailtext.indexOf("(");
	nn=emailtext.indexOf(")");
	len=emailtext.length;
	if ((l <= 0) || (j <= (1+1)) || (k != -1) || (kk != -1) || (len-jj < 2) || (len-jj > 3) || (ll != -1) || (mm != -1 ) || (nn != -1))
	{
		return false;
	}
	return true;
}

function imgClick_onclick() {
	if ( document.frmSubmit.txtName.value.length == 0 )
	{
		alert("Please enter your name");
		//window.open("\errorMsg1.htm","error2","top=180,left=120,width=550,height=120");				
		document.frmSubmit.txtName.focus();
		return false;
	}

	
	if ( document.frmSubmit.txtMail.value.length == 0 )
	{
		alert("Please enter your email address");
		document.frmSubmit.txtMail.focus();		
		return false;
	}

	if ( !emailcheck(document.frmSubmit.txtMail.value) )
	{
		
		alert("You have entered an invalid email address.\rPlease make sure your email address is correct and resubmit.");
		//window.open("\errorMsg1.htm","error1","top=180,left=120,width=550,height=120");		
		document.frmSubmit.txtMail.focus();		
		return false;
	}
	
	document.frmSubmit.submit();	
}
                          
