$(function () {
    //加载栏目
    var getsearch_catidshopping_static=false;
    if($('#catidshopping').length >0){
        if (!getsearch_catidshopping_static){
            //加载栏目下拉
            var getsearch_catid_url='./index.php?case=archive&act=getsearch_catid&ajax=1&shopping='+public_shopping;
            getsearch_catid_url+='&catid='+search_catid;
            getsearch_catid_url+='&this_catid='+search_catid;
            $.ajax({
                type: "get",
                url: getsearch_catid_url,
                async: true,
                success: function (data) {
                    $('#catidshopping').html(data);
                    getsearch_catidshopping_static=true;
                }
            });
        }
    };
    var getsearch_catid_static=false;
    if($('#parentid').length >0){
        if (!getsearch_catid_static){
            //加载栏目下拉
            var getsearch_catid_url='./index.php?case=archive&act=getsearch_catid&ajax=1&shopping='+public_shopping;
            getsearch_catid_url+='&catid='+search_catid;
            getsearch_catid_url+='&this_catid='+search_catid;
            $.ajax({
                type: "get",
                url: getsearch_catid_url,
                async: true,
                success: function (data) {
                    $('#parentid').html(data);
                    getsearch_catid_static=true;
                }
            });
        }
    };

    $("#parentid").change(function () {
        get_field($("#parentid").val());
    });
    $("#catidshopping").change(function () {
        get_field($("#catidshopping").val());
    });
});
