﻿// JScript 文件
var url = document.location.href;
var title = document.title;
var lyrefurl = encodeURI(escape(document.referrer));
var sc_url = url.replace("iup=", "frm=").replace("toid=", "frm=").replace("iup=", "frm=").replace("toid=", "frm=") + "";
if (sc_url.indexOf("?") > 0) {
    sc_url = sc_url + "&from=shoucang&iup=20263";
}
else {
    sc_url = sc_url + "?iup=20263&from=shoucang";
}

document.write(" <div id='ly_Div' class='ly_text' style='width:760px;margin-top:10px;'>");
document.write(" <form action='https://data.txooo.com/default.aspx?ly=ly&sn2009=3&tc=" + getspecailvar("tc") + "&iup=" + getspecailvar("iup") + "' method=post id=leavewordForm >");
document.write(" <div class='ly_text' style='width:710px;text-align:center;'>");
document.write(" <div style='width:610px;text-align:center;height:55px;line-height:30px;border: solid 1px #1147aa;background-color:White; margin-left:10px;'>");
document.write(" <img src=\"http://img.txooo.com/400/info.gif\"  style='margin-top:5px;' /><img id='imgp400' src=\"http://img.txooo.com/Get400Number.ashx?u=" + url + "\" />");
document.write(" </div>");
document.write(" <div style='float:left;width:160px;text-align:center;margin-top:5px;' >");
document.write(" <div style='width:150px;height:300px;margin-left:20px; background-color:#fefbef'  class='BkIn'>");
document.write(" <div style='width:140px;height:22px;text-align:left; margin-top:3px;line-height:22px;color:White;background-color:#cc0000;font-weight:bold;'>");
document.write(" &nbsp;<img style='margin-top:1px;' border='0' src='/ly_form/img/image122.gif'  />&nbsp;友情提示");
document.write(" </div>");
document.write(" <div style='width:140px;line-height:28px;text-align:left;margin-top:10px;font-size:13px;'>");
document.write(" &nbsp;&nbsp;&nbsp;&nbsp;<strong>若想找到好项目，请多留言，多咨询；</strong>留言是零风险、零费用、零成本，最快找到商家的方式。<br/>&nbsp;&nbsp;&nbsp;&nbsp;<strong><font color=red>完整填写右侧表单，留言成功后24小时内将有专业客服人员与您联系！</font></strong>");
document.write(" </div>");
document.write(" </div>");
document.write(" </div>");

document.write(" <div style='float:left;width:510px;margin-left:20px;margin-top:5px;'>");

document.write(" <div style='width:510px;height:25px;overflow:hidden;'>");
document.write(" <div style='float:left; width:90px;text-align:right;'>您 的 姓 名：<span class='hong' style='font-size: 12px; color: #e30000; line-height: 15px'>* </span></div>");
document.write(" <div style='float:left; width:200px;text-align:left;'>");
document.write(" <input name='LeavewordUserTB' onblur='checkInput(\"LeavewordUserTB\");' style='margin-top:3px;' size='30' class='BkIn' maxlength='6' onfocus='ChangeClass(\"LeavewordUserTB\");'  type='text' id='LeavewordUserTB' /></div>");
document.write(" <div style='float:left; width:220px;text-align:left;'> ");
document.write(" <div id='title_LeavewordUserTB' class='title_text'> ");
document.write(" 您的真实姓名,请使用中文");
document.write(" </div>");
document.write(" <div id='hidden_div' style='float:left;width:15px;text-align:left;display:none;'><input name='LyType' type='hidden' value='1' /><input type='hidden' id='site_id'  name='site_id' value='' />");
document.write(" <input type='hidden' id='father_type' name='father_type' value='' /><input type='hidden' id='son_type'  name='son_type' value='' /> <input type='hidden' id='steptime' name='steptime' value='' />");
document.write(" <input type='hidden' id='pagetitle' name='pagetitle' value='' /><input type='hidden' id='lyafterurl'  name='lyafterurl' value='' /><input type='hidden' id='starttime' name='starttime' value='' /><input type='hidden' id='endtime' name='endtime' value='' />");
document.write('  <input type="hidden" id="lyrefurl" name="lyrefurl" value="" /><input type="hidden" id="lyfto" name="lyfto" value="" /><input type="hidden" id="lycookieid" name="lycookieid" value="" />');
document.write(" </div>");
document.write(" </div>");
document.write(" </div>");

document.write(" <div style='width:510px;'>");
document.write(" <div style='float:left; width:90px;text-align:right;'>");
document.write("   您 的 手 机：<span class='hong' style='font-size: 12px; color: #e30000; line-height: 15px'>* </span> ");
document.write(" </div>");
document.write(" <div style='float:left; width:200px;text-align:left;'> ");
document.write(" <input name='MobilePhoneTB' size='30' maxlength='11' type='text' class='BkIn' id='MobilePhoneTB' onfocus='ChangeClass(\"MobilePhoneTB\");' onblur='checkInput(\"MobilePhoneTB\");'  />");
document.write(" </div>");
document.write(" <div style='float:left; width:220px;text-align:left;'>");
document.write(" <div id='title_MobilePhoneTB' class='title_text'> ");
document.write(" 请尽量填写手机号码");
document.write(" </div>");
document.write(" </div>");
document.write(" </div>");

