function ShopCateCollection(name) { this.name = name; this.length = 0; this.add = addShopCate; return this; } function addShopCate(object) { this.length++; this[this.length] = object } function ShopCateNode(id,name) { this.id = id; this.name = name; return this; } function extractShopCateChildrenOf(node,arr) { var children = new ShopCateCollection(node); var currentIndex = 1; while (currentIndex <= arr.length) { //arr[currentIndex].id.startWith(node) && if (arr[currentIndex].id.substring(0,node.length)==node && arr[currentIndex].id.length==(node.length+2) ) { children.add(arr[currentIndex]) } currentIndex++ } return children; } shopcates=new ShopCateCollection("C"); shopcates.add(new ShopCateNode("C0302","设计图库")); shopcates.add(new ShopCateNode("C010142","企业名录")); shopcates.add(new ShopCateNode("C0201","企业培训")); shopcates.add(new ShopCateNode("C010141","其他行业")); shopcates.add(new ShopCateNode("C010140","航空邮政")); shopcates.add(new ShopCateNode("C010139","冶金矿业")); shopcates.add(new ShopCateNode("C010138","生产加工")); shopcates.add(new ShopCateNode("C010137","食品工业")); shopcates.add(new ShopCateNode("C010136","机械工业")); shopcates.add(new ShopCateNode("C010135","农林牧渔")); shopcates.add(new ShopCateNode("C010134","词书辞典")); shopcates.add(new ShopCateNode("C010133","文史艺术")); shopcates.add(new ShopCateNode("C010132","广告设计")); shopcates.add(new ShopCateNode("C010131","出口贸易")); shopcates.add(new ShopCateNode("C010130","消防安全")); shopcates.add(new ShopCateNode("C010129","部队公安")); shopcates.add(new ShopCateNode("C010128","石油化工")); shopcates.add(new ShopCateNode("C010127","投资招商")); shopcates.add(new ShopCateNode("C010126","医疗卫生")); shopcates.add(new ShopCateNode("C010125","学校教育")); shopcates.add(new ShopCateNode("C010124","人力资源")); shopcates.add(new ShopCateNode("C010123","物流管理")); shopcates.add(new ShopCateNode("C010122","交通运输")); shopcates.add(new ShopCateNode("C010121","园林园艺")); shopcates.add(new ShopCateNode("C010120","市政环保")); shopcates.add(new ShopCateNode("C010119","网络通讯")); shopcates.add(new ShopCateNode("C010118","广播电视")); shopcates.add(new ShopCateNode("C010117","水利电力")); shopcates.add(new ShopCateNode("C010116","旅游酒店")); shopcates.add(new ShopCateNode("C010115","施工建材")); shopcates.add(new ShopCateNode("C010114","工程建筑")); shopcates.add(new ShopCateNode("C010113","国土资源")); shopcates.add(new ShopCateNode("C010112","房产物业")); shopcates.add(new ShopCateNode("C010111","社会保障")); shopcates.add(new ShopCateNode("C010110","法律法规")); shopcates.add(new ShopCateNode("C010109","银行保险")); shopcates.add(new ShopCateNode("C010108","金融证券")); shopcates.add(new ShopCateNode("C010107","工商税务")); shopcates.add(new ShopCateNode("C010106","办公文秘")); shopcates.add(new ShopCateNode("C010105","党政干部")); shopcates.add(new ShopCateNode("C010104","行政后勤")); shopcates.add(new ShopCateNode("C010103","财务会计")); shopcates.add(new ShopCateNode("C010102","哈佛管理")); shopcates.add(new ShopCateNode("C010101","通用管理")); shopcates.add(new ShopCateNode("C030139","数字图书")); shopcates.add(new ShopCateNode("C030138","管理工具")); shopcates.add(new ShopCateNode("C030137","经营管理")); shopcates.add(new ShopCateNode("C030136","认证认可")); shopcates.add(new ShopCateNode("C030135","环境保护")); shopcates.add(new ShopCateNode("C030134","广电媒体")); shopcates.add(new ShopCateNode("C030133","石油化工")); shopcates.add(new ShopCateNode("C030132","科技国防")); shopcates.add(new ShopCateNode("C030131","海关管理")); shopcates.add(new ShopCateNode("C030130","知识产权")); shopcates.add(new ShopCateNode("C030129","旅游管理")); shopcates.add(new ShopCateNode("C030128","质量监督")); shopcates.add(new ShopCateNode("C030127","工商税务")); shopcates.add(new ShopCateNode("C030126","审计统计")); shopcates.add(new ShopCateNode("C030125","计生妇联")); shopcates.add(new ShopCateNode("C030124","文体管理")); shopcates.add(new ShopCateNode("C030123","发改管理")); shopcates.add(new ShopCateNode("C030122","商务管理")); shopcates.add(new ShopCateNode("C030121","水利气象")); shopcates.add(new ShopCateNode("C030120","信息产业")); shopcates.add(new ShopCateNode("C030119","交通运输")); shopcates.add(new ShopCateNode("C030118","国土资源")); shopcates.add(new ShopCateNode("C030117","劳动保障")); shopcates.add(new ShopCateNode("C030116","人事档案")); shopcates.add(new ShopCateNode("C030115","财政")); shopcates.add(new ShopCateNode("C030114","民政")); shopcates.add(new ShopCateNode("C030113","公安消防")); shopcates.add(new ShopCateNode("C030112","学校教育")); shopcates.add(new ShopCateNode("C030111","电力")); shopcates.add(new ShopCateNode("C030110","医药卫生")); shopcates.add(new ShopCateNode("C030109","农林牧渔")); shopcates.add(new ShopCateNode("C030108","园林风景")); shopcates.add(new ShopCateNode("C030107","安全生产")); shopcates.add(new ShopCateNode("C030106","司法检查")); shopcates.add(new ShopCateNode("C030105","工程建设")); shopcates.add(new ShopCateNode("C030104","金融")); shopcates.add(new ShopCateNode("C030103","食品安全")); shopcates.add(new ShopCateNode("C030102","外文类")); shopcates.add(new ShopCateNode("C030101","竞争情报")); shopcates.add(new ShopCateNode("C020117","其他培训")); shopcates.add(new ShopCateNode("C020116","素质训练")); shopcates.add(new ShopCateNode("C020115","市场营销")); shopcates.add(new ShopCateNode("C020114","财务税收")); shopcates.add(new ShopCateNode("C020113","人力资源")); shopcates.add(new ShopCateNode("C020112","企业经营")); shopcates.add(new ShopCateNode("C020111","领导艺术")); shopcates.add(new ShopCateNode("C020110","管理培训")); shopcates.add(new ShopCateNode("C020109","管理软件")); shopcates.add(new ShopCateNode("C020108","成功案例")); shopcates.add(new ShopCateNode("C020107","宏观经济")); shopcates.add(new ShopCateNode("C020106","技能培训")); shopcates.add(new ShopCateNode("C020105","MBA培训")); shopcates.add(new ShopCateNode("C020104","礼仪培训")); shopcates.add(new ShopCateNode("C020103","成功学")); shopcates.add(new ShopCateNode("C020102","战略决策")); shopcates.add(new ShopCateNode("C020101","安全培训")); shopcates.add(new ShopCateNode("C0401","纪念典藏")); shopcates.add(new ShopCateNode("C0301","企业数据")); shopcates.add(new ShopCateNode("C0202","有声读物")); shopcates.add(new ShopCateNode("C0101","工具图书")); shopcates.add(new ShopCateNode("C04","礼品")); shopcates.add(new ShopCateNode("C03","软件")); shopcates.add(new ShopCateNode("C02","音像")); shopcates.add(new ShopCateNode("C01","图书"));