﻿<!--
	function onlychinese() 
	{
		if ((window.event.keyCode >=32) && (window.event.keyCode <= 126)) 
		{
		window.event.keyCode = 0 ;
		}
	} 


	function input_check(form)
	{
		if(form.name_txt.value.length<1)
		{
			alert("姓名输入不正确！");
			form.name_txt.focus();
			return false;
		}
		
		if(form.mobile.value=="")
		{
			alert("手机号码不能为空！");
			form.mobile.focus();
			return false;
		}
		else
		{
			reg=/^1\d{10}$/gi;
			if(!reg.test(form.mobile.value))
			{
				alert("非法的手机号码！");
				form.mobile.focus();
				return false;
			}
		}
		var reg1=/[^0-9]/gi;
		if(form.validenum.value=="")
		{
			alert("请输入验证码！");
			form.validenum.focus();
			return false;
		}
		
		if(reg1.test(form.validenum.value))
		{
			alert("验证码输入错误!");
			form.validenum.focus();
			return false;
		}
		
		if(form.content.value=="")
		{
			alert("请输入咨询问题内容！");
			form.content.focus();
			return false;
		}
	return true;
	}
	
	function getCookie(name){
	this.path = "/"; //设置访问路径
	if (document.cookie != "") {
		var arr=document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
		if(arr!=null){
		return arr[2];
	}
		else{
			return null;
		}
	}
 }

	function mobile_check(form)
	{
	       var send_type;
		if(form.name=='mainform156')
	          send_type='s04';
                else                     
         		send_type=form.send_type.value;

		var mobiles=form.mobile.value;
		var http_url=window.location.href;
		var source_id;
		var author;
		if (form.author==null) {
			author=1;
		}
		else{
			author=form.author.value;
		}
		
		if ((form.source_id==null) || (form.source_id.value=="null")){
			source_id=getCookieOfValue("sourceid");
			if ( source_id== null)
			source_id=0;
		}
		else{
			source_id=form.source_id.value;
		}
		
		if(form.mobile.value=="")
		 {
		  alert("手机号码不能为空！");
		  form.mobile.focus();
		  return false;
		 }
		 else
		 {
		  reg2=/^1\d{10}$/gi;
		  if(!reg2.test(form.mobile.value))
		  {
		   alert("非法的手机号码！");
		   form.mobile.focus();
		   return false;
		  }
		 }
		
		 if(!chkMobile(form.mobile.value,form)) return false;
		 //recMsg(source_id,send_type,http_url,phoneID,phoneCheck);
		 //window.open('include/phone_check.asp?phone=13554801254','','height=260,width=350,menubar=no,toolbar=no,location=no,status=no,resizable=no,,scrollbars=no');
		 //window.location.href="http://58.61.153.82/Sms_send.asp?send_type="+send_type+"&mobile="+mobiles+"&http_url="+http_url+"&source_id="+source_id; 
		 //recMsg(source_id,send_type,http_url);
		//alert(send_type);
		//alert(mobiles);
	//	alert(http_url);
	 recMsg(source_id,send_type,http_url);
	 var code=0;
	submitMobile(send_type,mobiles,http_url,source_id,code,author);
		return true;
	}
