﻿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" style="width:608px;height:570px;overflow:hidden;line-height:20px;margin:0 auto;color:#000000;background:#fff;">');
document.write('<div><img id="imgp400" src="http://img.txooo.com/Get400Number.ashx?u=' + url + '" /></div>');

document.write('<div class="con_1"><img src="/ly_form/img/ts.png" width="607" height="29" border="0" /></div>');

document.write('<div class="con_2" style="background:#ffffff;">');
document.write('<div id="hh_info" class="con_lef"></div>');
document.write('<div class="con_rig">');

document.write(' <form action="http://data.txooo.com/default.aspx?ly=ly&sn2009=3&tc=' + getspecailvar("tc") + '&iup=' + getspecailvar("iup") + '" method=post id=leavewordForm >');

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="lyformurl" name="lyformurl" value="" />');
document.write(" </div>");

document.write('   <ul>');
document.write("     <li><p>姓名：</p><p><input class='text' type='text' name='LeavewordUserTB' onblur='checkInput(\"LeavewordUserTB\");' size='30'  maxlength='6' onfocus='ChangeClass(\"LeavewordUserTB\");'  id='LeavewordUserTB' /></p><p class='red'>*</p><p>您的真实姓名,请使用中文</p></li>");
document.write("     <li><p>手机：</p><p><input class='text' name='MobilePhoneTB' size='30' maxlength='11' type='text'  id='MobilePhoneTB' onfocus='ChangeClass(\"MobilePhoneTB\");' onblur='checkInput(\"MobilePhoneTB\");'  /></p><p class='red'>*</p><p>请尽量填写手机号码</p></li>");
document.write('     <li><p>电话：</p><p>');
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='22' 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('</p><p class="red"></p><p>请正确填写联系座机</p></li>');
document.write("     <li><p>qq号：</p><p><input class='text' name='QQTB' size='30' type='text' id='QQTB' /></p><p class='red'></p><p></p></li>");
document.write("     <li><p>邮箱：</p><p><input class='text' name='EmailTB' size='30' type='text' id='EmailTB' onfocus='ChangeClass(\"EmailTB\");' onblur='checkInput(\"EmailTB\");' /></p><p class='red'></p><p>E-mail可收到电子版资料</p></li>");
document.write("     <li><p>地址：</p><p><input class='text' name='AddressTB' size='30'  type='text' id='AddressTB' onfocus='ChangeClass(\"AddressTB\");'  onblur='checkInput(\"AddressTB\");' /></p><p class='red'>*</p><p>请尽量详细填写</p></li>");
document.write("     <li><p>邮编：</p><p><input class='text' name='PostCodeTB' size='30' maxlength='6' type='text' id='PostCodeTB' onfocus='ChangeClass(\"PostCodeTB\");' onblur='checkInput(\"PostCodeTB\");'  /></p><p class='red'>*</p><p>请正确填写邮政编码</p></li>");
document.write("     <li class='heig_100'><p>留言：</p><p><textarea class='txt' name='LeavewordTB' id='LeavewordTB'  onblur='checkInput(\"LeavewordTB\");' onfocus='ChangeClass(\"LeavewordTB\");'></textarea></p><p class='red'>*</p><p>请您认真详细填写留言</p></li>");
      
document.write("     <li class='pad_lef'><p>验证码：</p><p class='red'>*</p><p><input class='text_0' name='YanZhengNo' size='10' maxlength='4' type='text' id='YanZhengNo' /></p>");
document.write("     <p><img src='http://data.txooo.com/updata.aspx?yanzheng=44' border='0' onclick='ChangeCode()' alt='看不清点击换一张！'  align='absbottom' id='checkcode'></p><p class='f12'><a onclick='ChangeCode()' style='cursor:hand; text-decoration:underline;'>看不清换一张</a></p></li>");
document.write('     <li class="pad_lef">');
document.write("       <input class='but_0' type='button' value='提 交'  id='ImgOk' onclick=\"sheke(document.getElementById('leavewordForm'));\" /><input class='but_1' type='button' onclick=\"document.getElementById('leavewordForm').reset();\" value='重 填' />");
document.write('     </li>');
document.write('   </ul>');
document.write(' </form>');
document.write(' </div>');
document.write('</div>');
document.write('</div>');


