function checkLogin()
{
	var str = document.forms.userSubmission;
	if (str.username.value == "")
	{
		alert("Enter User Name");
		str.username.focus();
		return -1;
	}
	if (str.password.value == "")
	{
		alert("Enter Password");
		str.password.focus();
		return -1;
	}
	str.submit();
}

/*
----------------------------------------------------------------------------------------------
2.Email validation function
----------------------------------------------------------------------------------------------
Description:
	This function is to check the email syntax. This is used in Registration, User, Transport modules
	Input to this function: 
		1.Email address	
	Output of this function
		1.0 if it is  avalid email
		2.-1 if it is an invalid email
----------------------------------------------------------------------------------------------
*/

function checkEmail() 
{
	var str = document.forms.emailSubmission;
	var email = str.email.value;
	var regex = /^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z0-9-]{2,4}$/;
	var emailarray=email.match(regex);
	ln=email.length;
	if((email.charAt(ln-1))==".")
	{
		alert("Invalid Email");
		str.email.focus();
		return -1;
	}
	if(emailarray==null)
	{
		alert("Invalid Email");
		str.email.focus();
		return -1;
	}
	str.submit();
}// end of emailvalidation function