﻿//名称 编号 类别
var url = location.pathname; //当前url
var urlSearch = "/Search.aspx";
////s 当前是不是检索页面；
var s = true;
if (url != urlSearch) {
    s = false;
}



//判断是不是检索页面 否则跳转到检索页面
function usersearch(sname, sn, st) {
    var sname = $(sname).text();
    // alert(url);
    if (!s) {
        setTimeout(function() {
            window.location.href = "" + urlSearch + "?sn=" + sn + "&st=" + st + "&sname=" + escape(sname) + "&tj=flase";
        }, 0);


    }
}
function search(event) {
    //alert("aa");
    // alert(s);
    //  window.location.replace("http://www.51js.com");

    //    if ($.browser.msie) {
    //window.event.returnValue = false;
    //    }
    //    else {
    $("form").submit(function() {
        return false;
    });
    //    }
    var stype = $("#selType").val();
    //alert(stype);
    var item = $("input[@name=abc]:checked").val();
    // alert(item);

    if (item == "1") {
        if ($("#inputKey").val() != "") {
            window.location.href = "" + urlSearch + "?key=" + escape($("#inputKey").val()) + "&tj=true";
        }
    }
    else if (item == "2") {
        if ($("#inputKey").val() != "") {
            window.location.href = "" + urlSearch + "?key=" + escape($("#inputKey").val()) + "&keytype=2&tj=true";
        }
    }

    // var item = $('input[@name=abc][@checked]').val();

}
$(document).ready(function() {
    $('#inputKey').bind('keyup', function(event) {
        if (event.keyCode == "13") {
            search();
        }
    });
})


