<!--

function isAlpha(str)
{
	var pattern = "/[a-zA-Z\ ]+/g"
	return pattern.test(str)
}


function AllowAlpha(str) 
{
	//Remove any non-words, digits excluding blank(s)
	str = str.replace(/[^a-zA-Z\ ]/g,'');
	
	//To get rid of any additional spaces
	str = str.replace(/\s\s/g,' ');
	
	//Trim the 1st and last blank space
	//str = str.replace(/^\s\b/,'');
			
	return str;
}


function AllowAlphaNumeric(str)
{
	//Remove any non-words, digits including blank(s)
	//return str.replace(/[^a-zA-Z0-9\s]/g,'');
	
	return str.replace(/\W+/g,'');
	
}

function AllowNumeric(str)
{
	//Remove anything else other than a digit.
	return str.replace(/[\D]/g,'');
	//return str.replace(/\W+/g,'');
}


function AllowSpecial(str) 
{
	//Remove any non-words, digits excluding blank(s)
	str = str.replace(/[^a-zA-Z\ \.\-]/g,'');
	
	//To get rid of any additional spaces
	str = str.replace(/\s\s/g,' ');
	
	//Trim the 1st and last blank space
	//str = str.replace(/^\s\b/,'');
			
	return str;
}


function CheckEmailAddr(str)
{

var period_pos;  // the position of the '.' sign
var at_pos;  // the position of the '@' sign

at_pos = str.indexOf("@");
if (at_pos > 0)
	period_pos = str.indexOf(".",at_pos)	
else
	period_pos = 0
	
//If the @ sign is the first char or the period is the first char after the '@' sign or
//the length of the email addr is zero, it must be an invalid e-mail addr.
if (( parseInt(at_pos)<=0) || ( parseInt(period_pos)<=0 ) || ( !parseInt(str.length)) || ((parseInt(period_pos)-parseInt(at_pos))  == 1)) 
	return false;
else
	return true;
}

function AllowDouble(str)
{
	//lk 19/12/08 Allow numeric and fullstop.
	return str.replace(/[^0-9\ \.]/g,''); 
}

function AllowPlusMinus(str)
{
	//lk 26/12/08 Allow numeric and fullstop.
	return str.replace(/[^0-9\ \.\-]/g,'');
}

function UCase(str)
{
	//lk 19/12/08
	return str.toUpperCase();
}

-->
