function chkEmail(email) {
	emailReg = "^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[a-zA-Z]$"
	var regex = new RegExp(emailReg);
	return regex.test(email);	
}

function trimStr(string) {
	var temp = "";
	string = '' + string;
	splitstring = string.split(" ");
	for(i = 0; i < splitstring.length; i++)
		temp += splitstring[i];
	return temp;
}

function chkNumFormat(string, size) {
	if(string.length<size) {
		return false;
	}
	else if (isNaN(string)==true){
		return false;
	}
	return true;
}

//Validating Date
function chkMonthDays(MonIndex,SelDay,SelYear)
{
	if(MonIndex==4 || MonIndex==6 || MonIndex==9 || MonIndex==11)
	{
		if(parseInt(SelDay)==31)
		{
			return false;
		}
	} 
	if(MonIndex==2)	//For Feb.
	{
		if((parseInt(SelYear) % 4)!=0)
		{
			if(parseInt(SelDay)>28)
			{
				return false;
			}
		}
		else if((parseInt(SelYear) % 400)==0)
		{
			if(parseInt(SelDay)>29)
			{
				return false;
			}
		}
		else if((parseInt(SelYear) % 100)==0)
		{
			if(parseInt(SelDay)>28)
			{
				return false;
			}
		}
		else
		{
			if(parseInt(SelDay)>29)
			{
				return false;
			}
		}
	}
}