function checkemail(a)
{
if(a=="")
{
return false;
}
var exp=/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z]+$/;
return exp.test(a);
}


function chkname(name)
{
if(name=="")
{
return false;
}

var slen = name.length
for (i=0;i<=slen; i++ )
{
var s1="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ. ";
var scharat = name.charAt(i)
var k = s1.indexOf(scharat)
if (k==-1)
{
	return false;
	i=slen
	}
}
}

function chkzip(zip)
{
if(zip=="")
{
return false;
}

var slen = zip.length
for (i=0;i<=slen; i++ )
{
var s1="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
var scharat = zip.charAt(i)
var k = s1.indexOf(scharat)
if (k==-1)
{
	return false;
	i=slen
	}
}
}

function chklocation(jlocation)
{
if(jlocation=="")
{
return false;
}

var slen = jlocation.length
for (i=0;i<=slen; i++ )
{
var s1="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,";
var scharat = jlocation.charAt(i)
var k = s1.indexOf(scharat)
if (k==-1)
{
	return false;
	i=slen
	}
}
}

function chknum(num)
{
if(num=="")
{
return false;
}

var slen = num.length
for (i=0;i<=slen; i++ )
{
var s1="0123456789+- ";
var scharat = num.charAt(i)
var k = s1.indexOf(scharat)
if (k==-1)
{
	return false;
	i=slen
	}
}
}

function chkpassword()
{
if (document.frm.pwd.value == document.frm.pwdConfirm.value)
{
 
}
else
{
alert("Both are passwords are not same")
document.frm.pwd.value=""
document.frm.pwdConfirm.value=""
document.frm.pwd.focus();
}
}

function chkemail()
{
if (document.frm.email.value == document.frm.emailConfirm.value)
{
document.frm.pwd.focus();
}
else
{
alert("Both emails are not same")
document.frm.email.value=""
document.frm.emailConfirm.value=""
document.frm.email.focus();
}
}

function checkall()
{
var fname = chkname(document.frm.fname.value)
var lname = chkname(document.frm.lname.value)
var phone = chknum(document.frm.Phone.value)
var email = checkemail(document.frm.email.value)


if (fname==false)
	{
	alert("Enter the first name(Characters only)")
	document.frm.fname.value=""
	document.frm.fname.focus();
	}
else
	if (lname==false)
	{
	alert("Enter the Last name(Characters only)")
	document.frm.lname.value=""
	document.frm.lname.focus();
	}
else
	if(phone==false)
	{
		alert("enter the Telephone(Numbers Only)")
		document.frm.Phone.value=""
		document.frm.Phone.focus();
	}
else
		if(email==false)
	{
		alert("enter proper email address")
		document.frm.email.value=""
		document.frm.email.focus();
	}
else
		if (document.frm.Date_of_Accident.value=="")
		{
		alert("Enter the Date of Accident")
		document.frm.Date_of_Accident.value=""
		document.frm.Date_of_Accident.focus();

		}
else
		if (document.frm.Place_of_Accident.value=="")
		{
		alert("Enter the Place of Accident")
		document.frm.Place_of_Accident.value=""
		document.frm.Place_of_Accident.focus();

		}

else
	{
	document.frm.action="athanks.asp"
	document.frm.submit();
	}
}


HTTP/1.1 400 Bad Request
Content-Type: text/html
Date: Wed, 08 Feb 2012 05:53:16 GMT
Connection: close
Content-Length: 35

<h1>Bad Request (Invalid Verb)</h1>
