function inputPhone(oControl,lExt)
{
	// strip out any non-valid characters
	cPhone = stripCharsNotInBag(oControl.value,'0123456789()-');

	// check for empties
	if (cPhone == '')
	{
		oControl.value = cPhone;
		return null;
	}
	
	// check if the first char is a 1, remove it after there are 2 chars
	if ((cPhone.length == 2) && (cPhone.substring(0,1) == '1'))
		cPhone = cPhone.substring(1,cPhone.length);

	// strip all formatting chars
	cPhone = stripCharsNotInBag(cPhone,'0123456789');

	if (cPhone != '1')
	{
		// add the formatting chars back in
		cPhone = '('+cPhone;

		if (cPhone.length > 3)
			cPhone = cPhone.substring(0,4)+')'+cPhone.substring(4,cPhone.length);

		if (cPhone.length > 7)
			cPhone = cPhone.substring(0,8)+'-'+cPhone.substring(8,cPhone.length);

		// check for extension
		if ((cPhone.length > 13) || ((cPhone.length==13) && (lExt) && (oControl.value.substring(oControl.value.length-1,oControl.value.length).toLowerCase()=='x')))
		{
			if (lExt)
				cPhone = cPhone.substring(0,13)+' x'+cPhone.substring(13,cPhone.length);
			else
				cPhone = cPhone.substring(0,13);
		}

	}

	// return the new value
	oControl.value = cPhone;
}
