// JavaScript Document
//check given field value is blank or not.
function isEmpty(field)
{
	if(field.value.length==0)
	{
		return true;
	}
}
//check given field is filled
function isFill(field)
{
	if(field.value.length !=0)
	{
		return true;
	}
}
//check given value is numeric or not
function isNAN(field)
{
	if(isNaN(field.value))
	{
		return true;
	}
}
//check given email is valid of not
function isValidEmail(val)
{
var email=val;
var dotFlag=false;
var atrateFlag=false;
var dotrateAtFistPlaceFlag=true;
var countRate=0;
var posOfDot;
var posOfRate;
//check first letter of email should not be "." or "@"
if(email.charAt(0) == "." || email.charAt(0) == "@")
{
	dotrateAtFistPlaceFlag=false;
}
//
for(i=0;i<email.length;i++)
{
	if(email.charAt(i)==".")
	{
		if(!(email.charAt(i-1)== "@") && !(email.charAt(i+1)== "@") && !(email.charAt(i-1)== ".") && !(email.charAt(i+1)== "."))
		{
		dotFlag=true;
		}
		else
		{
		break;
		}
		posOfDot=i;
	}
	if(email.charAt(i)=="@") 
	{
		countRate=countRate+1;
		if(countRate==1)
		{
		atrateFlag=true;
		}
		else
		{
		break;
		}
		posOfRate=i;
	}
}

if(!dotFlag || !(atrateFlag) || !(dotrateAtFistPlaceFlag))
{
	return true;
}
else if(posOfDot < posOfRate)
{
	return true;
}
}

