// JavaScript Document
function validate_quick(){
	var st=document.form2.email.value;
	
	if(document.form2.fname.value== "")
	{
	alert("Please enter your first name");
	document.form2.fname.focus();
	document.form2.fname.select();
	return false;
	}
	
	if(document.form2.lname.value== "")
	{
	alert("Please enter your last name");
	document.form2.lname.focus();
	document.form2.lname.select();
	return false;
	}
	
	
	
/*
	//Code for PHONE NO.
	var stripped = document.form2.telephone.value.replace(/[\(\)\.\-\ ]/g, ''); 
	var illegalChars = /[\W_a-zA-Z]/;	
	if(document.form2.telephone.value== "" )
	{
	alert("Telephone Number should not be left blank.");
	document.form2.telephone.focus();
	document.form2.telephone.select();
	return false;
	}else if (isNaN(parseInt(stripped)) || (illegalChars.test(document.form2.telephone.value))) {
        alert("The Telephone Number should be digit.\n");
        document.form2.telephone.focus();
		document.form2.telephone.select();
		return false;
    }
	*/
			
	if(document.form2.email.value=="")
	{
		alert("Please enter your Email");
		document.form2.email.focus();
		document.form2.email.select();
		return false;
	}
	else
	{			
		if(checkEmail(st)!=true)
		{
			alert("Invalid E-Mail  \n"+st);
			document.form2.email.focus();
			document.form2.email.select();
			return false; 
		 }
	}
	
	
}

function checkEmail(str)
{
	if((str.indexOf("@")==-1))
	{
		fstr="Please Enter @ or .";
		return false;
	}
	else
	{
	if((str.indexOf("@") == 0) )
	{
		fstr="@  Cannot Be first";
		alert(fstr);
		return false;
	}
	if((str.indexOf("@") == (str.length-1)))
	{
		fstr="@ Cannot Be Last";
		return false;
	}

	
	if((str.indexOf("@")+1) == str.indexOf("."))
	{
		fstr="@. IS Invalid Email";
		return false;
	}
	}
	var cp=0;					
	if(cp==2)
	{
		fstr="@ cannnot be repeated";
		return false;
	}
	return true;
}

