$(function () {

    //页面控件调用
    var $keytext = $("#keySerach_txt");
    var $keybtn = $("#keySerach_Btn");

    //Tag筛选
    $keybtn.click(function () {
        if ($keytext.val() != "") {
            location.href = $(this).attr("rel") + "?key=" + $keytext.val() + "";
        } else {
            location.href = $(this).attr("rel");
        }
        return false;
    });

    //删除Tag
    $("a[rel='del']").click(function () {
        var $delObject = $(this);
        if (confirm("确定要删除 [ " + $delObject.attr("rev") + " ] 吗？")) {
            $.ajax({
                type: "POST",
                url: "Ajax/Tag.ashx",
                data: { 'com': 'deltag', 'tagname': $delObject.attr("rev"), 'tagid': $delObject.attr("href") },
                datatype: "json",
                beforeSend: function (data, textStatus) {
                    showMsg("[ " + $delObject.attr("rev") + " ] 正在删除中 ", true);
                },
                success: function (data, textStatus) {
                    if (data == "1") {
                        $delObject.parent().parent("tr").remove();
                    } else {
                        alert("删除失败!");
                    }
                    showMsg("", false);
                },
                error: function (e) { alert("连接失败,请向Eoyoo官方技术人员反馈!"); }
            })
        }
        return false;
    });

});