document.write(" <div style='width:510px;'>");
document.write(" <div style='float:left; width:90px;text-align:right;'>");
document.write(" 您 的 电 话：<span class='hong' style='font-size: 12px; color: #e30000; line-height: 15px'>&nbsp; </span> "); 
document.write(" </div>");
document.write(" <div style='float:left; width:200px;text-align:left;'> ");
document.write(" <input name='QuHao' class='BkIn' size='5' maxlength='4' onfocus='ChangeClass(\"TelephoneTB\");' onblur='checkInput(\"MobilePhoneTB\");' type='text' id='QuHao' /> - ");
document.write(" <input name='TelephoneTB' size='17' onfocus='ChangeClass(\"TelephoneTB\");' onblur='checkInput(\"MobilePhoneTB\");' type='text' maxlength='8' id='TelephoneTB' class='BkIn' />");
document.write(" <input name='tel_son' size='4' maxlength='4' type='text' style='display:none;'  id='tel_son' class='BkIn' />");
document.write(" </div>");

document.write(" <div style='float:left; width:220px;text-align:left;'>");
document.write(" <div id='title_TelephoneTB' class='title_text'> ");
document.write(" 请正确填写联系电话");
document.write(" </div>");
document.write(" </div>");
document.write(" </div>");

document.write(" <div style='width:510px;'>");
document.write(" <div style='float:left; width:90px;text-align:right;'>");
document.write(" 您  的 qq  号：<span class='hong' style='font-size: 12px; color: #e30000; line-height: 15px'>&nbsp; </span>");
document.write(" </div>");
document.write(" <div style='float:left; width:200px;text-align:left;'> ");
document.write(" <input name='QQTB' size='30' type='text' id='QQTB' class='BkIn' />");
document.write(" </div>");
document.write(" <div style='float:left; width:220px;text-align:left;display:none;'>");
document.write(" <span class=ly_text style='font-size: 12px;  line-height: 15px;'>qq号是与您联系最方便实用的方式</span>");
document.write(" </div>");
document.write(" </div>");
document.write(" <div style='width:510px;'>");
document.write(" <div style='float:left; width:90px;text-align:right;'>");
document.write(" 您 的 邮 箱：<span class='hong' style='font-size: 12px; color: #e30000; line-height: 15px'>&nbsp; </span>");
document.write(" </div>");
document.write(" <div style='float:left; width:200px;text-align:left;'> ");
document.write(" <input name='EmailTB' size='30' type='text' id='EmailTB' onfocus='ChangeClass(\"EmailTB\");' onblur='checkInput(\"EmailTB\");' class='BkIn' />");
document.write(" </div>");
document.write("  <div style='float:left; width:220px;text-align:left;'>");
document.write(" <div id='title_EmailTB' class='title_text'> ");
document.write(" E-mail可收到电子版资料");
document.write(" </div>");
document.write(" </div>");
document.write(" </div>");

document.write(" <div style='width:510px;'>");
document.write(" <div style='float:left; width:90px;text-align:right;'>");
document.write("  详 细 地 址：<span class='hong' style='font-size: 12px; color: #e30000; line-height: 15px'>* </span>");
document.write(" </div>");
document.write(" <div style='float:left; width:200px;text-align:left;'>"); 
 document.write(" <input name='AddressTB' size='30'  type='text' id='AddressTB' onfocus='ChangeClass(\"AddressTB\");'  onblur='checkInput(\"AddressTB\");' class='BkIn' />");
document.write(" </div>");
document.write(" <div style='float:left; width:220px;text-align:left;'>");
document.write(" <div id='title_AddressTB' class='title_text'> ");
document.write(" 请尽量详细填写");
document.write(" </div>");
document.write(" </div>");
document.write(" </div>");

document.write(" <div style='width:510px;'>");
document.write(" <div style='float:left; width:90px;text-align:right;'>");
document.write("  您 的 邮 编：<span class='hong' style='font-size: 12px; color: #e30000; line-height: 15px'>* </span>");
document.write(" </div>");
document.write(" <div style='float:left; width:200px;text-align:left;'> ");
document.write("  <input name='PostCodeTB' size='30' maxlength='6' type='text' id='PostCodeTB' onfocus='ChangeClass(\"PostCodeTB\");' onblur='checkInput(\"PostCodeTB\");'  class='BkIn' />");
document.write(" </div>");
document.write(" <div style='float:left; width:220px;text-align:left;'>");
document.write(" <div id='title_PostCodeTB' class='title_text'> ");
document.write(" 请正确填写邮政编码");
document.write(" </div>");
document.write(" </div>");
document.write(" </div>");

document.write(" <div style='width:510px;height:auto;'>");
document.write(" <div style='float:left; width:90px;text-align:right;height:auto;'>");
document.write(" 留 言 内 容：<span class='hong' style='font-size: 12px; color: #e30000; line-height: 15px'>* </span><br /> <br /><div style='display:none;'><a  onclick='ResetLY()' style='font-size:12px;text-decoration: none;font-weight:normal;LETTER-SPACING:0px;cursor:hand;'><font   color='red' >清 空 留 言</font> </a>&nbsp;<br /> <a  onclick='changeReadOnly(LeavewordTB)' style='font-size:12px;text-decoration: none;font-weight:normal;LETTER-SPACING:0px;cursor:hand;'><font   color='red' >自 填 留 言</font> </a></div>");
document.write(" </div>");
document.write(" <div style='float:left; width:200px;text-align:left;height:auto;'> ");
document.write("  <textarea cols='28' name='LeavewordTB' id='LeavewordTB'  onblur='checkInput(\"LeavewordTB\");' onfocus='ChangeClass(\"LeavewordTB\");'  style='font-size:12px;' class='BkIn'   rows='6' ></textarea><br><font   color='red' ><strong></strong></font>");
document.write(" </div>");
document.write(" <div id='QuickMessage' style='float:left; width:220px;text-align:left; '>");
document.write(" <div id='title_LeavewordTB' class='title_text'> ");
document.write(" 请您认真详细填写留言。");
document.write(" </div>");

