	/**
	 * 
	 * Javascript Validators used staticly.
	 * 
	 * @name Validator
	 * @author Vincent Cantin Bellemre
	 * @since 2007-11-11
	 * @version 1.0.0
	 * @package cbwebdevframework
	 * 
	 */
	 
	var ValidatorElement = 
	{
		isEmail : function (email)
		{			
			var regEmail = /^[\.a-zA-Z0-9_-]+@[\.a-zA-Z0-9-]{2,}[.][a-zA-Z]{2,3}$/;
			return (regEmail.exec(email) != null);
		},
		
		isFilled : function (textValue,nbChars)
		{
			if(nbChars == null)
			{
				nbChars = 0;
			}
			else
			{
				nbChars--;
			}
		
			if(typeof(textValue) == 'number' || typeof(textValue) == 'string' || typeof(textValue) == 'boolean')
			{
				return (textValue.length > nbChars);
			}
			return false;
		},
		
		isPostalCode : function (postalCode)
		{
			postalCode = postalCode.toUpperCase();
			var reg = /^([A-Z]){1}([0-9]){1}([A-Z]){1}([\.\ \-]){0,1}([0-9]){1}([A-Z]){1}([0-9]){1}$/;
			return reg.test(postalCode);	
		},
		
		isPhone : function (phone)
		{
			if(phone.length < 3)
			{
				return false;				 
			}

			 if(phone.match(/[\<\>\,\;\:\\\"\[\]]/) || phone.match(/[a-zA-Z]/))
			 {
				return false;				 
			 }
			 
			return true;				
		},
		
		isPriceFormat : function (price)
		{
			var reg = /^\d+[.]{1}\d{2}$/;
			return reg.test(price);
		},
		
		isTimeFormat : function(timeFormat)
		{	
			var reg = /^(\d{1}|\d{2})[:]{1}\d{2}$/;
			return reg.test(timeFormat);
		}	
	};