function check_email(email)
{
	wrongs=" /:,#~`!$%^&*()+=|\\{}[]\"'<>?;";
	if(email == "") 
		a = false;
	for(i=0;i<wrongs.length;i++)
	{
		wrong = wrongs.charAt(i);
		//alert(email.indexOf(wrong,0));
		if(email.indexOf(wrong,0) != -1) 
			return false;
	}
	monkey_pos = email.indexOf("@",0);
	if(monkey_pos==-1 || monkey_pos==0) 
		return false;
	if(email.indexOf("@",monkey_pos+1)!=-1) 
		return false;
	dot_pos=email.indexOf(".",monkey_pos);
	if(dot_pos==-1 || dot_pos==monkey_pos+1) 
		return false;
	if(dot_pos+3>email.length) 
		return false;
	return true;
}




function check_phone(val) 
{
	var email = val ;
	wrongs="/:,#~`!$%^&*()+=|\\{}[]\"'<>?;ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
	if(email == "") 
	a = false;
	for(i=0;i<wrongs.length;i++)
	{
		wrong = wrongs.charAt(i);
		//alert(email.indexOf(wrong,0));
		if(email.indexOf(wrong,0) != -1) 
		return false;
	}
	return true;
}

function explodearray(item,delimiter)
{
temparray=new array(1);
var Count=0;
var tempString=new String(item);

while (tempString.indexOf(delimiter)>0) {
temparray[Count]=tempString.substr(0,tempString.indexOf(delimiter));
tempString=tempString.substr(tempString.indexOf(delimiter)+1,tempString.length-tempString.indexOf(delimiter)+1);
Count=Count+1
}

temparray[Count]=tempString;
return temparray;
} 

function alphanumeric(alphane)
{
	var numaric = alphane;
	if(isNaN(numaric))
	{
		return false;
	}
	else
	{
		for(var j=0; j<numaric.length; j++)
			{
			  var alphaa = numaric.charAt(j);
			  var hh = alphaa.charCodeAt(0);
			  if((hh > 47 && hh<58) || (hh > 64 && hh<91) || (hh > 96 && hh<123) || (hh == 32))
			  {
			  }
			else	{
				 return false;
			  }
			}
	}
 return true;
}

function check_phone(val) 
{
	var email = val ;
	//alert(email);
	wrongs="/:,#~`!$%^&*()+=|\\{}[]\"'<>?;@ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
	
	
	if(email == "") 
		a = false;
	for(i=0;i<wrongs.length;i++)
	{
		wrong = wrongs.charAt(i);
		//alert(email.indexOf(wrong,0));
		if(email.indexOf(wrong,0) != -1) 
			return false;
	}
	return true;
}

function check_email(email)
{
	wrongs=" /:,#~`!$%^&*()+=|\\{}[]\"'<>?;";
	if(email == "") 
		a = false;
	for(i=0;i<wrongs.length;i++)
	{
		wrong = wrongs.charAt(i);
		//alert(email.indexOf(wrong,0));
		if(email.indexOf(wrong,0) != -1) 
			return false;
	}
	monkey_pos = email.indexOf("@",0);
	if(monkey_pos==-1 || monkey_pos==0) 
		return false;
	if(email.indexOf("@",monkey_pos+1)!=-1) 
		return false;
	dot_pos=email.indexOf(".",monkey_pos);
	if(dot_pos==-1 || dot_pos==monkey_pos+1) 
		return false;
	if(dot_pos+3>email.length) 
		return false;
	return true;
}

function check_validdate(outputdate,totime)
{
		//################################# output date
		var tempdate=outputdate.split('-');
		var outday=Number(tempdate[1]);
		var outmonth=Number(tempdate[0]);
		var outyear=Number(tempdate[2]);
		
			
		//############################### today
		var currentTime = totime.split('-');
		var day = Number(currentTime[0]);
		var month = Number(currentTime[1]);
		var year = Number(currentTime[2]);
		
		
		if(year > outyear)
		{
			return false;
		}
		else if(year == outyear)
		{
			if(month > outmonth)
			{
				return false;
			}
			else if(month == outmonth)
			{
				if(outday < day)
				{
					return false;
				}
				else
				{
					return true;
				}
			}
			else
			{
				return true;
			}
		}
		else
		{
			return true;
		}
}


function isAlphabetic(usrid)
{
	//alert(usrid);
	//return false;
	//This contains A to Z , 0 to 9 and A to B
	if(usrid == null || !usrid.toString().match(/^[-]?\d*\.?\d*$/))
	{
		
		var alphanum=/^[0-9a-zA-Z]+$/; //This contains A to Z , 0 to 9 and A to B
		if(usrid.match(alphanum))
		{
			return true;
		}
		else
		{
			return false;
		}
		
	}
	else
	{
		return false;
		
	}
}
