var tefuhao,tefuhao2;
smsid=4027;

function check_tel(theform)
{
	var str;
	if (theform.tel_num.value =="")
	 {
		window.alert ("手机号码不能为空！");
		theform.tel_num.focus();
		return false;
	 }
	 str=theform.tel_num.value ;
	 if (str.length!=11)
	  {
		window.alert ("手机号码位数必须为11位！");
		theform.tel_num.focus();
		return false;
	 }
	 if (fucCheckNUM(str)==0 )
	 {
		window.alert ("手机号码只能含有数字字符！");
		theform.tel_num.focus();
		return false;
	 }
	window.open('','mutorder','width=310,height=300');
	theform.action="http://www.9158.com.cn/sms/union/order/unionorder.asp?smsid="+smsid;
	return true;
}

function fucCheckNUM(NUM)
{
	var i,j,strTemp;
	strTemp="0123456789";
	if ( NUM.length== 0)
		return 0
	for (i=0;i<NUM.length;i++)
	{
		j=strTemp.indexOf(NUM.charAt(i));	
		if (j==-1)
		{
		//说明有字符不是数字
			return 0;
		}
	}
	//说明是数字
	return 1;
}

function checksub(frm)
{

	if (frm.tel_num.value =="")
	 {
		window.alert ("手机号码不能为空！");
		frm.tel_num.focus();
		return false;
	 }
	 str=frm.tel_num.value ;
	 if (str.length!=11)
	  {
		window.alert ("手机号码位数必须为11位！");
		frm.tel_num.focus();
		return false;
	 }
	 if (fucCheckNUM(str)==0 )
	 {
		window.alert ("手机号码只能含有数字字符！");
		frm.tel_num.focus();
		return false;
	 }
    
	var strDetail = '';

	for(i=0;i<frm.elements.length;i++)
	{
		var myStr = new String(frm.elements[i].name);
		var myString = myStr.substr(0,9);
		if(myString == 'id')
			if(frm.elements[i].checked == true)
				strDetail = strDetail+"&"+myStr+"="+frm.elements[i].value;
	}
	if(strDetail == ''){
		alert("请选择至少一项服务！");
		return false;
	}
     window.open('','muti','width=350,height=400,scrollbars=yes')
	return true;
}

function selectall(name,allname)
{
   var myform=document.forms["orderfrm"];
   var i;
   for(i=0;i<myform.elements.length;i++)
   {
      if(myform.elements[i].name==name) myform.elements[i].checked=myform.elements[allname].checked;
   }
}