/*
	Function is used to check if the value is in
	a decimal format
	xx.x|xx.xx|x.xxx etc
*/
function IsDecimal(thevalue)
{
	var decimal = /^\d+\.\d+$/;

	return decimal.exec(thevalue);
}

/* 
	Function is used to check a comments or description 
	field
	minimum 4 letters or characters.
*/
function IsDescription(thevalue)
{
	var description = /^.{4,}$/;
		
	return description.exec(thevalue);
}

/* 
	Function is used to check a email address
	simple validation
*/
function IsEmail(thevalue)
{
	var email = /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/;
		
	return email.exec(thevalue);
}

/* 
	Function is used to check if the extension of an image file is
	.jpg
	or
	.gif
*/
function IsImageExtension(thevalue)
{
	var image = /^\.jpg$|^\.gif$/;
		
	return image.exec(thevalue);
}

/*
	Function is used to check if the value is in number format
	xxxx (numbers only)
*/
function IsNumber(thevalue)
{
	var number = /^\d+$/;
		
	return number.exec(thevalue);
}

/*
	Function is used to check if a value is 
	a password (consists only 5 or more letters, or numbers)
*/
function IsPassword(thevalue)
{
	var password = /^[A-Za-z0-9]{5,}$/;
		
	return password.exec(thevalue);
}


/* 
	Function is used to check a phone number
	can be 10 digit phone number separated by dashes, 
	spaces or no separator 
*/
function IsPhone(thevalue)
{
	var number = /^\d{3}\s\d{3}\s\d{4}$|^\d{3}-\d{3}-\d{4}$|^\d{10}$/;
		
	return number.exec(thevalue);
}

/*
	Function is used to check if the value is in
	a price format
	x(+)|xx.x|xx.xx
*/
function IsPrice(thevalue)
{
	var number = /^\d+$|^\d+\.\d{1,2}$/;
	
	return number.exec(thevalue);
}

/*
	Function is used to check if a value is 
	a username (consists only 5 or more letters, or numbers)
*/
function IsUsername(thevalue)
{
	var username = /^[A-Za-z0-9]{5,}$/;
		
	return username.exec(thevalue);
}

/*
	Function is used to check if a value is 
	a word (consists only of letters, upper or lower case)
*/
function IsWord(thevalue)
{
	var word = /^[A-Za-z]+$/;
		
	return word.exec(thevalue);
}

/* 
	Function is used to check if a string is valid
	minimum 1 or more letters or numbers
*/
function IsWordNumber(thevalue)
{
	var wordnumber = /^[A-Za-z0-9\s]+$/;
		
	return wordnumber.exec(thevalue);
}

/*
	Function is used to check if a value is 
	a word (consists only of letters, upper or lower case or spaces)
*/
function IsWordSpace(thevalue)
{
	var word = /^[A-Za-z\s]+$/;
		
	return word.exec(thevalue);
}

/*
	Function is used to check if a value is 
	a word with special charcters (consists only of letters, upper or lower case or spaces, -, &, /,,!,? )
*/
function IsWordSpecial(thevalue)
{
	var word = /^[A-Za-z\s\.\<\>\!\&\?\,\*\:\;\-\_\&\(\)\'\/]+$/;
		
	return word.exec(thevalue);
}

/*
	Function is used to check if a value is 
	a word/number with special charcters (consists only of letters, digits, upper or lower case or spaces, -, &, /,,!,? )
*/
function IsWordNumberSpecial(thevalue)
{
	var word = /^[A-Za-z0-9\s\.\<\>\!\&\?\,\*\:\;\-\_\&\(\)\'\/\%\$\@]+$/;
		
	return word.exec(thevalue);
}
