// JavaScript Document
	
	function phoneTyping(e, obj, value) {
		if (value.length==14) return false;
		tecla = (document.all) ? e.keyCode : e.which;
		if (tecla==8) return true; //Tecla de retroceso (para poder borrar)
		patron =/[0-9]/;		
		if (value.length == 1) obj.value = "("+value;
		if (value.length == 4) obj.value = value + ")-";
		if (value.length == 9) obj.value = value + "-";
		te = String.fromCharCode(tecla);
		return patron.test(te);		
	};

	function __validate_phone(){
		length_ = this.value.length;
		
		if (this.value.length < 14){
			this.error = "The "+ this.description + " is invalid, a " + this.description + " number must be 10 digits at less";			
		} else if (!(this.value.charAt(0) == "(") ){
				   this.error = "The "+ this.description + " number is invalid";	
		} else if (isNaN(this.value.charAt(1))) {
				   this.error = "The "+ this.description + " number is invalid";	
		} else if (isNaN(this.value.charAt(2))) {
					this.error = "The "+ this.description + " number is invalid";	
		} else if (isNaN(this.value.charAt(3))) {
					this.error = "The "+ this.description + " number is invalid";	
		} else if (isNaN(this.value.charAt(6))) {
					this.error = "The "+ this.description + " number is invalid";	
		} else if (isNaN(this.value.charAt(7))) {
					this.error = "The "+ this.description + " number is invalid";	
		} else if (isNaN(this.value.charAt(8))) {
					this.error = "The "+ this.description + " number is invalid";	
		} else if (isNaN(this.value.charAt(10))) {
					this.error = "The "+ this.description + " number is invalid";	
		} else if (isNaN(this.value.charAt(11))) {
					this.error = "The "+ this.description + " number is invalid";	
		} else if (isNaN(this.value.charAt(12))) {
					this.error = "The "+ this.description + " number is invalid";	
		} else if (isNaN(this.value.charAt(13))) {
					this.error = "The "+ this.description + " number is invalid";	
		}
			
	}