document.write(" </div>");
document.write(" </div>");
document.write(" <div style='height:0px;clear:both;'> </div>");

document.write(" <div style='width:510px;'>");
document.write(" <div style='float:left; width:90px;text-align:right;'>");
document.write("  验证码：<span class='hong' style='font-size: 12px; color: #e30000; line-height: 15px'>* </span>");
document.write(" </div>");
document.write(" <div style='float:left; width:200px;text-align:left;'> ");
document.write("  <input name='YanZhengNo' size='8' maxlength='4' type='text' id='YanZhengNo' class='BkIn' /><img src='http://data.txooo.com/updata.aspx?yanzheng=44' border='0' onclick='ChangeCode()' alt='看不清点击换一张！'  align='absbottom' id='checkcode'> <a onclick='ChangeCode()' style='cursor:hand; text-decoration:underline;'> 看不清换一张</a>");
document.write(" </div>");
document.write(" <div  style='float:left; width:220px;text-align:left; '>");
document.write(" <div  class='title_text'> ");
document.write(" </div>");
document.write(" </div>");
document.write(" </div>");


document.write(" <div style='width:510px;margin-top:0px; '>");
document.write(" <div style='float:left;width:200px; height:40px; line-height:40px; text-align:right;'>");
document.write(" <img height='26' style='margin-top:10px; margin-right:20px;' src='/ly_form/img/tijiao.gif' width='97' alt='提交留言' style='cursor:hand;' id='ImgOk' onclick=\"sheke(document.getElementById('leavewordForm'));\"/>");
document.write(" </div>");
document.write(" <div style='float:left;width:170px;height:40px; line-height:40px; text-align:left;'>");
document.write(" <img height='26' style='margin-top:10px;' src='/ly_form/img/chongxie.gif' width='97' alt='重写留言' style='cursor:hand;' onclick=\"document.getElementById('leavewordForm').reset();\"/>");
document.write(" </div>");
document.write(" </div>");
document.write(" </div>");
document.write(" </div>");
document.write(" </form>");
document.write(" </div>");

document.write("<style type='text/css'>");
document.write("#ly_Div .ly_text {");
document.write("	font-size:12px;color: #000000;letter-spacing: 0px;");
document.write("}");
document.write("#ly_Div div{");
document.write("font-size:12px;");
document.write("height:30px; ");
document.write("line-height:30px;");
document.write("}");
document.write("#ly_Div .Bk {");
document.write("	border-right-width: 1px;");
document.write("	border-bottom-width: 1px;");
document.write("	border-left-width: 1px;");
document.write("	border-top-style: none;");
document.write("	border-right-style: solid;");
document.write("	border-bottom-style: solid;");
document.write("	border-left-style: solid;");
document.write("	border-right-color: #adaead;");
document.write("	border-bottom-color: #adaead;");
document.write("	border-left-color: #adaead;");
document.write("}");
document.write("#ly_Div .BkIn {");
document.write("	border-right-width: 1px;");
document.write("	border-bottom-width: 1px;");
document.write("	border-left-width: 1px;");
document.write("	border-top-width: 1px;");
document.write("	border-top-style: outset;");
document.write("	border-top-color: #adaead;");
document.write("	border-right-style: solid;");
document.write("	border-bottom-style: solid;");
document.write("	border-left-style: solid;");
document.write("	border-right-color: #adaead;");
document.write("	border-bottom-color: #adaead;");
document.write("	border-left-color: #adaead;");
document.write("	font-size:12px;");
document.write("}");
document.write("#ly_Div .Bk2 {");
document.write("	border-bottom-width: 1px;");
document.write("	border-bottom-style: solid;");
document.write("	border-bottom-color: #adaead;");
document.write("}");
document.write("#ly_Div .BkL {");
document.write("	border-left-width: 1px;");
document.write("	border-left-style: solid;");
document.write("	border-left-color: #adaead;");
document.write("}");
document.write("#ly_Div .Error_text {");
document.write("	width:510px;text-align:left;font-weight:bold;color:Red;font-size:14px;padding-left:90px;height:30px;overflow:hidden;border:solid 1px #ffdf81;background-color:#fff7eb;");
document.write("}");
document.write("#ly_Div .title_text {");
document.write("	float:left;width:210px;text-align:left;font-size:12px;height:23px;line-height:23px;padding-left:5px;overflow:hidden;");
document.write("}");
document.write("#ly_Div .title_onfocus {");
document.write("	float:left;width:210px;text-align:left;color:#063589;font-size:12px;height:23px;padding-left:5px;line-height:23px;border:solid 1px #1147aa;background-color:#ebf1fc;overflow:hidden;");
document.write("}");
document.write("#ly_Div .title_onblur_Error {");
document.write("	float:left;width:210px;text-align:left;font-size:12px;height:23px;padding-left:5px;line-height:23px;border:solid 1px #fa7821;background-color:#fdefe5;overflow:hidden;");
document.write("}");
document.write("#ly_Div .title_imgdiv {");
document.write("	float:left;width:20px;height:23px;line-height:23px;padding-top:5px;overflow:hidden;");
document.write("}");
document.write("</style>");

 function GetDateStr()
{
  var now = new Date();
     var s = "";   // Declare variables.
     s += now.getYear() + "-";                       // Get year.
     s += (now.getMonth() + 1) + "-";          // Get month
     s += now.getDate() + " ";                // Get day
     s += now.getHours() + ":";
     s += now.getMinutes() + ":";
     s += now.getSeconds();
     return s;
}
function getspecailvar(name, url) {
    var str = window.top.location.search;

    if (url) {
        str = url;
    }
    if (str.indexOf(name) != -1) {
        var pos_start = str.indexOf(name) + name.length + 1;
        var pos_end = str.indexOf("&", pos_start); if (pos_end == -1)
        { return str.substring(pos_start) } else { return str.substring(pos_start, pos_end) }
    }
    else { return '' }
}
var txoooFto = getspecailvar("fto");
if (txoooFto) {
    document.getElementById("lyfto").value = txoooFto;
}
var sdate=new Date();
document.getElementById("starttime").value = GetDateStr();
if (document.getElementById("lyrefurl")) {
    if (document.getElementById("lyrefurl").value == "") {
        document.getElementById("lyrefurl").value = lyrefurl;
    }
}


 function ChangeCode()
{
document.getElementById("checkcode").src='http://data.txooo.com/updata.aspx?yanzheng=44&d='+Math.random();
    
}
 function LTrim(s)
{

    for(var i=0;i<s.length;i++)

        if(s.charAt(i)!=' ')

            return s.substring(i,s.length);

    return "";
}
function RTrim(s)
{
	for(var i=s.length-1;i>=0;i--)
		if(s.charAt(i)!=' ')
		    return s.substring(0,i+1);
    return "";
}
function Trim(s)
{
	return RTrim(LTrim(s));
}

