function showList(type){
    var f = 0;
    if(type=='DivVen'){
        $.post("/ajax_fc.php",{
            type:'fac'
        },
        function(flag){
            $.each(flag,function(fkey){
                var str="";
                var flagArr=flag[fkey];
                str="<li><a href='javascript:void(0)' onclick=\"return showC('"+flagArr.facn+"')\"><span>"+flagArr.facn+"</span></a></li>";
                $("#DivVen").append(str);
            });
            $("#DivVen").show();
        }
        ,"json")
    }
    if(type=='DivCat'){
        $("#DivCat").show();
        
    }
    $("body").bind("click",function(){
        if(f == 0 ){
            f++;
            return false;
        }else{
            $("#DivVen").hide();
            $("#DivCat").hide();
            f = 0;
            $("body").unbind("click");
        }
    });
}

function showC(fac){
    $("#DivVen").hide();
    $("#facDiv").html(fac);
    $("#DivCat").empty();
    $("#facDiv").addClass("f_ed");
    $.post("/ajax_fc.php",{
        type:'cat',
        factory:fac
    },
    function(flag){
        $.each(flag,function(fkey){
            var str="";
            var flagArr=flag[fkey];
            str="<li><a href='/"+flagArr.catn+"-Certifications.html'><span>"+flagArr.category+"</span></a></li>";
            $("#DivCat").append(str);
        });
        
        $("#DivCat").show();
        
    }
    ,"json")
}
