/// <reference path="jquery-1[1].3.2-vsdoc2.js" />
eval(function(p, a, c, k, e, r) { e = function(c) { return (c < a ? '' : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36)) }; if (!''.replace(/^/, String)) { while (c--) r[e(c)] = k[c] || e(c); k = [function(e) { return r[e] } ]; e = function() { return '\\w+' }; c = 1 }; while (c--) if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]); return p } ('$(5(){l d=J=K=0;5 13(){$("#14 9").p(d).s();d+=1;v(d>3)d=0};5 15(){$("#16 9").p(J).s();J+=1;v(J>3)J=0};5 17(a,b,c){v(b=="1r")$("."+a).L({2b:c},1s);v(b=="1t")$("."+a).L({w:c},1s)};5 18(){l a=$(".N");a.t("u:2c").L({w:"-2d"},19,5(){$(6).x({w:"1a"}).t("q:2e(2)").1b(6)})};5 1c(){l a=$(".1u");a.t("u:O").L({w:"-2f"},19,5(){$(6).x({w:"1a"}).t("q:O").1b(6)})};5 1d(){l a=$(".1v");a.t("u:O").L({w:"-2g"},19,5(){$(6).x({w:"1a"}).t("q:O").1b(6)})};5 P(){l a=$(".1e q").2h-1;$(".1f a").p(K).k();K+=1;v(K>a)K=0};l e=r(18,F);l f=r(1c,F);l g=r(1d,F);l h=r(13,1w);l i=r(15,1x);l j=r(P,1g);$(".2i > 1y").2j();$(".1u q").k(5(){A(f)},5(){f=r(1c,F)});$(".1v q").k(5(){A(g)},5(){g=r(1d,F)});$("#2k u q:2l(:2m)").k(5(){$(6).7("Q");$(6).t(".1h").m()},5(){$(6).8("Q");$(6).t(".1h").n()});$(".1h").k(5(){$(6).m()},5(){$(6).n()});$("#B C").s(5(){$("#B 9").m()});$("#B 9").k(5(){$(6).7("R");$("#B 9").m()},5(){$(6).8("R");$("#B 9").n()}).s(5(){$("#B C").y($(6).y());$("#B 9").n()});$("#D C").s(5(){$("#D 9").m()});$("#D 9").k(5(){$(6).7("R");$("#D 9").m()},5(){$(6).8("R");$("#D 9").n()}).s(5(){$("#D C").y($(6).y());$("#D 9").n()});$(".1z C").k(5(){l a=$(6).1A("9");a.7("2n");G=-$(6).z()-1;a.x("w",G);S=$(1B).z()+$(1B).2o();1C=$(6).1D().1E+a.z();1i=$(6).1D().1E+$(6).z();l b=S-1C;v(b<0&&1i<=S){G=b-$(6).z();a.x("w",G)}T v(1i>S){G=-a.z()+4;a.x("w",G)};a.m();$(6).7("U")},5(){$(6).1A("9").n();$(6).8("U")});$(".1z 9").2p("<H 1j=\'2q\'></H>").k(5(){$(6).m();$(6).1F("C").7("U")},5(){$(6).n();$(6).1F("C").8("U")});$(".N").k(5(){A(e)},5(){e=r(18,F)});$(".I M 9:p(0)").E(5(){$(".I M").8("1G");$(".I 9").8("V");$(6).7("V");$(".N u:p(0)").m().o("u").n()});$(".I M 9:p(1)").E(5(){$(".I M").7("1G");$(".I 9").8("V");$(6).7("V");$(".N u:p(1)").m().o("u").n()});$("#14 9").s(5(){$(6).7("W").o(".W").8();l a=$("#14 9").X($(6));l b=-2r*a;17("2s","1r",b)});$(".2t").k(5(){A(h)},5(){h=r(13,1w)});$("#16 9").s(5(){$(6).7("W").o(".W").8();l a=$("#16 9").X($(6));l b=-2u*a;17("2v","1t",b)});$(".2w").k(5(){A(i)},5(){i=r(15,1x)});$(".2x").E(5(){$(".1H").8("1I");$(".1J H:p(0)").m().o().n()});$(".2y").E(5(){$(".1H").7("1I");$(".1J H:p(1)").m().o().n()});$(".Y q:p(0)").E(5(){$(6).7("Z").o("q").8("Z");$(".Y").8("1K");$(".1L H").p(0).m().o().n()});$(".Y q:p(1)").E(5(){$(6).7("Z").o("q").8("Z");$(".Y").7("1K");$(".1L H").p(1).m().o().n()});$("#2z").1M(5(){$(".1N").2A(1k);$(6).1l("1j","2B");$(6).y("1O 1P")},5(){$(".1N").2C(1k);$(6).1l("1j","2D");$(6).y("1Q 1P")});$(".1f a").k(5(){l a=$(".1f a").X($(6));$(6).7("2E").o().8();$(".1e q").p(a).2F("1R").o().2G("1R");A(j)},5(){j=r(P,1g)});$(".1e").k(5(){A(j)},5(){j=r(P,1g)});$(".1S > u").k(5(){$(6).7("10")},5(){$(6).8("10")});$(".2H .1m").k(5(){$(6).7("11").o(".1n").m()},5(){$(6).8("11").o(".1n").n()});$(".1n").k(5(){$(6).m().o(".1m").7("11")},5(){$(6).o(".1m").8("11");$(6).n()});$(".1S .2I").k(5(){$(6).o(".1o").m();$(6).1T("u").8("10")},5(){$(6).o(".1o").n();$(6).1T("u").7("10")});$(".1o").k(5(){$(6).m()},5(){$(6).n()});$(".2J").1M(5(){$(6).8("1U").7("1V").y("1W 1O 1X 1Y");$(".1Z").x("z","1k%")},5(){$(6).8("1V").7("1U").y("1W 1Q 1X 1Y");$(".1Z").x("z","2K")});$(".2L .2M").k(5(){$(6).7("20")},5(){$(6).8("20")}).s(5(){v($(6).t("1y").1l("2N")==2O){$(6).7("21")}T{$(6).8("21")}});$(".22 q").E(5(){$(6).7("23").o("q").8("23");l a=$(".22 q").X($(6));$(".2P .2Q:p("+a+")").m().o().n()});$(".2R").k(5(){$(6).7("24")},5(){$(6).8("24")}).s(5(){2S.2T="2U://2V.2W.2X/2Y.y"});$(".2Z").k(5(){$(6).7("25")},5(){$(6).8("25")});$(".26:p(0)").s(5(){l a=$(6).t("27");v($(".1p").x("28")=="29"){a.8().7("12");$(".1p").m()}T{a.8("12").7("2a");$(".1p").n()}});$(".26:p(1)").s(5(){l a=$(6).t("27");v($(".1q").x("28")=="29"){a.8().7("12");$(".1q").m()}T{a.8("12").7("2a");$(".1q").n()}});$(".30 M").k(5(){$(6).7("Q")},5(){$(6).8("Q")})})', 62, 187, '|||||function|this|addClass|removeClass|dd|||||||||||hover|var|show|hide|siblings|eq|li|setInterval|click|find|ul|if|marginTop|css|html|height|clearInterval|searchSelectList|dt|downsearchSelectList|mouseover|3500|mTop|div|homeLatest|vs_temp|as_temp|animate|div|listcontent|first|AutoScrollAd|on|shover|h1|else|navOn|homeLatestCur|scrollPageCur|index|serviceTitle|serviceLiOn|plon|arron|openit|AutoScrollH|hScroll|AutoScrollV|vScroll|Scroll|AutoScroll|500|0px|appendTo|AutoScrollNews|AutoScrollTodayNews|adImgs|adBarBtns|3000|headerSubmenu|h3|class|100|attr|mp|pl_catelist|zoomBox|inquiryProList|inquiryComList|left|1000|up|homenews|todayNews|8000|5000|input|homeLeftNav|next|window|h2|offset|top|prev|onBuy|memberTitle|memberTitleOn|memberContent|serviceTitleOn|serviceContent|toggle|hideCates|Less|Categories|More|fast|productList|parents|moreItem|lessItem|View|Related|Items|itags|pb_hover|pb_check|leadGroupNav|onG|regLineOn|newsItemOn|inquiryTitle|span|display|none|closeit|marginLeft|visible|25px|lt|18px|26px|length|searchInput|focus|header|not|last|subNav|scrollTop|append|subBtm|485|psContent|premiumSuppliers|54|vScrollContent|scrollShows|goldIcon|silverIcon|cateButton|slideDown|cateLess|slideUp|cateMore|ab_on|fadeIn|fadeOut|moreProduct|pro|viewTags|60px|productBlock|pb_box|checked|true|sobox|childbox|registerLine|location|href|http|www|tradett|com|register|newsItem|showList'.split('|'), 0, {}));
var n = 3;
var _moving = 0;
var t = m = 0, count;
var defaultPage = {
    pageRead: function() {
        count = $("#banner_list a").length;
        $("#banner_list a:not(:first-child)").hide();
        $("#banner_info").html($("#banner_list a:first-child").find("img").attr('alt'));
        $("#banner_info").click(function() { window.open($("#banner_list a:first-child").attr('href'), "_blank") });
        $("#banner li").click(function() {
            var i = $(this).text() - 1; //获取Li元素内的值，即1，2，3，4
            m = i;
            if (i >= count) return;
            $("#banner_info").html($("#banner_list a").eq(i).find("img").attr('alt'));
            $("#banner_info").unbind().click(function() { window.open($("#banner_list a").eq(i).attr('href'), "_blank") })
            $("#banner_list a").filter(":visible").fadeOut(500).parent().children().eq(i).fadeIn(1000);
            $(this).css({ "background": "#be2424", 'color': '#000' }).siblings().css({ "background": "#6f4f67", 'color': '#fff' });
        });
        t = setInterval("showAuto()", 4000);
        $("#banner").hover(function() { clearInterval(t) }, function() { t = setInterval("showAuto()", 4000); });

        //右侧服务信息
        $("#libuyer").mouseover(function() {
            $(this).attr("class", "current"); $("#dlbuyer").show(); $("#dlsell").hide(); $("#liseller").attr("class", "");
        });
        $("#liseller").mouseover(function() {
            $(this).attr("class", "current"); $("#dlsell").show(); $("#dlbuyer").hide(); $("#libuyer").attr("class", "");
        });
        $("#help").html(createHelp());
        //产品列表页
        //        showAuto();
        AutoScroll($("#tabProdcuts"), 2000, 400);
        //search
        var _pkey = $("#key");
        var _skey = $("#supkey");
        if ($.trim(_pkey.val()) != "Enter products key words") { _pkey.addClass("shinttwo"); }
        if ($.trim(_skey.val()) != "Enter products key words") { _skey.addClass("shinttwo"); }
        _pkey.focus(function() { if ($.trim(_pkey.val()) == "Enter products key words") { _pkey.val("");_pkey.addClass("shinttwo"); } });
        _skey.focus(function() { if ($.trim(_skey.val()) == "Search Suppliers") { _skey.val(""); _skey.addClass("shinttwo");} });
        _pkey.blur(function() { if ($.trim(_pkey.val()) == "") { _pkey.val("Enter products key words"); _pkey.removeClass("shinttwo");} });
        _skey.blur(function() { if ($.trim(_skey.val()) == "") { _skey.val("Search Suppliers"); _skey.removeClass("shinttwo");} });
        $("#dtCategories").click(function() { if ($("#dc").is(":hidden")) { $("#dc").show(); } else { $("#dc").hide(); } return false; });
        $("body").click(function() { $('#dc').hide(); });
        //头部选项卡
        $("#seaPro").click(function() { $(this).addClass("current"); $("#dlpro").show(); $("#seaSup").removeClass("current"); $("#dlsup").hide(); });
        $("#seaSup").click(function() { $(this).addClass("current"); $("#dlsup").show(); $("#seaPro").removeClass("current"); $("#dlpro").hide(); });
        $("#btnPro").click(function() { if ($.trim(_pkey.val()) == "Enter products key words" || $.trim(_pkey.val() == "")) { alert("please input a search term."); return false; } });
        $("#btnSup").click(function() { if ($.trim(_skey.val()) == "Search Suppliers" || $.trim(_skey.val()) == "") { alert("please input a search term."); return false; } });
        //search end
        
       _pkey.keyup( function() { productsearch();}); 
        _skey.keyup( function() { suppliersearch();}); 
         productsearch();suppliersearch();

        var _wrap = $("#psContent"); //定义滚动区域
        var _interval = 3000; //定义滚动间隙时间
        var _moving; //需要清除的动画
        _wrap.hover(function() {
            clearInterval(_moving); //当鼠标在滚动区域中时,停止滚动
        }, function() {
            _moving = setInterval(function() {
                var _field = _wrap.find('ul:first'); //此变量不可放置于函数起始处,li:first取值是变化的
                var _h = _field.height(); //取得每次滚动高度
                _field.animate({ marginTop: -_h + 'px' }, 600, function() {//通过取负margin值,隐藏第一行
                    _field.css('marginTop', 0).appendTo(_wrap); //隐藏后,将该行的margin值置零,并插入到最后,实现无缝滚动
                })
            }, _interval)//滚动间隔时间取决于_interval
        }).trigger('mouseleave'); //函数载入时,模拟执行mouseleave,即自动滚动


        var _wrap_keyword = $('#ulkeyword'); //定义滚动区域
        var _interval_keyword = 3000; //定义滚动间隙时间
        var _moving_keyword; //需要清除的动画
        _wrap_keyword.hover(function() {
            clearInterval(_moving_keyword); //当鼠标在滚动区域中时,停止滚动
        }, function() {
            _moving_keyword = setInterval(function() {
                var _field = _wrap_keyword.find('li:first'); //此变量不可放置于函数起始处,li:first取值是变化的
                var _h = _field.height(); //取得每次滚动高度
                _field.animate({ marginTop: -_h + 'px' }, 600, function() {//通过取负margin值,隐藏第一行
                    _field.css('marginTop', 0).appendTo(_wrap_keyword); //隐藏后,将该行的margin值置零,并插入到最后,实现无缝滚动
                })
            }, _interval_keyword)//滚动间隔时间取决于_interval_keyword
        }).trigger('mouseleave'); //函数载入时,模拟执行mouseleave,即自动滚动
        
    }, //pageRead end

    AddFavorite: function(sURL, sTitle) {
        { try { window.external.addFavorite(sURL, sTitle); } catch (e) { try { window.sidebar.addPanel(sTitle, sURL, ""); } catch (e) { alert("Favorite Failed"); } } }
    }
}; //defaultpage end
function productsearch()
{
    var _pkey = $("#key");
    if($.trim(_pkey.val()) != "Enter products key words"&&$.trim(_pkey.val())!="") { _pkey.addClass("shinttwo");}
    else{_pkey.removeClass("shinttwo");}
}
function suppliersearch()
{
    var _skey = $("#supkey");
    if($.trim(_skey.val()) != "Search Suppliers"&&$.trim(_skey.val())!="") { _skey.addClass("shinttwo");}
    else{_skey.removeClass("shinttwo");}
}
function showAuto() {
    m = m >= (count - 1) ? 0 : ++m;
    $("#banner li").eq(m).trigger('click');
}

