<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">$(function () {
    // $('.pro-class-tit').hover(function () {
    //     var ps = $(this).position();
    //     $('.pro-class').show().css({ 'top': ps.top + $(this).height(), left: ps.left });
    // }, function (e) {
    //     if ($(e.relatedTarget).closest('.pro-class').size() == 0) {
    //         $('.pro-class').hide();
    //     }
    // });

    /*****change Area交互效果*******/
    var changeAreaTime;
    $(".changeArea span").click(function () {
        $(".changeArea").css("position", "relative");
        $(".changeArea-dialog").css("display", "block");
        $(".changeArea-dialog").show();
    });
    $("#btn-addFavourite").click(function () {
        $(".changeArea").css("position", "static");
        $(".changeArea-dialog").hide();
    });
    
    $("#AreaIdInfo li").click(function () {
        
        AreaID = $(this).val();
        if (document.location.href.indexOf("/suppliers") &gt; -1) {
            searchsuppliers_url("");
        }else{
            search_url("");
        }
    });

    $("#btn-Confirm").click(function () {
        AreaID = $("#selectEarthArea").val();
        if (document.location.href.indexOf("/suppliers") &gt; -1) {
            searchsuppliers_url("");
        } else {
            search_url("");
        }
    });


    $("#Certification-reset").click(function () {
        $("[name='Certification']").removeAttr("checked"); 
        //search_url("");
    });
    $('.click-tit').mousemove(function () {
        $('.suppliers-mod .Select-Attr').each(function () {
            $(this).parent().find("span").removeClass('cf60');
            $(this).parent().find("h3 i").remove();
            $(this).parent().find("h3").append('&lt;i class="icon icon-down-arrow"&gt;&lt;/i&gt;');
            $(this).hide();
        });
        $('.suppliers-mod .suppliers-attr').each(function () {
            $(this).parent().find("span").removeClass('cf60');
            $(this).parent().find("h3 i").remove();
            $(this).parent().find("h3").append('&lt;i class="icon icon-down-arrow"&gt;&lt;/i&gt;');
            $(this).hide();
        });
        var o = $(this);
        o.find("span").toggleClass('cf60');
        o.find("i").remove();
        o.next(".categories-list").toggle();
    });

    $(".js_suppliers-side").mouseleave(function () {
        $('.suppliers-mod .Select-Attr').each(function () {
            $(this).parent().find("span").removeClass('cf60');
            $(this).parent().find("h3 i").remove();
            $(this).parent().find("h3").append('&lt;i class="icon icon-down-arrow"&gt;&lt;/i&gt;');
            $(this).hide();
        });
    });


    if ($(".click-tit").length &gt; 0) {
        $($(".click-tit").get(0)).click();
    }
    $('.select_products_categories li').click(function () {
        if (cid &gt; 0)
            {
        var ps = $('.pro-class-tit').position();
        $('.pro-class').show().css({ 'top': ps.top + $('.pro-class-tit').height(), left: ps.left });
        }
    });

    $('#pro-class a,#pro-class1 a').click(function () {
        click_category($(this).attr('href'));
        return false;
    });

    $('#Certification-confirm').click(function () {
        search_url("0");
    });

    $(".js_certification-list").click(function () {
        searchsuppliers_url("0");
    });

    if (CertificationList != "0" &amp;&amp; CertificationList.length &gt; 1) {
        var temp_CertificationList = CertificationList + ",";
        $('.certification-list [type=checkbox]:checkbox').attr('checked', false);
        $(".certification-list [type=checkbox]:checkbox").each(function() {
            if (temp_CertificationList.indexOf($(this).val()+",") &gt; -1) {
                $(this).attr('checked', true);
            }
        });
    }
    if (CertificationList == "0") {
        $('.certification-list [type=checkbox]:checkbox').attr('checked', false);
    }

    $('.select_attr').click(function () {
        $(this).removeClass('select_attr');
        search_url("0");
    });

    $('.suppliers-attr li').click(function () {
        $(this).addClass('select_Suppliersattr');
        searchsuppliers_url("0");
    });

    $('#Suppliers-Certification-confirm').click(function () {
        searchsuppliers_url("0");
    });
    $('#Suppliers-Certification-reset').click(function () {
        $("[name='Certification']").removeAttr("checked"); 
        //searchsuppliers_url("");
    });

    $('.select_Suppliersattr').click(function () {
        $(this).removeClass('select_Suppliersattr');
        searchsuppliers_url("0");
    });

    $("#CertificationList li").click(function () {
        search_url(0);
    });


    $('.certification-list li').each(function () {  
        var o = $(this).find("input");
        if (o.attr('checked') == "checked") {
            var li_index = $(this).index();
            for (var i = 1; i &lt;= li_index; i++) {
                var Before_o = $($('.certification-list li').get(li_index-i));
                if (Before_o.find("input").attr('checked') == "checked") {
                    i = li_index;
                } else {
                   Before_o.insertAfter($(this));
                }
            }
        }
    });
    
});