document.getElementById("pagetitle").value=title;
if(url.indexOf("txooo.com.cn")>-1)
{
document.getElementById("reurl").value="http://618.txooo.com/lz_comcn.htm";
}
/**清空留言*/
function ResetLY()
{
    document.getElementById("LeavewordTB").value="";
}
/**选择快捷留言*/
function sel(theinput)
{

		if(document.getElementById("LeavewordTB").value!="")
			document.getElementById("LeavewordTB").value+="\n"+theinput
		else
			document.getElementById("LeavewordTB").value=theinput

}

/**自定义填写留言*/

function changeReadOnly(obj) {
	if (obj.readOnly == true) {
		obj.readOnly = false;
		alert("现在您可以自己填写留言了！");
		obj.focus();
		//obj.innerHTML = "你现在可以修改我了";
	} 
}
/**检查是否正确的手机号码*/
function isMobile(s) {
	var regu = "^([1])([3,5,8])(([0-9-]+)|([0-9]+))([0-9])$";
	var re   = new RegExp(regu);
	if ((s.search(re) != -1) && (s.length==11))
		return true;
	else
		return false;
}
//检查邮箱
function check_email(address)
{
	if ((address == "")|| (address.indexOf ('@') == -1)||(address.indexOf ('.') == -1))
		return false;
	return true;
}
//获取焦点时 改变样式
function ChangeClass(obj)
{
var chenk_title = document.getElementById('title_'+obj);
var change=1;
if(chenk_title.className!="title_onblur_Error")
{
    chenk_title.className="title_onfocus";
}
else
{
    change=0;
}
    var Error_ImgDiv = "<div class='title_imgdiv' ><img src='/ly_form/img/Error_Lz.gif'/></div>";
    var Ok_ImgDiv = "<div class='title_imgdiv' ><img src='/ly_form/img/Ok_Lz.gif'/></div>";
	var Start_Div="<div style='float:left;width:178px;text-align:left;' >";
	var End_Div="</div>";
    switch(obj)
	{
		case "LeavewordUserTB":	
		    if(change==1)
		    {
		        chenk_title.innerHTML="您的真实姓名,请使用中文";
		    }
			break;
		case "AddressTB":
			 if(change==1)
		    {
		        chenk_title.innerHTML="请尽量详细填写";
		    }
			break;
		case "PostCodeTB":
			 if(change==1)
		    {
		        chenk_title.innerHTML="请正确填写邮政编码";
		    }
			break;
		case "LeavewordTB":
			 if(change==1)
		    {
		        chenk_title.innerHTML="请您认真详细填写留言。";
		    }
			break;
		case "EmailTB":
			if(change==1)
		    {
		        chenk_title.innerHTML="E-mail可收到电子版资料";
		    }
			break;
		case "MobilePhoneTB":
		    if(change==1)
		    {
		        chenk_title.innerHTML="请尽量填写手机号码";
		    }
			break;
		case "TelephoneTB":
	        if(change==1)
	        {
	            chenk_title.innerHTML="请正确填写联系电话";
	        }
		    break;
	}
}
//逐个检查
function checkInput(obj)
{
    var str="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,./'[]{}`1234567890-=\~!@#$%^&*()_+|?><:";
	var chenk_obj = document.getElementById(obj);
	var chenk_error = document.getElementById('error_'+obj);
	var chenk_title = document.getElementById('title_'+obj);
	
	var Error_ImgDiv="<div class='title_imgdiv' ><img src='http://618.txooo.com/images/Error_Lz.gif'/></div>";
	var Ok_ImgDiv="<div class='title_imgdiv' ><img src='http://618.txooo.com/images/Ok_Lz.gif'/></div>";
	var Start_Div="<div style='float:left;width:178px;text-align:left;' >";
	var End_Div="</div>";
	switch(obj)
	{
		case "LeavewordUserTB":	
			if (Trim(chenk_obj.value) !="")
	        {  
	            var c=Trim(chenk_obj.value).substr(0,1);
	            if(str.indexOf(c)>-1)
	            {
		            chenk_title.innerHTML=Error_ImgDiv+Start_Div+"姓名必须填写中文！"+End_Div;
		            chenk_title.className="title_onblur_Error";
		            return;
	            }
	            else
	            {
	            chenk_title.innerHTML=Ok_ImgDiv+Start_Div+"填写正确"+End_Div;
	            chenk_title.className="title_text";	
	            }		
	        }
	        else
	        {
	          chenk_title.className="title_text";	
	        }
			break;
		case "AddressTB":
			if (Trim(chenk_obj.value) !="")
	        { 
	            var t=Trim(chenk_obj.value).substr(0,1);
	            if(str.indexOf(t)>-1)
	            {
	                chenk_title.innerHTML=Error_ImgDiv+Start_Div+"地址必须填写中文！"+End_Div;
		            chenk_title.className="title_onblur_Error";
	            }
	            else if(Trim(chenk_obj.value).length<7)
	            {
	                chenk_title.innerHTML=Error_ImgDiv+Start_Div+"地址不得少于7个字！"+End_Div;
		            chenk_title.className="title_onblur_Error";
	            }
	            else
	            {
	                chenk_title.innerHTML=Ok_ImgDiv+Start_Div+"填写正确"+End_Div;
	                chenk_title.className="title_text";	
	            }
	        }
	        else
	        {
	           chenk_title.className="title_text";	
	        }
	        
			break;
		case "PostCodeTB":
			if ((Trim(chenk_obj.value).length<6) && (Trim(chenk_obj.value).length>0))
	        {
	       
		        chenk_title.innerHTML=Error_ImgDiv+Start_Div+"邮编必须为6位数字！"+End_Div;
		        chenk_title.className="title_onblur_Error";
	        }
	        else
	        {
	             if (isNaN(Trim(chenk_obj.value))==true)
	            {
		            chenk_title.innerHTML=Error_ImgDiv+Start_Div+"邮编必须为6位数字！"+End_Div;
		            chenk_title.className="title_onblur_Error";
	            }
	            else
	            {
	                if(Trim(chenk_obj.value).length==0)
	                {
	                    chenk_title.className="title_text";	
	                }
	                else
	                {
	                    chenk_title.innerHTML=Ok_ImgDiv+Start_Div+"填写正确"+End_Div;
	                    chenk_title.className="title_text";	
	                }  
	                
	            }
	        }
			break;
		case "LeavewordTB":
			 if (Trim(chenk_obj.value)!="")
	        {
		        var d=Trim(chenk_obj.value).substr(0,1);
	            if(str.indexOf(d)>-1)
	            {
		            chenk_title.innerHTML=Error_ImgDiv+Start_Div+"留言内容请填写中文！"+End_Div;
		            chenk_title.className="title_onblur_Error";
	            }
	            else
	            {
	              chenk_title.innerHTML=Ok_ImgDiv+Start_Div+"填写正确"+End_Div;
	            chenk_title.className="title_text";	
	            }
	        }
	        else
	        {
	           chenk_title.className="title_text";	
	        }
			break;
		case "EmailTB":
			    if(Trim(chenk_obj.value)!="" && check_email(Trim(chenk_obj.value))==false)
	            {
		            chenk_title.innerHTML=Error_ImgDiv+Start_Div+"请输入正确的email地址！"+End_Div;
		            chenk_title.className="title_onblur_Error";
	            }
	            else
	            { if (Trim(chenk_obj.value)!="")
	                {
	                    chenk_title.innerHTML=Ok_ImgDiv+Start_Div+"填写正确"+End_Div;
	                    chenk_title.className="title_text";	
	                }
	                else
	                {
	                    chenk_title.innerHTML="E-mail可收到电子版资料";
	                    chenk_title.className="title_text";	
	                }
	            }
			break;
		case "MobilePhoneTB":
		var phone = document.getElementById('TelephoneTB');
		var quhao_ = document.getElementById('QuHao');
		var phone_title = document.getElementById('title_TelephoneTB');
                if (Trim(quhao_.value)!="" && quhao_.value.substr(0,1)!=0)
                { 
                    phone_title.innerHTML=Error_ImgDiv+Start_Div+"区号的第一位必须为0！"+End_Div;
		            phone_title.className="title_onblur_Error";
                }
                else if(Trim(quhao_.value)!="" && Trim(quhao_.value).length<3 )
                {
                    phone_title.innerHTML=Error_ImgDiv+Start_Div+"请输入正确的区号！"+End_Div;
		            phone_title.className="title_onblur_Error";
                }
                else if(Trim(quhao_.value)!="" && isNaN(Trim(quhao_.value))==true)
                {
                    phone_title.innerHTML=Error_ImgDiv+Start_Div+"区号请输入数字！"+End_Div;
		            phone_title.className="title_onblur_Error";
                }
                else if( Trim(phone.value)!="" && isNaN(Trim(phone.value))==true)
	            {
	                phone_title.innerHTML=Error_ImgDiv+Start_Div+"电话号码必须为数字！"+End_Div;
		            phone_title.className="title_onblur_Error";
	            }
	            else if(Trim(phone.value)!="" && Trim(phone.value).length<6)
	            {
	                phone_title.innerHTML=Error_ImgDiv+Start_Div+"请输入正确的电话号码！"+End_Div;
		            phone_title.className="title_onblur_Error";
	            }
	            else if(Trim(chenk_obj.value)!="" && !isMobile(Trim(chenk_obj.value)))
	            {
	                chenk_title.innerHTML=Error_ImgDiv+Start_Div+"请输入正确的手机号码！"+End_Div;
		            chenk_title.className="title_onblur_Error";
	            }
	            else
	            {
	            phone_title.className="title_text";		
	                if ((Trim(phone.value)!="") && (Trim(quhao_.value)!=""))
                    {
	                    phone_title.innerHTML=Ok_ImgDiv+Start_Div+"填写正确"+End_Div;
                        phone_title.className="title_text";		
                    }
	                if (Trim(chenk_obj.value)!="")
	                {
	                    chenk_title.innerHTML=Ok_ImgDiv+Start_Div+"填写正确"+End_Div;
	                    chenk_title.className="title_text";	
	                }
	                else
	                {
	                    chenk_title.innerHTML="请尽量填写手机号码";
	                    chenk_title.className="title_text";	
	                }
	            }
			break;
	}
}
/**检查留言*/
function sheke(theForm)
{
//    if(isSubmited==true)
//    {
//        return(false);
//    }
//    else
//    {
    var Error_ImgDiv = "<div class='title_imgdiv' ><img src='/ly_form/img/Error_Lz.gif'/></div>";
    var Ok_ImgDiv = "<div class='title_imgdiv' ><img src='/ly_form/img/Ok_Lz.gif'/></div>";
	var Start_Div="<div style='float:left;width:178px;overflow:hidden;' >";
	var End_Div="</div>";
        var isError;
	    var str="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,./'[]{}`1234567890-=\~!@#$%^&*()_+|?><:";
	    if (Trim(theForm.LeavewordUserTB.value) =="")
	    {
		    alert("请输入姓名");
		    theForm.LeavewordUserTB.focus();
		    theForm.LeavewordUserTB.value="";
		    isError = true;
		    return(false);
	    }
	    var c=theForm.LeavewordUserTB.value.substr(0,1);
	    if(str.indexOf(c)>-1)
	    {
		    alert("姓名必须填写中文");
		    theForm.LeavewordUserTB.focus();
		    
		    isError = true;
		    return(false);
	    }
	     if (Trim(theForm.LeavewordUserTB.value).length<2)
	    {
		    alert("姓名不得少于2个字！");
		    theForm.LeavewordUserTB.focus();
		    isError = true;
		    return(false);
	    }
	    /**检查区号第一位是否为0*/
	    if (Trim(theForm.QuHao.value)!="" && theForm.QuHao.value.substr(0,1)!=0)
	    {
		    alert("区号的第一位必须为0");
            theForm.QuHao.value="";
		    theForm.QuHao.focus();
		    isError = true;
		    return(false);
	    }
	     if (Trim(theForm.QuHao.value)!="" && Trim(theForm.QuHao.value).length<3 )
	    {
		    alert("请输入正确的区号");
            theForm.QuHao.value="";
		    theForm.QuHao.focus();
		    isError = true;
		    return(false);
	    }
	   
	    if ( Trim(theForm.QuHao.value)!="" && isNaN(Trim(theForm.QuHao.value))==true )
	    {
		    alert("区号请输入数字");
            theForm.QuHao.value="";
		    theForm.QuHao.focus();
		    isError = true;
		    return(false);
	    }
	    if ( Trim(theForm.TelephoneTB.value)!="" && isNaN(Trim(theForm.TelephoneTB.value))==true)
	    {
		    alert("电话号码必须为数字");
             theForm.TelephoneTB.value="";
		    theForm.TelephoneTB.focus();
		    isError = true;
		    return(false);
	    }
	    if (Trim(theForm.TelephoneTB.value)!="" && Trim(theForm.TelephoneTB.value).length<6)
	    {
		    alert("请输入正确的电话号码");
             theForm.TelephoneTB.value="";
		    theForm.TelephoneTB.focus();
		    isError = true;
		    return(false);
	    }
	     if ( Trim(theForm.tel_son.value)!="" && isNaN(Trim(theForm.tel_son.value))==true)
	    {
		    alert("分机号码必须为数字");
		    theForm.tel_son.focus();
		    isError = true;
		    return(false);
	    }
	   
	   if (Trim(theForm.MobilePhoneTB.value)!="" && !isMobile(Trim(theForm.MobilePhoneTB.value)))
	   {
	        alert("请输入正确的手机号码");
	        theForm.MobilePhoneTB.value="";
		    theForm.MobilePhoneTB.focus();
		    isError = true;
		    return(false);
	   }
	  if ( (Trim(theForm.TelephoneTB.value)=="" && Trim(theForm.MobilePhoneTB.value)=="" )|| (Trim(theForm.QuHao.value)=="" && Trim(theForm.MobilePhoneTB.value)=="" ))
	    {
		    alert("必须留一种正确的联系方式，固定电话或手机");
            var phone_title = document.getElementById('title_TelephoneTB');
            phone_title.innerHTML = Error_ImgDiv+Start_Div+"必须留一种正确的联系方式！"+End_Div;
		    phone_title.className="title_onblur_Error";
		    theForm.QuHao.focus();
		    isError = true;
		    return(false);
	    }
	    if (Trim(theForm.QQTB.value)!="" && isNaN(Trim(theForm.QQTB.value))==true)
	    {
		    alert("QQ号码必须是数字");
		    theForm.QQTB.value="";
		    theForm.QQTB.focus();
		    isError = true;
		    return(false);
	    }
	    if(Trim(theForm.EmailTB.value)!="" && check_email(Trim(theForm.EmailTB.value))==false)
	    {
		    alert("请输入正确的email地址");
		    theForm.EmailTB.value="";
		    theForm.EmailTB.focus();
		    isError = true;
		    return(false);
	    }
	    if (Trim(theForm.AddressTB.value) =="")
	    {
		    alert("请输入详细地址");
		    theForm.AddressTB.focus();
		    isError = true;
		    return(false);
	    }
	    if (Trim(theForm.AddressTB.value).length<7)
	    {
		    alert("地址不得少于7个字！");
		    theForm.AddressTB.focus();
		    isError = true;
		    return(false);
	    }
	    var t=theForm.AddressTB.value.substr(0,1);
	    if(str.indexOf(t)>-1)
	    {
		    alert("地址必须填写中文");
		    theForm.AddressTB.value="";
		    theForm.AddressTB.focus();
		    isError = true;
		    return(false);
	    }
	    if (Trim(theForm.PostCodeTB.value).length<6)
	    {
		    alert("请输入邮编");
		    theForm.PostCodeTB.value="";
		    theForm.PostCodeTB.focus();
		    isError = true;
		    return(false);
	    }

	    if (isNaN(Trim(theForm.PostCodeTB.value))==true)
	    {
		    alert("邮编必需为6位数字");
		    theForm.PostCodeTB.value="";
		    theForm.PostCodeTB.focus();
		    isError = true;
		    return(false);
	    }
	    if (Trim(theForm.LeavewordTB.value)=="")
	    {
		    alert("请输入留言内容");
		    theForm.LeavewordTB.focus();
		    isError = true;
		    return(false);
	    }
	    var d=theForm.LeavewordTB.value.substr(0,1);
	    if(str.indexOf(d)>-1)
	    {
		    alert("留言内容请填写中文");
		    theForm.LeavewordTB.value = "";
		    theForm.LeavewordTB.focus();
		    isError = true;
		    return(false);
	    }
	     if (Trim(theForm.YanZhengNo.value)=="")
	    {
		    alert("请输入验证码！");
		    theForm.YanZhengNo.focus();
		    isError = true;
		    return(false);
		}
		try {
if (document.getElementById("lycookieid")) { document.getElementById("lycookieid").value = getF("0"); };
}
catch (e)
{

}
		
    //	    document.all["Button1"].disabled=true;
    //	    document.all["Button2"].disabled=true;

 var expdate = new Date();
//以下设置COOKIES时间为1天,自己随便设置该时间..

expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 1)); 
setCookie("LeavewordUserTB",CodeCookie(Trim(theForm.LeavewordUserTB.value)),expdate) 
setCookie("QuHao",Trim(theForm.QuHao.value),expdate) 
setCookie("TelephoneTB",Trim(theForm.TelephoneTB.value),expdate) 
setCookie("MobilePhoneTB",Trim(theForm.MobilePhoneTB.value),expdate) 
setCookie("QQTB",Trim(theForm.QQTB.value),expdate) 
setCookie("EmailTB",Trim(theForm.EmailTB.value),expdate) 
setCookie("AddressTB",CodeCookie(Trim(theForm.AddressTB.value)),expdate) 
setCookie("PostCodeTB",Trim(theForm.PostCodeTB.value),expdate) 
//setCookie("LeavewordTB",CodeCookie(Trim(theForm.LeavewordTB.value)),expdate) 
setCookie("LeaveWordEnd","0000",expdate) 
setCookie("LeaveWordEnd2","0000",expdate)  