function createHelp() {
    var strHtml = "<h4><a href=\"/help/\" class=\"more right gray\">more</a>Newbie help</h4>";
    strHtml += "<ul>";
    strHtml += "<li><a href=\"/help/sell_join_free.aspx\" target=\"_blank\">Register release products</a></li>";
    strHtml += "<li><a href=\"/help/buy_search_products.aspx\" target=\"_blank\">Search products</a></li>";
    strHtml += "<li><a href=\"/help/buy_check_message.aspx\" target=\"_blank\">Check messages</a></li>";
    strHtml += "<li><a href=\"/help/sell_contact_buyers.aspx\" target=\"_blank\">Contacting Buyers</a></li>";
    strHtml += "<li><a href=\"/help/sell_looking_buyers.aspx\" target=\"_blank\">Looking for buyers</a></li>";
    strHtml += "<li><a href=\"/help/rule_terms_use.aspx\" target=\"_blank\">Terms of Use</a></li>";
    strHtml += "</ul>";
    return strHtml;
}
var productDetail = {
    pageRead: function() {
        ///产品多图片切换功能
        $("img[id^='img_']").mouseover(function() { $('#picshow').attr('src', this.src); });
        ///产品信息与公司信息切换
        $('#tp').mouseover(function() { $('#p').show(); $('#c').hide(); $('#tp').addClass('current'); $('#tc').removeClass(); });
        $('#tc').mouseover(function() { $('#p').hide(); $('#c').show(); $('#tc').addClass('current'); $('#tp').removeClass(); });
    }

}// productDetail end
    //home
    function catalogchange(em) { var obj = $(em); if (obj.text() == "More Categories") { obj.attr("class", "cateLess"); obj.text("Less Categories"); $(".catalogHide").show(); } else { obj.attr("class", "cateMore"); obj.text("More Categories"); $(".catalogHide").hide(); } }
    function AutoScroll(obj, time, time2) {
        var _wrap = obj;
        var _wrap1 = $("#tabBuyingLeads");
        var _interval = time;
        var _moving;
        _wrap.hover(function() {
            clearInterval(_moving);
        }, function() {
            _moving = setInterval(function() {
                var _field = _wrap.find('li:first');
                var _h = _field.height();
                _field.animate({ marginTop: -_h + 'px' }, time2, function() {
                    _field.css('marginTop', 0).appendTo(_wrap);
                    var h2 = _wrap1.find("li:first").height();
                    _wrap1.find("li:first").animate({ marginTop: -h2 + 'px' }, time2, function() {
                        _wrap1.find("li:first").css("marginTop", 0).appendTo(_wrap1);
                    });
                })
            }, _interval)
        }).trigger('mouseleave');      //函数载入时,模拟执行mouseleave,即自动滚动
    }
    function setvalue(objvalue, objtext) {
        $('#sel').html(objtext);
        $('#cid').val(objvalue);
        $('#dc').hide();
    }
    //end home

    //productdetail
    function inquiry(obj) {
        window.open("/product/inquiry.aspx?spid=" + obj, "inquiry");
    }

    //图片缩小
    function DrawImage(ImgD, FitWidth, FitHeight) {
        var image = new Image();
        image.src = ImgD.src;
        if (image.width > 0 && image.height > 0) {
            if (image.width / image.height >= FitWidth / FitHeight) {
                if (image.width > FitWidth) {
                    ImgD.width = FitWidth;
                    ImgD.height = (image.height * FitWidth) / image.width;
                } else {
                    ImgD.width = image.width;
                    ImgD.height = image.height;
                }
            } else {
                if (image.height > FitHeight) {
                    ImgD.height = FitHeight;
                    ImgD.width = (image.width * FitHeight) / image.height;
                } else {
                    ImgD.width = image.width;
                    ImgD.height = image.height;
                }
            }
        }
    }

    //图片缩小
    function DrawImage_Logo(ImgD, FitWidth, FitHeight) {
        var image = new Image();
        image.src = ImgD.src;
        if (image.width > 0 && image.height > 0) {
            if (image.width / image.height >= FitWidth / FitHeight) {
                if (image.width > FitWidth) {
                    ImgD.width = FitWidth;
                    ImgD.height = image.height;
                    //ImgD.height = (image.height * FitWidth) / image.width;
                } else {
                    ImgD.width = image.width;
                    ImgD.height = FitHeight;
                }
            } else {
                if (image.height > FitHeight) {
                    ImgD.height = FitHeight;
                    ImgD.width = image.height;
                    //ImgD.width = (image.width * FitHeight) / image.height;
                } else {
                    ImgD.width = FitWidth;
                    ImgD.height = image.height;
                }
            }
        }
    }
    //end productdetail
    function search() { if ($.trim($('#fkey').val()) == "") { alert('Please input a search term.'); } else { window.open("http://www.weiku.com/search/?key=" + $.trim($('#fkey').val()), "search"); } } 
    
    
    
    
