//this function check wheather the input text is numeric
function IsNumeric(sText)
{
   var ValidChars = "0123456789()-. ";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
}


//this function will parse the phone number out of the string
function parsePhone(sText)
{
   
   if (IsNumeric(sText))
   {
	   document.gs2.q.value = "()"+sText;
	   
   }
    else
   {
	   document.gs2.q.value=sText;
   }
}