function GetGoodsAttributeValues(Attrid) {
    var AttrValues_html = "";
    var datas = '{ID:' + Attrid + '}';
    $.ajax({
        type: "POST",
        contentType: "application/json",
        dataType: 'json',
        url: "/Services/GoodsAttributeService.asmx/GetGoodsAttributeValues",
        data: datas,
        cache: false,
        success: function (data) {
            if (data["d"]["Success"] == true) {
                if (data["d"]["Info"] != "[]") {
                    var html = "";
                    $(eval('(' + data["d"]["Info"] + ')')).each(function () {
                        html += '&lt;li name="attr' + Attrid + '" value="' + this.id + '"&gt;' + this.name + '&lt;/li&gt;';
                    });
                    $('#Attr_ur_' + Attrid).html(html);
                    $('#Attr_ur_' + Attrid + ' li').click(function () {
                        $(this).addClass('select_attr');
                        search_url("0");
                    });
                }
            }
        },
        error: function (data) {
        }
    });

}

function GetAttrValue(Attrid, Valueid) {
    var datas = '{ID:' + Valueid + '}';
    $.ajax({
        type: "POST",
        contentType: "application/json",
        dataType: 'json',
        url: "/Services/GoodsAttributeService.asmx/GetAttrValue",
        data: datas,
        cache: false,
        success: function (data) {
            if (data["d"]["Success"] == true) {
                if (data["d"]["Info"] != "[]") {
                    var html = "";
                    $(eval('(' + data["d"]["Info"] + ')')).each(function () {
                        $('#GetAttrValue' + Valueid).html(this.name);
                    });
                }
               
            }
        },
        error: function (data) {
        }
    });

}

function searchsuppliers_url(ce) {
    keyword_url = escape($('.search-text').val());
    var temp_url = "/suppliers/index.html?key=" + keyword_url + "&amp;areaid=" + AreaID;
    if (ce == "0")
    {
            $("input[name=Certification]").each(function() {
                if ($(this).attr("checked")) {
                    ce += "," + $(this).val();
                }
            });
        temp_url += "&amp;CertificationList=" + ce;
    }

    jQuery('.select_Suppliersattr').each(function () {
            temp_url += "&amp;" + $(this).attr("name") + "=" + $(this).attr("value");
        });
    document.location = temp_url;
}

function search_url(ce) {
    var temp_url = "/products/" + cid + "/" + c_url + ".html?";

    if (cid == 0) {
        temp_url = "/products/index.html?";
    }

    temp_url += "areaid=" + AreaID;

    if (cid == 0) {
        keyword_url = escape($('.search-text').val());
        temp_url += "&amp;key=" + keyword_url;
    }
    if (ce == "0")
    {
        $("input[name=Certification]").each(function () {
            if ($(this).attr("checked")) {
                ce += "," + $(this).val();
            }
        });
        temp_url += "&amp;CertificationList=" + ce;
    }
    
    jQuery('.select_attr').each(function () {
        temp_url += "&amp;" + $(this).attr("name") + "=" + $(this).attr("value");
    });

    if (jQuery('#SortANDView .icon-sort-on').length &gt; 0) {
        temp_url += "&amp;sorttype=1";
    }
    if (jQuery('#SortANDView .icon-star-on').length &gt; 0) {
        temp_url += "&amp;sorttype=2";
    }
    if (jQuery('#SortANDView .icon-imgMode-on').length &gt; 0) {
        temp_url += "&amp;showtype=1";
    }
    
    document.location = temp_url;
}</pre></body></html>