document.write('<style type="text/css">');
document.write('#ly_div div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, code, form, fieldset, legend, input, button, textarea, p, blockquote, th, td {margin:0;padding:0;}');
document.write('#ly_div table {border-collapse:collapse;border-spacing:0;}');
document.write('#ly_div li {list-style:none;}');
document.write('#ly_div img, fieldset,iframe {border:0;}');
document.write('#ly_div input, button, textarea, select {font-family:inherit;font-size:inherit;font-weight:inherit;*font-size:100%;}');
document.write('#ly_div input, select{vertical-align:middle}');
document.write('#ly_div em{font-style:normal;}');
document.write('#ly_div a{color:#000;text-decoration:none;}');
document.write('#ly_div a:hover{color:#f00;text-decoration:underline}');

document.write('#ly_div li {list-style:none;}');
document.write('#ly_div .clear{-zoom:1;clear:both;overflow:hidden}');
document.write('#ly_div .clear:after{content:".";display:block;height:0;clear:both;}');
document.write('#ly_div .clear_{clear:both;height:0;overflow:hidden}');
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 .con_0{border:1px solid #fe4300;height:130px;overflow:hidden;background:#ffffff;}');
document.write('#ly_div .con_0 .pic{float:left;height:130px;width:44px}');
document.write('#ly_div .con_0 .text{background:#fdf3ea;float:left;font-size:12px;height:100px;padding-top:11px;margin:8px 0 0 8px;width:543px}');
document.write('#ly_div .con_0 .text li{color:#7a7675;height:30px;line-height:30px;margin:0 auto;width:520px}');
document.write('#ly_div .con_0 .text li em{color:#5a6e86;padding:0 5px;}');
document.write('#ly_div .con_0 .text li span{float:right}');
document.write('#ly_div .con_0 .text li.back{color:#000; text-indent:25px;overflow:hidden;}');
document.write('#ly_div .con_1{margin:15px 0 10px 0;overflow:hidden;width:608px;background:#ffffff;}');
document.write('#ly_div .con_2{padding-left:2px}');

document.write('#ly_div .con_lef{border:1px solid #fe4202;float:left;height:316px;margin-right:10px;width:166px;background:#ffffff;text-align:left;}');
document.write('#ly_div .con_lef .nav{background:url(/ly_form/img/bj_2.jpg) no-repeat;height:43px;margin-bottom:10px;border: 0;padding: 0;width:166px}');
document.write('#ly_div .con_lef .nav_{background:url(/ly_form/img/bj_2_.jpg) no-repeat;height:43px;margin-bottom:10px;width:166px}');
document.write('#ly_div .con_lef p{color:#ff6000;font-size:14px;font-weight:700;text-indent:25px;line-height:22px;margin:0 auto;width:140px}');

document.write('#ly_div .con_lef p.bor000{border:1px solid #ccc;color:#000;font-size:12px;font-weight:100;text-indent:0px;line-height:22px;margin:0 auto;padding-left:3px;width:137px}');
document.write('#ly_div .con_lef p.ffd738{border:1px solid #ffd738;background:#fff9e3;color:#000;font-size:12px;font-weight:100;text-indent:0px;line-height:22px;margin:0 auto;padding-left:3px;width:137px}');
document.write('#ly_div .con_lef p.red{color:red;font-size:14px;font-weight:700;text-indent:0px;line-height:22px;margin:0 auto;width:137px}');
document.write('#ly_div .con_lef p span{font-size:14px;font-weight:100;text-indent:0px;line-height:20px;margin:0 auto;width:137px}');
document.write('#ly_div .con_lef p span.red_{color:red;font-size:12px;font-weight:100;text-indent:0px;line-height:22px;margin:0 auto;width:137px}');

document.write('#ly_div .con_lef p.green{color:green;font-size:14px;font-weight:700;text-indent:0px;line-height:22px;margin:0 auto;width:137px}');
document.write('#ly_div .con_lef p.b000{color:#000;font-size:12px;font-weight:100;text-indent:0px;line-height:22px;margin:0 auto;width:137px}');
document.write('#ly_div .con_lef p.b000_{background:url(/ly_form/img/nav_xia.jpg) right center no-repeat;color:#000;font-size:12px;font-weight:100;text-indent:0px;line-height:22px;margin:0 auto;width:137px}');
document.write('#ly_div .con_lef p.b000_ span{color:red;font-size:12px;font-weight:700}');

document.write('#ly_div .con_lef li{background:url(/ly_form/img/phone.jpg) left no-repeat;margin:0 auto 3px auto;padding-left:20px;overflow:hidden;width:120px}');
document.write('#ly_div .con_lef li input.text{border:1px solid #c0c0c0;width:118px}');

document.write('#ly_div .con_lef li.padd_0{padding-left:0px;width:140px;}');
document.write('#ly_div .con_lef li.padd_0 .butt{background:url(/ly_form/img/btn_phone.jpg) left no-repeat;border:0;margin:0 auto;height:22px;overflow:hidden;width:140px;cursor:pointer}');
document.write('#ly_div .con_lef li.padd_0 .fanhui{background:url(/ly_form/img/bj_5.jpg) no-repeat;border:0;color:#fff;font-size:14px;font-weight:700;float:left;text-align:center;height:28px;line-height:28px;width:72px;cursor:pointer}');

document.write('#ly_div .con_rig{float:left;width:427px;background:#ffffff;}');
document.write('#ly_div .con_rig .pic{height:26px;padding-left:26px;margin-bottom:10px;width:396px}');
document.write('#ly_div .con_rig li{height:22px;line-height:22px;font-size:14px;overflow:hidden}');
document.write('#ly_div .con_rig li.heig_100{height:100px}');
document.write('#ly_div .con_rig li.pad_lef{height:28px;padding-left:40px}');
document.write('#ly_div .con_rig li p{float:left;margin:0; color: #000000;text-indent:0}');
document.write('#ly_div .con_rig li p.red{color:red;display:block;text-align:center;width:20px}');
document.write('#ly_div .con_rig li p.f12{font-size:12px;padding:0 2px}');
document.write('#ly_div .con_rig li p input.text{border:1px solid #939b9e;background:url(/ly_form/img/bj_3.jpg) left repeat-x;height:17px; font-size:13px;padding:0;margin:2px 0 0 0;width:200px}');
document.write('#ly_div .con_rig li p input.text_0{border:1px solid #939b9e;background:url(/ly_form/img/bj_3.jpg) left repeat-x;height:17px;font-size:13px;padding:0;margin:0 5px 0 0;width:50px}');
document.write('#ly_div .con_rig li p textarea.txt{border:1px solid #939b9e;height:96px;width:200px}');
document.write('#ly_div .con_rig input.but_0{background:url(/ly_form/img/bj_4.jpg) no-repeat;border:0;color:#fff;font-size:14px;font-weight:700;float:left;text-align:center;height:28px;line-height:28px;margin-right:15px;width:72px;cursor:pointer}');
document.write('#ly_div .con_rig input.but_1{background:url(/ly_form/img/bj_5.jpg) no-repeat;border:0;color:#fff;font-size:14px;font-weight:700;float:left;text-align:center;height:28px;line-height:28px;width:72px;cursor:pointer}');
document.write('</style>');
//document.write('<script language="javascript" src="/ly_form/LyInfo.aspx?u=' + url + '" charset="gb2312"></script>');
document.write('<script language="javascript" src="/ly_form/HHInfo.aspx?u=' + url + '" charset="gb2312"></script>');


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;
    }
}
document.getElementById("lyformurl").value = encodeURI(escape(document.location.href));

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 isMobile(s) {
    var regu = "^([1])([3,4,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) {
   
}
//逐个检查
function checkInput(obj) {
   
}
/**检查留言*/
function sheke(theForm) {
   
    var Error_ImgDiv = "<div class='title_imgdiv' ><img src='http://618.txooo.com/img/Error_Lz.gif'/></div>";
    var Ok_ImgDiv = "<div class='title_imgdiv' ><img src='http://618.txooo.com/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("必须留一种正确的联系方式，固定电话或手机");
       
        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);
    }

    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';
}


