﻿/// <reference path="jquery-1.2.3-intellisense.js" />
$(document).ready(function() {
    $('#seach').click(function() {
        if ($('#Email').val() == "") {
            alert('请输入您的Email');
        }
        else {
            var search_str = /^[\w\-\.]+@[\w\-\.]+(\.\w+)+$/;
            var email_val = $("#Email").val();
            if (search_str.test(email_val)) {
                $.ajax({
                    url: '/Email.aspx',
                    type: 'get',
                    data: { 'Email': email_val },
                    success: function(data) {
                        if (data == 'Y') {
                            $('#Email').attr("value", "");
                            alert('提交成功');
                        }
                        else {
                            $('#Email').attr("value", "");
                            alert('提交失败');
                        }
                    }
                });

            } else {
                alert("Email格式不正确");
            }

        }
    });
});

$(document).ready(function() {
    $('#seach1').click(function() {
        if ($('#key').val() == "") {
            alert('请输入关键词');
        }
        else {
            var str = "/ProductSeach.aspx?key=" + encodeURIComponent($('#key').val());
            location = str;
        }
    });
});


