﻿//<![CDATA[
$(function() {

    $("#image1").click(function() {
        var temp = Math.random();
        document.getElementById("image1").src = "Code.aspx?id=" + temp;
    })
    $("#luoye2 .Obtn2").click(function() {
        $("#faqbg").css({ "display": "block", "height": 950, "filter": "alpha(opacity=30)" });
       $("#luoye2").css({ "display": "block", "height": "$(document).height()", "filter": "alpha(opacity=30)" });
        $("#js").attr("id", "js2");
        $("#faqdiv").css("top", "100px");
        $("#faqdiv").css("display", "block");
        $("#txtphone").focus();

    });

    $(".footer #amsg").click(function() {

    $("#faqbg").css({ "display": "block", "height": 950, "filter": "alpha(opacity=30)" });
        $("#luoye2").css({ "display": "block", "height": "$(document).height()", "filter": "alpha(opacity=30)" });
        $("#js").attr("id", "js2");
        $("#faqdiv").css("top", "100px");
        $("#faqdiv").css("display", "block");
        $("#txtphone").focus();
    });

    $("#ImageButton1").click(function() {
        reg = /^(\d{3,4}\-)?[1-9]\d{6,10}$/;
        if ($("#txtphone").val() == "") {
            alert("输入电话号码!");
            $("#txtphone").focus();
            return false;
        }
        if (!reg.test($("#txtphone").val())) {
            alert("请输入正确的电话号码!");
            $("#txtphone").focus();
            return false;
        }

        reg = /^\w{3,}@\w+(\.\w+)+$/;
        if ($("#txtmail").val() == "") {
            alert("请输入邮箱!");
            $("#txtmail").focus();
            return false;
        }
        if (!reg.test($("#txtmail").val())) {
            alert("请输入正确的邮箱!");
            $("#txtmail").focus();
            return false;
        }

        if ($("#txtcont").val() == "") {
            alert("请输入建议!");
            $("#txtcont").focus();
            return false;
        }
        alert("留言成功");
    });

    $("#ImageButton2").click(function() {
        reg = /^(\d{3,4}\-)?[1-9]\d{6,10}$/;
        if ($("#txtCall").val() == "") {
            alert("请输入电话号码!");
            $("#txtCall").focus();
            return false;
        }
        if (!reg.test($("#txtCall").val())) {
            alert("请输入正确的电话号码!");
            $("#txtCall").focus();
            return false;
        }

        reg = /^[-+]?\d{4}$/;
        if ($("#txt_inputCheckword").val() == "") {
            alert("请输入验证码!");
            $("#txt_inputCheckword").focus();
            return false;
        }
        if (!reg.test($("#txt_inputCheckword").val())) {
            alert("验证码不正确!");
            $("#txt_inputCheckword").focus();
            return false;
        }
    })

    $("#close").click(function() {
        $("#faqdiv").css("display", "none");
        $("#js2").attr("id", "js");
        $("#faqbg").css("filter", "alpha(opacity=100)");
        $("#luoye2").css("filter", "alpha(opacity=100)");
        document.body.style.height = "115%";
    });
})
//]]>
