function ProductListForCategory(CategoryID,showCountProduct,HtmlId){
    $.ajax({
             type: "GET",
             url: "/Api/Main/Ashx/main.ashx",
             data: {CategoryID:CategoryID,showCountProduct:showCountProduct,handle:"ProductListForCategory"},
             dataType: "json",
             success: function(data){
                         if(data != null && data != ""){
                            var bt=baidu.template;
                            var html=bt('t:ProductListForCategory',data);
                            $("#"+HtmlId).html(html);
                         }  
                      }
         });
}
function ProductSubCategory(CategoryID,showCountProduct,HtmlId){
    $.ajax({
             type: "GET",
             url: "/Api/Main/Ashx/main.ashx",
             data: {CategoryID:CategoryID,showCountProduct:showCountProduct,handle:"ProductSubCategory"},
             dataType: "json",
             success: function(data){
                         if(data != null && data != ""){
                            var bt=baidu.template;
                            var html=bt('t:ProductSubCategory',data);
                            $("#"+HtmlId).html(html);
                         }  
                      }
         });
}
var xhtml=new Array();
xhtml.push('  <div class="bBox">');
xhtml.push('                <div class="prduct">');
xhtml.push('                    <ul class="cagecont">');
xhtml.push('                                <li>');
xhtml.push('                                    <p class="image">');
xhtml.push('                                            <img style="border-width:0px;" src="/ImgUpload/loddings.gif" onerror="javascript:this.src=/ImgUpload/noimg.jpg_160x160.jpg"></a>');
xhtml.push('                                    </p>');
xhtml.push('                                </li>');
xhtml.push('                    </ul>');
xhtml.push('                </div>');
xhtml.push('         </div>');
var lock300 = true;
var lock700 = true;
var lock1400 = true;
var lock1800 = true;
var lock2000 = true;
var lock2200 = true;
var lock2300 = true;
var lock2400 = true;

$(window).scroll( function() {
    var scrollTop=$(document).scrollTop();
    if(scrollTop> 300 && lock300 == true){
         if(IndexConfigJs[0].pisshow=="0"){$("#floorshow1").hide();  scrollTop=scrollTop+300;}
         else
         {
                 lock300 = false;ProductSubCategory(IndexConfigJs[0].pcode,"10","ProductSubCategory_mrzb");
                 ProductListForCategory(IndexConfigJs[0].pcode, IndexConfigJs[0].showcount, "ProductListForCategory_mrzb"); $("#floorTitle1").text(IndexConfigJs[0].pname.substring(0, 7));
         }
    }
    if(scrollTop> 700 && lock700 == true){
        if(IndexConfigJs[1].pisshow=="0"){$("#floorshow2").hide();  scrollTop=scrollTop+700;}
        else
        {
                lock700 = false;ProductSubCategory(IndexConfigJs[1].pcode,IndexConfigJs[1].showcount,"ProductSubCategory_fsny");
                ProductListForCategory(IndexConfigJs[1].pcode,IndexConfigJs[1].showcount,"ProductListForCategory_fsny");$("#floorTitle2").text(IndexConfigJs[1].pname.substring(0,7));
        }
       
    }
    if(scrollTop > 1400 && lock1400 == true){
       if(IndexConfigJs[2].pisshow=="0"){$("#floorshow3").hide(); scrollTop=scrollTop+400;}
       else{
            lock1400 = false;ProductSubCategory(IndexConfigJs[2].pcode,IndexConfigJs[2].showcount,"ProductSubCategory_xbyd");
            ProductListForCategory(IndexConfigJs[2].pcode, IndexConfigJs[2].showcount, "ProductListForCategory_xbyd"); $("#floorTitle3").text(IndexConfigJs[2].pname.substring(0, 7));
       }
    }
    if(scrollTop> 1800 && lock1800 == true){
       if(IndexConfigJs[3].pisshow=="0"){$("#floorshow4").hide();scrollTop=scrollTop+200;}
       else{
        lock1800 = false;ProductSubCategory(IndexConfigJs[3].pcode,IndexConfigJs[3].showcount,"ProductSubCategory_myyp");
        ProductListForCategory(IndexConfigJs[3].pcode, IndexConfigJs[3].showcount, "ProductListForCategory_myyp"); $("#floorTitle4").text(IndexConfigJs[3].pname.substring(0, 7));
       }
    }
    if(scrollTop > 2000 && lock2000 == true){
       if(IndexConfigJs[4].pisshow=="0"){$("#floorshow5").hide();scrollTop=scrollTop+200;}
       else{
        lock2000 = false;ProductSubCategory(IndexConfigJs[4].pcode,IndexConfigJs[4].showcount,"ProductSubCategory_smjd");
        ProductListForCategory(IndexConfigJs[4].pcode, IndexConfigJs[4].showcount, "ProductListForCategory_smjd"); $("#floorTitle5").text(IndexConfigJs[4].pname.substring(0, 7));
       }
    }
    if(scrollTop> 2200 && lock2200 == true){
        if(IndexConfigJs[5].pisshow=="0"){$("#floorshow6").hide();scrollTop=scrollTop+200;}
        else{
            lock2200 = false;ProductSubCategory(IndexConfigJs[5].pcode,IndexConfigJs[5].showcount,"ProductSubCategory_jzjs");
            ProductListForCategory(IndexConfigJs[5].pcode, IndexConfigJs[5].showcount, "ProductListForCategory_jzjs"); $("#floorTitle6").text(IndexConfigJs[5].pname.substring(0, 7));
        }
    }
    if(scrollTop> 2300 && lock2300 == true){
       if(IndexConfigJs[6].pisshow=="0"){$("#floorshow7").hide();scrollTop=scrollTop+100;}
       else{
        lock2300 = false;ProductSubCategory(IndexConfigJs[6].pcode,IndexConfigJs[6].showcount,"ProductSubCategory_spbj");
        ProductListForCategory(IndexConfigJs[6].pcode, IndexConfigJs[6].showcount, "ProductListForCategory_spbj"); $("#floorTitle7").text(IndexConfigJs[6].pname.substring(0, 7));
       }
    }
     if(scrollTop > 2400 && lock2400 == true){
        if(IndexConfigJs[7].pisshow=="0"){$("#floorshow8").hide();}
        {
            lock2400 = false;ProductSubCategory(IndexConfigJs[7].pcode,IndexConfigJs[7].showcount,"ProductSubCategory_ydxx");
            ProductListForCategory(IndexConfigJs[7].pcode, IndexConfigJs[7].showcount, "ProductListForCategory_ydxx"); $("#floorTitle8").text(IndexConfigJs[7].pname.substring(0, 7));
        }
    }
});
$(function(){
    $("#ProductListForCategory_mrzb,#ProductListForCategory_fsny,#ProductListForCategory_xbyd,#ProductListForCategory_myyp,#ProductListForCategory_smjd,#ProductListForCategory_jzjs,#ProductListForCategory_spbj,#ProductListForCategory_ydxx").html(xhtml.join(""));
});
$(window).scrollTop(0, 0);