// JavaScript Document

function validation()
{
	var name = document.formx.name.value;
	var email = document.formx.email.value;
	var emailFormat = /^\w(\.?[\w-])*@\w(\.?[\w-])*\.[a-zA-Z]{2,6}(\.[a-zA-Z]{2})?$/i;
	
	if(name=="")
	{
		alert("please enter Name");
		document.formx.name.focus();
		return false;	
	}
	if(email=="")
	{
		alert("please enter email address");
		document.formx.email.focus();
		return false;
	}
	if(email!= "")	
	{	
		var eres=email.search(emailFormat);
		if(eres == -1)		
		{
			alert("Please Enter Valid Email Id ");
			document.formx.email.focus();
			return false;
		}
	}
}

function validate_form()
{
	var emailFormat = /^\w(\.?[\w-])*@\w(\.?[\w-])*\.[a-zA-Z]{2,6}(\.[a-zA-Z]{2})?$/i;
	var firstname=document.rform.firstname.value;
	var lastname=document.rform.lastname.value;
	var company=document.rform.company.value;	
	var phone=document.rform.phone.value;
	var email=document.rform.email.value;

	var checkCount = 0;
	var chks = document.getElementsByName('intrest[]');
	
	if(firstname=="")
	{
		alert("please enter First Name");
		document.rform.firstname.focus();
		return false;
	}
	if(lastname=="")
	{
		alert("please enter Last Name");
		document.rform.lastname.focus();
		return false;
	}
	if(company=="")
	{
		alert("please enter Company Name");
		document.rform.company.focus();
		return false;
	}
	if(email=="")
	{
		alert("please enter email address");
		document.rform.email.focus();
		return false;
	}
	if(email!= "")	
	{	
		var eres=email.search(emailFormat);
		if(eres == -1)		
		{
			alert("please enter email address");
			document.rform.email.focus();
			return false;
		}
	}
	if(phone=="")
	{
		alert("please enter phone number");
		document.rform.phone.focus();
		return false;
	}
}

function validate()
{
	login=document.timesheet.formlogin.value;
	pwd=document.timesheet.formpassword.value;
	if(login=="")
	{
		alert("please enter username");
		document.timesheet.formlogin.focus();
		return false;
	}
	if(pwd=="")
	{
		alert("please enter password");
		document.timesheet.formpassword.focus();
		return false;
	}
}

function form_login()
{
	username=document.login_form.username.value;
	password=document.login_form.password.value;
	if(username=="")
	{
		alert("please enter username");
		document.login_form.username.focus();
		return false;
	}
	if(password=="")
	{
		alert("please enter password");
		document.login_form.password.focus();
		return false;
	}
}