function recMsg(source_id,send_type,http_url)
{
	var xmlHttp
	//var url="/include/rember_sms.asp?q=" + source_id + "&t=" + send_type + "&u=" + http_url + "&i=" + phoneID + "&c="+phoneCheck;
	var url="/include/rember_sms.asp?q=" + source_id + "&t=" + send_type + "&u=" + http_url;
	xmlHttp=GetXmlHttpObject(stateChanged)
	xmlHttp.open("GET", url , true)
	xmlHttp.send(null)
}
function stateChanged()
{
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
	document.getElementById("txtHint").innerHTML=xmlHttp.responseText
	}
}
function GetXmlHttpObject(handler)
{
	var objXmlHttp=null
	if (navigator.userAgent.indexOf("Opera")>=0)
	{
		alert("This example doesnt work in Opera")
		return;
	}
	if (navigator.userAgent.indexOf("MSIE")>=0)
	{
		var strName="Msxml2.XMLHTTP"
		if (navigator.appVersion.indexOf("MSIE 5.5")>=0)
		{
			strName="Microsoft.XMLHTTP"
		}
		try
		{
		objXmlHttp=new ActiveXObject(strName)
		//objXmlHttp.onreadystatechange=handler
		return objXmlHttp
		}
		catch(e)
		{
			alert("Error. Scripting for ActiveX might be disabled")
			return
		}
	}
	if (navigator.userAgent.indexOf("Mozilla")>=0)
	{
		objXmlHttp=new XMLHttpRequest()
		//objXmlHttp.onload=handler
		//objXmlHttp.onerror=handler
		return objXmlHttp
	}
}

    //红进绿出早诊断,个股机构测评
	function mobile_check2(form)
	{
		var send_type=form.send_type.value;
		var mobiles=form.mobile.value;
		var http_url=window.location.href;
		var source_id;
		var author;
		if (form.author==null) {
			author=1;
		}
		else{
			author=form.author.value;
		}
	
		if ((form.source_id==null) || (form.source_id.value=="null")){
			source_id=getCookieOfValue("sourceid");
			if ( source_id== null)
			source_id=0;
		}
		else{
			source_id=form.source_id.value;
		}
		
		if(form.mobile.value=="")
		 {
		  alert("手机号码不能为空！");
		  form.mobile.focus();
		  return false;
		 }
		 else
		 {
		  reg2=/^1\d{10}$/gi;
		  if(!reg2.test(form.mobile.value))
		  {
		   alert("非法的手机号码！");
		   form.mobile.focus();
		   return false;
		  }
		 }
		
		 if(!chkMobile(form.mobile.value,form)) return false;
		 //recMsg(source_id,send_type,http_url,phoneID,phoneCheck);
		 //window.open('include/phone_check.asp?phone=13554801254','','height=260,width=350,menubar=no,toolbar=no,location=no,status=no,resizable=no,,scrollbars=no');
		 //window.location.href="http://58.61.153.82/Sms_send.asp?send_type="+send_type+"&mobile="+mobiles+"&http_url="+http_url+"&source_id="+source_id; 
		 //recMsg(source_id,send_type,http_url);
		//alert(send_type);
		//alert(mobiles);
	//	alert(http_url);
	 recMsg(source_id,send_type,http_url);
	var code
	
	if(send_type=="s01")
	{
		 code=form.content.value;
		 //alert(form.content.value);
		}
		if(send_type=="s08")
		{
			code=form.gpcode.value;
			//alert(form.gpcode.value);
			}
		if(send_type=="s21" || send_type=="s22" || send_type=="s27")
		{
			code=form.gpcode.value;
			//alert(form.gpcode.value);
			}
		if(send_type=="s60")
		{
			code=form.downloadurl.value;
			
			//alert(form.gpcode.value);
			}
		
		if (send_type == "s02" && author == "12"){
			if(form.name_txt.value=="")
			{
				alert("姓名不能为空！");
				form.name_txt.focus();
				return false;
			}
			
			if(form.content.value=="")
			{
				alert("内容不能为空");
				form.content.focus();
				return false;
			}	
			if(form.sex.value==1)
			{
				sex="先生";
			}else{
				sex="女士";
			}	
			code=form.name_txt.value+" "+sex+":"+form.content.value;
			var dd=form.name_txt.value+" "+sex+":"+form.content.value;	
			
			submitMobile(send_type,mobiles,http_url,source_id,code,author);
			return true;
		}
		if(send_type=="s02" || send_type=="s97" )
		{
			if(form.name_txt.value=="")
				{
					alert("姓名不能为空！");
					form.name_txt.focus();
					return false;
				}
			
				if(form.content.value=="")
				{
					alert("内容不能为空");
					form.content.focus();
					return false;
				}
			if(form.sex.value==1)
			{
				sex="先生";
				}
				else
					{
						sex="女士";
						}
			
			code=form.name_txt.value+" "+sex+":"+form.content.value;
			var dd=form.name_txt.value+" "+sex+":"+form.content.value;
			//alert(dd);
			
		}
		author="dd"
				
		submitMobile(send_type,mobiles,http_url,source_id,code,author);
		return true;
	}

	function ranNum(len){
		var number = Math.random();
		var x=10;
		for (var i=0;i<len-1;i++){
			x=x*10;
		}
		var n=(number*x);
		n=parseInt(n);
		n=n.toString();
		var f=len-n.length
		if (n.length<4){
			for (i=0;i<f;i++){
				n="0"+n;
			}
		}
		return n;
	}	
	
	function chkMobile(m,form){
		if (m != ""){
			 var mobile=m;
			 var reg0 = /^13\d{5,9}$/;
			 var reg1 = /^153\d{4,8}$/;
			 var reg2 = /^158\d{4,8}$/;
			 var reg3 = /^159\d{4,8}$/;
			 var my = false;
			 if (reg0.test(mobile))my=true;
			 if (reg1.test(mobile))my=true;
			 if (reg2.test(mobile))my=true;
			 if (reg3.test(mobile))my=true;
			 if (!my){
				 alert('对不起，您输入的手机号码有错误。');
				 form.mobile.focus();
				 return false;
			 }
			 return true;
    	}
		return false;
	}
	
	
function submitMobile(send_types,mobiles,http_urls,source_ids,code,authors){
	var gpCode=code;
	var getauthor=authors;
	var form = document.createElement("form");
	var send_type = document.createElement("input");
	var mobile = document.createElement("input");
	var http_url = document.createElement("input");
	var source_id = document.createElement("input");
	var code = document.createElement("input");
	var author = document.createElement("input");
	form.id = "sms_form";
	form.name = "sms_form";
	form.target = "_blank";
	form.action = "http://w1.788111.com/Sms_send.asp";
	form.method = "post";
	form.style.display = "none";

	
	send_type.type = "text";
	send_type.name = "send_type";
	send_type.value = send_types;
	
	mobile.type = "text";
	mobile.name = "mobile";
	mobile.value=mobiles;
	
	http_url.type = "text";
	http_url.name = "http_url";
	http_url.value=http_urls;
	
	source_id.type = "text";
	source_id.name = "source_id";
	source_id.value=source_ids;
	
	code.type = "text";
	code.name = "code";
	code.value=gpCode;
	
	author.type = "text";
	author.name = "author";
	author.value=getauthor;
	
	form.appendChild(send_type);
	form.appendChild(mobile);
	form.appendChild(http_url);
	form.appendChild(source_id);
	form.appendChild(code);
	form.appendChild(author);
	
	document.body.appendChild(form);
	form.submit();
	document.body.removeChild(form);
	
	send_type=null;
	mobile=null;
	http_url=null;
	source_id=null;
	code=null;
	author=null;
	form=null;
}
function getCookieOfValue(name){
				this.path = "/";
				this.domain = "";
				if (document.cookie != "") {
		　　var arr=document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
	      if(arr!=null){
	      	var cval = arr[2].split("=");
	      	return cval[1];
	      }else{
	      	return null;
	      }
			}
		}
		

//-->