// JavaScript Document
function doSubmit(theForm){
  var tel = theForm.tel.value;
	if(tel==null||tel=="" ){
	  alert("对不起，您还未输入手机号码！");
	  return false ;
	}
	 //检查手机号码长度
	if(tel.length!=11)
	{
		alert("对不起，您输入的号码位数有误，请重新输入！");
		document.getElementsByName("tel")[0].focus();
		return false;
	}
	

	//检查是否为数字
	if(isNaN (tel))
	{
		alert("对不起，您输入的手机号码有误，请重新输入！");
		document.getElementsByName("tel")[0].focus();
		return false;
	}

}


function isNaN(tempstr){
  var array1="0123456789.";
  var array2="0123456789";
  if (tempstr!=""){
      ilen=tempstr.length
      for (i=0;i<=ilen;i++) 
      {
	      temp=tempstr.charAt(i);
	      if(array1.indexOf(temp)==-1)
	      {
	    	 return true;
    	  }
      } 
	  return false;    
  }
}

function doSubmitstock(theForm){
  var tel = theForm.tel.value;
	if(tel==null||tel=="" ){
	  alert("对不起，您还未输入手机号码！");
	  return false ;
	}
	if(theForm.stock.value==null||theForm.stock.value=="" ){
	  alert("请输入股票代码");
	  return false ;
	}
	if(theForm.stock.value.length!=6)
	{
		alert("对不起，您输入的股票代码位数有误，请重新输入！");
		document.getElementsByName("stock")[0].focus();
		return false;
	}
	 //检查手机号码长度
	if(tel.length!=11)
	{
		alert("对不起，您输入的号码位数有误，请重新输入！");
		document.getElementsByName("tel")[0].focus();
		return false;
	}
	

	//检查是否为数字
	if(isNaN (tel))
	{
		alert("对不起，您输入的手机号码有误，请重新输入！");
		document.getElementsByName("tel")[0].focus();
		return false;
	}
	else{
     return true;
  }
}

