// JavaScript Document

function checknummsp(e)

{



	evt=e || window.event;

	var keypressed=evt.which || evt.keyCode;

	//alert(keypressed);

	if(keypressed!="48" && keypressed!="49" && keypressed!="50" && keypressed!="51" && keypressed!="52" && keypressed!="53" && keypressed!="54" && keypressed!="55" && keypressed!="8" && keypressed!="56" && keypressed!="57" && keypressed!="45" && keypressed!="46" && keypressed!="37" && keypressed!="39" && keypressed!="9")

	{

 		return false;

	}

}

function changefirst(nitesh)

{
if(window.document.getElementById("name").value=="" || window.document.getElementById("name").value=="Enter Name")

	window.document.getElementById("name").value='Enter Name';

	if(window.document.getElementById("phone").value=="" || window.document.getElementById("phone").value=="Enter Phone")

	window.document.getElementById("phone").value='Enter Phone';

	if(window.document.getElementById("email").value=="" || window.document.getElementById("email").value=="Enter Email")

	window.document.getElementById("email").value='Enter Email';

	//alert(window.document.getElementById("description"));

	if(window.document.getElementById("description").value=="" || window.document.getElementById("description").value=="Enter a brief description of your case")

	window.document.getElementById("description").value='Enter a brief description of your case';

	if(nitesh.id=="name" && nitesh.value=="Enter Name")

	nitesh.value='';

	if(nitesh.id=="phone" && nitesh.value=="Enter Phone")

	nitesh.value='';

	if(nitesh.id=="email" && nitesh.value=="Enter Email")

	nitesh.value='';

	if(nitesh.id=="description" && nitesh.value=="Enter a brief description of your case")

	nitesh.value='';

	

	

}

function changeblur()

{

if(window.document.getElementById("name").value=="" || window.document.getElementById("name").value=="Enter Name")

	window.document.getElementById("name").value='Enter Name';

	if(window.document.getElementById("phone").value=="" || window.document.getElementById("phone").value=="Enter Phone")

	window.document.getElementById("phone").value='Enter Phone';

	if(window.document.getElementById("email").value=="" || window.document.getElementById("email").value=="Enter Email")

	window.document.getElementById("email").value='Enter Email';

	//alert(window.document.getElementById("description"));

	if(window.document.getElementById("description").value=="" || window.document.getElementById("description").value=="Enter a brief description of your case")

	window.document.getElementById("description").value='Enter a brief description of your case';	

	

}



function validate(){

if(window.document.getElementById('name').value=='' || window.document.getElementById('name').value=='Enter Name'){

alert("Please enter your name");

window.document.getElementById('name').value='';

window.document.getElementById('name').focus();

return false;

}

if(window.document.getElementById("phone").value=="" || window.document.getElementById("phone").value=="Enter Phone"){

alert("Please enter your phone no.");

window.document.getElementById('phone').value='';

window.document.getElementById('phone').focus();

return false;

}

if(window.document.getElementById("email").value=="" || window.document.getElementById("email").value=="Enter Email"){

alert("Please enter your email Id");

window.document.getElementById('email').value='';

window.document.getElementById('email').focus();

return false;

}  else if (document.getElementById("email").value.length >0){ 

			i=document.getElementById("email").value.indexOf("@")

			j=document.getElementById("email").value.indexOf(".",i)

			k=document.getElementById("email").value.indexOf(",")

			kk=document.getElementById("email").value.indexOf(" ")

			jj=document.getElementById("email").value.lastIndexOf(".")+1

			len=document.getElementById("email").value.length

			

			if ((i>0) && (j>(1+1)) && (k==-1) && (kk==-1) && (len-jj >=2) && (len-jj<=3)){

			}else {

				alert("Please enter a valid email address.\n");

				document.getElementById("email").focus();

				return false;

			}

}

return true;



}

/*var genvalidator = new Validator("frm_login");

genvalidator.addValidation("name","req","Please enter your name.");

genvalidator.addValidation("phone","req","Please enter your phone no.");

genvalidator.addValidation("phone","num","Please enter valid phone no.");

genvalidator.addValidation("email","req","Please enter your email Id.");

genvalidator.addValidation("email","email","Please enter your valid email Id.");*/



