
var xmlHttp = false;
function createXmlhttp() {
    if (window.XMLHttpRequest) {
        xmlHttp = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {
        try {
            xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e1) {
            try {
                xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch (e2)
             { xmlHttp = false; }
        }
    }
    if (!xmlHttp) {
        return;
    }
}
function PostPage(value, sendurl) {
    //用户名
    // var username=document.getElementById("username").value;
    //调用创建请求对象的方法
    createXmlhttp();
    //建立请求连接
    xmlHttp.open("Post", sendurl, false)
    //定义表单上传
    xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8");
    //设置回调函数
    xmlHttp.onreadystatechange = GetValue;
    //发送请求
    if (value == "") {
        xmlHttp.send(null);
    }
    else {
        xmlHttp.send(value);
    }
}
//响应请求
function GetValue() {
    if (xmlHttp.readyState == 4) {
        if (xmlHttp.status == 200 || xmlHttp.status == 0) {
            var test = xmlHttp.responseText;
            return test;
        }
    }
}
function proExit() {
    PostPage("", "getUserData.ashx?parmType=proexit");
    window.location.href = document.URL;
}
function getId(id)
{
	return id=document.getElementById(id);
}
function tab_jo(id)
{
	var id=getId(id);
	var trs=id.getElementsByTagName("tr");
	for(var i=0;i<trs.length;i++)
	{
		trs[i].onmouseover=function()
		{
			if(this.x!="1")
			{this.style.backgroundColor="#F2F7FF"}
		}
		trs[i].onmouseout=function()
		{
			if(this.x!="1")
			{this.style.backgroundColor="#ffffff"}
		}
		trs[i].onclick=function()
		{
			if(this.x!="1")
			{
				this.x="1";
				this.style.backgroundColor="#FFFBE1";
			}
			else
			{
				this.x="0";
				this.style.backgroundColor="#ffffff";
			}
		}
	}
}
function tipC(n)
{
	for(var k=0;k<9;k++)
	{

		var idA=document.getElementById("Q"+k);
		if(k==n)
		{idA.style.display="block"}
		else
		{idA.style.display="none"}

	}
}
function tipQTAB()
{
	var tipb=document.getElementById("tipq");
	var liA=tipb.getElementsByTagName("li");
	for(j=0;j<liA.length;j++)
	{
		liA[j].onmouseover=function(j)
		{
			return function()
			{
				tipC(j)
			}
		}
	(j);
		liA[j].onmouseout=function(j)
		{
			return function()
			{
				var idB=document.getElementById("Q"+j);
				idB.style.display="none";
			}
		}
(j);
	}
}
function ontab()
{
	for(var i=0;i<arguments.length;i++)
	{
		if(i==0){document.getElementById(arguments[0]).style.display="block";}
		else {document.getElementById(arguments[i]).style.display="none";}
	}
}
function bz_topclass()
{
	var bz_top=document.getElementById("bz_top");
	var as=bz_top.getElementsByTagName("a");
	as[0].onclick=function()
	{as[0].className="btn3 cur";as[1].className="btn3";ontab('how_reg','how_buy')}
	as[1].onclick=function()
	{as[1].className="btn3 cur";as[0].className="btn3";ontab('how_buy','how_reg')}
}
function indexTab01()
{
    var bz_top=document.getElementById("zb_zh");
    var as=bz_top.getElementsByTagName("span");
    as[0].onclick=function()
    {as[0].className="btn4";as[1].className="btn4cur";ontab('zb','zh')}
    as[1].onclick=function()
    {as[1].className="btn4";as[0].className="btn4cur";ontab('zh','zb')}
}
//下家留言
function proMessage() {
    var tsContent = document.getElementById("tsContent");
    var proQQ = document.getElementById("proQQ");
    if(tsContent.value=="")
    {
      alert("请输入留言内容");
      return;
    }
    if(proQQ.value=="")
    {
      alert("请输入正确的QQ号，方便我们以后跟你联系");
      return;
    }
    var reportContent = tsContent.value + "ஐ" + proQQ.value;
    var url = "getUserData.ashx?parmType=savemessage";
    PostPage("parmtContent=" + encodeURIComponent(encodeURIComponent(reportContent)), url);
    alert(GetValue());
    tsContent.value="";
    proQQ.value="";
}