var edate=new Date();
document.getElementById("endtime").value=GetDateStr();

var step=edate-sdate;
step=step/1000;
document.getElementById("steptime").value=parseInt(step);

	        theForm.submit();
	        
	          document.getElementById('ImgOk').style.display='none';
//    }
}
/**写Cookie*/
function setCookie(cookiename,cookievalue,cookieexpdate) 
  { 
  //alert(cookievalue);
  document.cookie = cookiename + "=" + cookievalue 
 // + "; domain="+ "www.qwqw.com"
  + "; path=" + "/" 
  + "; expires=" + cookieexpdate.toGMTString(); 
  } 
  /**翻译Cookie*/
 function DecodeCookie(str)
{
    var strArr;
    var strRtn="";
    strArr=str.split("|");
    try{
        for (var i=strArr.length-1;i>=0;i--)
        strRtn+=String.fromCharCode(eval(strArr[i]));
    }catch(e){
    }
    return strRtn; 
}
  /**编码Cookie*/
function CodeCookie(str)
{
    var strRtn="";
    for (var i=str.length-1;i>=0;i--)
    {
        strRtn+=str.charCodeAt(i);
        if (i) strRtn+="|"; //用a作分隔符 
    }
    return strRtn;
} 
  /**读Cookie*/
 function ReadCookie()
{

var str="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,./'[]{}`1234567890-=\~!@#$%^&*()_+|?><:";
 var Allgo=document.all;
var myCookie=document.cookie;
 //alert(myCookie); 
var cookieUserTB="LeavewordUserTB=";
var startUserTB =myCookie.indexOf (cookieUserTB);
var endstrUserTB = myCookie.indexOf(";", startUserTB);

if (startUserTB!=-1)
{
  Allgo.LeavewordUserTB.value=DecodeCookie(myCookie.substring(startUserTB+cookieUserTB.length,endstrUserTB)); 
	    var c= Allgo.LeavewordUserTB.value.substr(0,1);
	    if(str.indexOf(c)>-1)
	    {
		     Allgo.LeavewordUserTB.value="";
	    }
 } 
 
 var cookieQuHao="QuHao=";
var startQuHao =myCookie.indexOf(cookieQuHao);
var endstrQuHao = myCookie.indexOf(";", startQuHao);
if (startQuHao!=-1)
{
 //alert(myCookie);
  Allgo.QuHao.value=unescape(myCookie.substring(startQuHao+cookieQuHao.length,endstrQuHao));
  
  if (isNaN(Allgo.QuHao.value)==true )
	    {
            Allgo.QuHao.value="";
	    }
 } 
 var cookieTelephoneTB="TelephoneTB=";
var startTelephoneTB =myCookie.indexOf(cookieTelephoneTB);
var endstrTelephoneTB = myCookie.indexOf (";", startTelephoneTB);
if (startTelephoneTB!=-1)
{
 Allgo.TelephoneTB.value=unescape(myCookie.substring(startTelephoneTB+cookieTelephoneTB.length,endstrTelephoneTB));
  if (isNaN(Allgo.TelephoneTB.value)==true)
	    {
		   
             Allgo.TelephoneTB.value="";

	    }
	   
 
 } 
 
 var cookieMobilePhoneTB="MobilePhoneTB=";
var startMobilePhoneTB =myCookie.indexOf (cookieMobilePhoneTB);
var endstrMobilePhoneTB = myCookie.indexOf (";", startMobilePhoneTB);

if (startMobilePhoneTB!=-1)
{
 Allgo.MobilePhoneTB.value=unescape(myCookie.substring(startMobilePhoneTB+cookieMobilePhoneTB.length,endstrMobilePhoneTB));
 
  if (!isMobile(Allgo.MobilePhoneTB.value))
	   {
	        
	        Allgo.MobilePhoneTB.value="";
		 
	   }
   
 }  
  var cookieQQTB="QQTB=";
var startQQTB =myCookie.indexOf (cookieQQTB);
var endstrQQTB = myCookie.indexOf (";", startQQTB);

if (startQQTB!=-1)
{
 Allgo.QQTB.value=unescape(myCookie.substring(startQQTB+cookieQQTB.length,endstrQQTB));
 } 
 
  var cookieEmailTB="EmailTB=";
var startEmailTB =myCookie.indexOf (cookieEmailTB);
var endstrEmailTB = myCookie.indexOf (";", startEmailTB);

if (startEmailTB!=-1)
{
 Allgo.EmailTB.value=unescape(myCookie.substring(startEmailTB+cookieEmailTB.length,endstrEmailTB));

if(check_email(Allgo.EmailTB.value)==false)
	    {
		    
		    Allgo.EmailTB.value="";		
	    }

 } 
 
  var cookieAddressTB="AddressTB=";
var startAddressTB =myCookie.indexOf (cookieAddressTB);
var endstrAddressTB = myCookie.indexOf (";", startAddressTB);

if (startAddressTB!=-1)
{
 Allgo.AddressTB.value=unescape(DecodeCookie(myCookie.substring(startAddressTB+cookieAddressTB.length,endstrAddressTB)));
 
  var t=Allgo.AddressTB.value.substr(0,1);
	    if(str.indexOf(t)>-1)
	    {
		    Allgo.AddressTB.value="";

	    }
 
 } 
 
 var cookiePostCodeTB="PostCodeTB=";
var startPostCodeTB =myCookie.indexOf (cookiePostCodeTB);
var endstrPostCodeTB = myCookie.indexOf (";", startPostCodeTB);

if (startPostCodeTB!=-1)
{
 Allgo.PostCodeTB.value=unescape(myCookie.substring(startPostCodeTB+cookiePostCodeTB.length,endstrPostCodeTB));

if (isNaN(Allgo.PostCodeTB.value)==true)
	    {
		    
		    Allgo.PostCodeTB.value="";

	    }
 } 
 
//  var cookieLeavewordTB="LeavewordTB=";
//var startLeavewordTB =myCookie.indexOf (cookieLeavewordTB);
//var endstrLeavewordTB = myCookie.indexOf (";", startLeavewordTB);

//if (startLeavewordTB!=-1)
//{
// Allgo.LeavewordTB.value=unescape(DecodeCookie(myCookie.substring(startLeavewordTB+cookieLeavewordTB.length,endstrLeavewordTB)));
//  
//   var d=Allgo.LeavewordTB.value.substr(0,1);
//	    if(str.indexOf(d)>-1)
//	    {
//		   
//		    Allgo.LeavewordTB.value = "";

//	    }
// } 
 
}                               
                 
ReadCookie();
//document.write("<script language='javascript' type='text/javascript' src='http://open.txooo.com/open.aspx' ></script>");