    /* FORMAT PHONE BEHAVIOR MASK */ 
    function FormatPhone (e,input) { 
        /* to prevent backspace, enter and other keys from  
         interfering w mask code apply by attribute  
         onkeydown=FormatPhone(control) 
        */ 
        evt = e || window.event; /* firefox uses reserved object e for event */ 
		var pressedkey = evt.which || evt.keyCode; 
        var BlockedKeyCodes = new Array(8,27,13,9); //8 is backspace key 
        var len = BlockedKeyCodes.length; 
        var block = false; 
        var str = ''; 
        for (i=0; i<len; i++){ 
           str=BlockedKeyCodes[i].toString(); 
           if (str.indexOf(pressedkey) >=0 ) block=true;  
        } 
        if (block) return true; 
	 
       s = input.value; 
       //if (s.charAt(0) =='+') return false; 
       allowedValues = '+0123456789';  
       var i; 
       var returnString = ''; 
       /* Search through string and append to unfiltered values  
          to returnString. */ 
       for (i = 0; i < s.length; i++) {  
             var c = s.charAt(i); 
             if ((allowedValues.indexOf(c) >= 1 || (allowedValues.indexOf(c) == 0 & i==0)) & (returnString.length <=  17 )) { //was 13 in place of 20
	             //if (returnString.length==0) returnString +='('; 
        	     //if (returnString.length==4) returnString +=')'; 
	             //if (returnString.length==5) returnString +='-'; 
        	     //if (returnString.length==9) returnString +='-'; 
	             returnString += c; 
        	     } 
       	} 
       input.value = returnString; 
        
       return false 
   } 
   /* END FORMAT PHONE */   