function CheckTel()
{
var pattern=/(^[0-9]{3,4}\-[0-9]{3,9}$)/;
var patternTEL=/^\d{11}$/;
var s = document.getElementById("txtTel").value;
if(s.indexOf("-") == -1)
{
if(!patternTEL.test(s))
{
alert('移动手机格式输入不正确,请重新输入!');
document.getElementById("txtTel").value = "";
return false;
}
}
else
{
if(!pattern.test(s))
{
alert('固定电话格式输入不正确,请重新输入!');
document.getElementById("txtTel").value = "";
return false;
}
}
}