
	function filterArray(arr){
		var newarr = new Array();
		for(var i=0; i<arr.length; i++){
			if($.inArray(arr[i],newarr)==-1){
				newarr.push(arr[i]);
			}
		}
		return newarr;
	}
	
	var dataSource = [
			/*广东*/
			{province:'广东',city:'电话：',name:'020 - 83780143，020 - 83795909'}
			,
			{province:'广东',city:'地址：',name:'广州市越秀区白云路111号白云大厦1722'}
			,
			{province:'广东',city:'',name:'姜&nbsp;&nbsp;&nbsp;栋：138 2226 7519&nbsp;<img src="http://smartcost.com.cn/global/images/24hour.jpg">'}
			,
			{province:'广东',city:'',name:'刘&nbsp;&nbsp;&nbsp;飞：186 2002 5102&nbsp;<img src="http://smartcost.com.cn/global/images/24hour.jpg">'}
			,
			{province:'广东',city:'',name:'冯&nbsp;&nbsp;&nbsp;娟：189 2957 7836&nbsp;<img src="http://smartcost.com.cn/global/images/24hour.jpg">'}
			,
			{province:'广东',city:'',name:'何&nbsp;&nbsp;&nbsp;燿：180 2717 7137&nbsp;<img src="http://smartcost.com.cn/global/images/24hour.jpg">'}
			,
			{province:'广东',city:'',name:'杨克松：183 1266 3006&nbsp;<img src="http://smartcost.com.cn/global/images/24hour.jpg">'}
			,
			/*广西*/
			{province:'广西',city:'电话：',name:'0771 - 2429300'}
			,
			{province:'广西',city:'地址：',name:'广西南宁市青秀区中越路7号金旺角A栋1220号'}
			,
			{province:'广西',city:'',name:'陈叶婷：156 0780 7379&nbsp;<img src="http://smartcost.com.cn/global/images/24hour.jpg">'}
			,
			/*海南*/
			{province:'海南',city:'',name:'姜&nbsp;&nbsp;&nbsp;工：138 2226 7519&nbsp;<img src="http://smartcost.com.cn/global/images/24hour.jpg">'}
			,
			{province:'海南',city:'',name:'刘&nbsp;&nbsp;&nbsp;工：186 2002 5102&nbsp;<img src="http://smartcost.com.cn/global/images/24hour.jpg">'}
			,
			{province:'海南',city:'',name:'何&nbsp;&nbsp;&nbsp;工：180 2717 7137&nbsp;<img src="http://smartcost.com.cn/global/images/24hour.jpg">'}
			,
			/*山东*/
			{province:'山东',city:'电话：',name:'0531 - 85906602'}
			,
			{province:'山东',city:'地址：',name:'山东省济南市天桥区三孔桥街28号鲁能康桥19号2单元1103室'}
			,
			{province:'山东',city:'',name:'王洪生：186 6077 8328&nbsp;<img src="http://smartcost.com.cn/global/images/24hour.jpg">'}
			,
			{province:'山东',city:'',name:'王建鹏：158 5413 56218>'}
			,
			/*江西*/
			{province:'江西',city:'电话：',name:'0791 - 86847681'}
			,
			{province:'江西',city:'地址：',name:'江西省南昌市西湖区抚生路388号国金滨江2325室'}
			,
			{province:'江西',city:'',name:'祝海宾：156 0780 7379&nbsp;<img src="http://smartcost.com.cn/global/images/24hour.jpg">'}
			,
			{province:'江西',city:'',name:'王文鹏：136 9950 2634&nbsp;<img src="http://smartcost.com.cn/global/images/24hour.jpg">'}
			,
			{province:'江西',city:'',name:'余&nbsp;&nbsp;&nbsp;婷：151 7047 7101&nbsp;'}
			,
			{province:'江西',city:'',name:'丁&nbsp;&nbsp;&nbsp;宇：135 7603 7520&nbsp;<img src="http://smartcost.com.cn/global/images/24hour.jpg">'}
			,
			/*安徽*/
			{province:'安徽',city:'电话：',name:'0551 - 65855553'}
			,
			{province:'安徽',city:'地址：',name:'安徽省合肥市濉溪路蓝钻尚界A座905室'}
			,
			{province:'安徽',city:'',name:'范月光：189 5600 0672&nbsp;<img src="http://smartcost.com.cn/global/images/24hour.jpg">'}
			,
			{province:'安徽',city:'',name:'林&nbsp;&nbsp;&nbsp;森：180 0560 0890&nbsp;<img src="http://smartcost.com.cn/global/images/24hour.jpg">'}
			,
			{province:'安徽',city:'',name:'张&nbsp;&nbsp;&nbsp;聪：139 6501 5464&nbsp;<img src="http://smartcost.com.cn/global/images/24hour.jpg">'}
			,
			{province:'安徽',city:'',name:'程卫平：152 5556 9686&nbsp;<img src="http://smartcost.com.cn/global/images/24hour.jpg">'}
			,
			{province:'安徽',city:'',name:'梁小伟：153 7532 5025&nbsp;<img src="http://smartcost.com.cn/global/images/24hour.jpg">'}
			,
			/*浙江*/
			{province:'浙江',city:'地址：',name:'浙江省杭州市拱墅区莫干山路789号美都广场C座1501室'}
			,
			{province:'浙江',city:'',name:'陈&nbsp;&nbsp;&nbsp;帅：153 2588 1028&nbsp;<img src="http://smartcost.com.cn/global/images/24hour.jpg">'}
			,
			{province:'浙江',city:'',name:'卢&nbsp;&nbsp;&nbsp;顺：133 3619 5029&nbsp;<img src="http://smartcost.com.cn/global/images/24hour.jpg">'}
			,
			{province:'浙江',city:'',name:'林元钊：177 6725 1246&nbsp;<img src="http://smartcost.com.cn/global/images/24hour.jpg">'}
			,
			/*福建*/
			{province:'福建',city:'',name:'叶&nbsp;&nbsp;&nbsp;工：189 6590 8308&nbsp;'}
			,
			/*江苏*/
			{province:'江苏',city:'',name:'陈&nbsp;&nbsp;&nbsp;工：153 2588 1028&nbsp;'}
			,
			/*上海*/
			{province:'上海',city:'',name:'陈&nbsp;&nbsp;&nbsp;工：189 5600 0673&nbsp;'}
			,
			/*湖南*/
			{province:'湖南',city:'电话：',name:'0731 - 82258306/7/8'}
			,
			{province:'湖南',city:'地址：',name:'湖南省长沙市芙蓉中路三段569号湖南商会大厦东栋15楼'}
			,
			{province:'湖南',city:'',name:'胡&nbsp;&nbsp;&nbsp;敏：137 8612 6240&nbsp;'}
			,
			{province:'湖南',city:'',name:'邹红梅：186 8470 6219&nbsp;'}
			,
			/*湖北*/
			{province:'湖北',city:'',name:'陈&nbsp;&nbsp;&nbsp;工：189 5600 0673&nbsp;'}
			,
			/*河南*/
			{province:'河南',city:'电话：',name:'0371 - 63830643，0371 - 63930643'}
			,
			{province:'河南',city:'地址：',name:'河南省郑州市高新技术开发区翠竹街1号总部企业基地82栋8层'}
			,
			{province:'河南',city:'',name:'郝&nbsp;&nbsp;&nbsp;敏：182 3996 1862&nbsp;'}
			,
			{province:'河南',city:'',name:'代&nbsp;&nbsp;&nbsp;敏：185 3710 6327&nbsp;'}
			,
			/*内蒙*/
			{province:'内蒙古',city:'电话：',name:'0471 - 3243636'}
			,
			{province:'内蒙古',city:'地址：',name:'内蒙古呼和浩特市润宇国际公寓908（海东路与兴安北路东南角润宇家居广场西门）'}
			,
			{province:'内蒙古',city:'',name:'孙燕娇：133 8488 9975&nbsp;<img src="http://smartcost.com.cn/global/images/24hour.jpg">'}
			,
			{province:'内蒙古',city:'',name:'张晓娟：158 4777 9626&nbsp;'}
			,
			{province:'内蒙古',city:'',name:'杨卫东：158 4718 8971&nbsp;<img src="http://smartcost.com.cn/global/images/24hour.jpg">'}
			,
			{province:'内蒙古',city:'',name:'德格金：187 4799 4461&nbsp;'}
			,
			{province:'内蒙古',city:'',name:'白世杰：157 5494 1130&nbsp;'}
			,
			{province:'内蒙古',city:'',name:'古&nbsp;&nbsp;&nbsp;磊：152 4802 7997&nbsp;'}
			,
			/*山西*/
			{province:'山西',city:'',name:'张&nbsp;&nbsp;&nbsp;工：136 9641 6682&nbsp;'}
			,
			{province:'山西',city:'',name:'王&nbsp;&nbsp;&nbsp;工：135 9439 8497&nbsp;'}
			,
			{province:'山西',city:'',name:'李&nbsp;&nbsp;&nbsp;工：151 2322 1511&nbsp;'}
			,
			{province:'山西',city:'',name:'周&nbsp;&nbsp;&nbsp;工：135 9462 0841&nbsp;<img src="http://smartcost.com.cn/global/images/24hour.jpg">'}
			,
			{province:'山西',city:'',name:'王&nbsp;&nbsp;&nbsp;工：138 4494 2828&nbsp;<img src="http://smartcost.com.cn/global/images/24hour.jpg">'}
			,
			/*河北*/
			{province:'河北',city:'',name:'王&nbsp;&nbsp;&nbsp;工：138 4494 2828&nbsp;<img src="http://smartcost.com.cn/global/images/24hour.jpg">'}
			,
			/*天津*/
			{province:'天津',city:'',name:'张&nbsp;&nbsp;&nbsp;工：136 9641 6682&nbsp;'}
			,
			{province:'天津',city:'',name:'王&nbsp;&nbsp;&nbsp;工：135 9439 8497&nbsp;'}
			,
			{province:'天津',city:'',name:'李&nbsp;&nbsp;&nbsp;工：151 2322 1511&nbsp;'}
			,
			{province:'天津',city:'',name:'周&nbsp;&nbsp;&nbsp;工：135 9462 0841&nbsp;<img src="http://smartcost.com.cn/global/images/24hour.jpg">'}
			,
			{province:'天津',city:'',name:'王&nbsp;&nbsp;&nbsp;工：138 4494 2828&nbsp;<img src="http://smartcost.com.cn/global/images/24hour.jpg">'}
			,
			/*北京*/
			{province:'北京',city:'',name:'王&nbsp;&nbsp;&nbsp;工：186 6077 8328&nbsp;<img src="http://smartcost.com.cn/global/images/24hour.jpg">'}
			,
			{province:'北京',city:'',name:'陈&nbsp;&nbsp;&nbsp;工：189 5600 0673&nbsp;'}
			,
			{province:'北京',city:'',name:'周&nbsp;&nbsp;&nbsp;工：135 9462 0841&nbsp;<img src="http://smartcost.com.cn/global/images/24hour.jpg">'}
			,
			{province:'北京',city:'',name:'王&nbsp;&nbsp;&nbsp;工：138 4494 2828&nbsp;<img src="http://smartcost.com.cn/global/images/24hour.jpg">'}
			,
			/*甘肃*/
			{province:'甘肃',city:'电话：',name:'0931 - 2358113'}
			,
			{province:'甘肃',city:'地址：',name:'甘肃省兰州市七里河区瓜州路18号运管局家属院'}
			,
			{province:'甘肃',city:'',name:'王&nbsp;&nbsp;&nbsp;涛：186 9313 5810&nbsp;<img src="http://smartcost.com.cn/global/images/24hour.jpg">'}
			,
			{province:'甘肃',city:'',name:'苟彦刚：138 9318 8110&nbsp;<img src="http://smartcost.com.cn/global/images/24hour.jpg">'}
			,
			{province:'甘肃',city:'',name:'余亚雄：181 0944 2671&nbsp;<img src="http://smartcost.com.cn/global/images/24hour.jpg">'}
			,
			{province:'甘肃',city:'',name:'薛成科：189 1903 6551&nbsp;<img src="http://smartcost.com.cn/global/images/24hour.jpg">'}
			,
			{province:'甘肃',city:'',name:'李&nbsp;&nbsp;&nbsp;雪：180 9319 6292&nbsp;<img src="http://smartcost.com.cn/global/images/24hour.jpg">'}
			,
			/*新疆*/
			{province:'新疆',city:'电话：',name:'0991 - 8858052'}
			,
			{province:'新疆',city:'地址：',name:'乌鲁木齐光明路金碧华府B2座29层'}
			,
			{province:'新疆',city:'',name:'马&nbsp;&nbsp;&nbsp;工：138 9982 6259&nbsp;'}
			,
			/*宁夏*/
			{province:'宁夏',city:'',name:'王&nbsp;&nbsp;&nbsp;工：139 1977 5917&nbsp;'}
			,
			{province:'宁夏',city:'',name:'苟&nbsp;&nbsp;&nbsp;工：138 9318 8110&nbsp;'}
			,
			/*青海*/
			{province:'青海',city:'',name:'王&nbsp;&nbsp;&nbsp;工：139 1977 5917&nbsp;'}
			,
			{province:'青海',city:'',name:'苟&nbsp;&nbsp;&nbsp;工：138 9318 8110&nbsp;'}
			,
			/*陕西*/
			{province:'陕西',city:'',name:'王&nbsp;&nbsp;&nbsp;工：139 1977 5917&nbsp;'}
			,
			{province:'陕西',city:'',name:'苟&nbsp;&nbsp;&nbsp;工：138 9318 8110&nbsp;'}
			,
			/*重庆*/
			{province:'重庆',city:'电话：',name:'023 - 62773697'}
			,
			{province:'重庆',city:'地址：',name:'重庆市南岸区南坪协信城2栋26-11'}
			,
			{province:'重庆',city:'',name:'张文远：136 9641 6682&nbsp;<img src="http://smartcost.com.cn/global/images/24hour.jpg">'}
			,
			{province:'重庆',city:'',name:'王星植：135 9439 8497&nbsp;<img src="http://smartcost.com.cn/global/images/24hour.jpg">'}
			,
			{province:'重庆',city:'',name:'李清学：151 2322 1511&nbsp;'}
			,
			{province:'重庆',city:'',name:'周洪波：135 9462 0841&nbsp;<img src="http://smartcost.com.cn/global/images/24hour.jpg">'}
			,
			/*四川*/
			{province:'四川',city:'电话：',name:'028 - 85259790'}
			,
			{province:'四川',city:'地址：',name:'四川省成都市武侯区二环路南四段51号莱蒙都会广场4栋1104'}
			,
			{province:'四川',city:'',name:'全&nbsp;&nbsp;&nbsp;冰：180 8091 9443&nbsp;<img src="http://smartcost.com.cn/global/images/24hour.jpg">'}
			,
			{province:'四川',city:'',name:'田洪武：177 2982 5262&nbsp;<img src="http://smartcost.com.cn/global/images/24hour.jpg";&nbsp;135 0942 2192;>'}
			,
			{province:'四川',city:'',name:'刘&nbsp;&nbsp;&nbsp;庆：177 4992 0566&nbsp;<img src="http://smartcost.com.cn/global/images/24hour.jpg">'}
			,
			/*云南*/
			{province:'云南',city:'',name:'周&nbsp;&nbsp;&nbsp;工：135 9462 0841&nbsp;<img src="http://smartcost.com.cn/global/images/24hour.jpg">'}
			,
			{province:'云南',city:'',name:'王&nbsp;&nbsp;&nbsp;工：135 9439 8497&nbsp;'}
			,
			{province:'云南',city:'',name:'李&nbsp;&nbsp;&nbsp;工：151 2322 1511&nbsp;'}
			,
			{province:'云南',city:'',name:'张&nbsp;&nbsp;&nbsp;工：136 9641 6682&nbsp;'}
			,
			/*贵州*/
			{province:'贵州',city:'电话：',name:'0851 - 5360466/7/8/9'}
			,
			{province:'贵州',city:'',name:'张&nbsp;&nbsp;&nbsp;工：136 9641 6682&nbsp;'}
			,
			{province:'贵州',city:'',name:'王&nbsp;&nbsp;&nbsp;工：135 9439 8497&nbsp;'}
			,
			{province:'贵州',city:'',name:'李&nbsp;&nbsp;&nbsp;工：151 2322 1511&nbsp;'}
			,
			{province:'贵州',city:'',name:'周&nbsp;&nbsp;&nbsp;工：135 9462 0841&nbsp;<img src="http://smartcost.com.cn/global/images/24hour.jpg">'}
			,
			/*西藏*/
			{province:'西藏',city:'',name:'张&nbsp;&nbsp;&nbsp;工：136 9641 6682&nbsp;'}
			,
			{province:'西藏',city:'',name:'王&nbsp;&nbsp;&nbsp;工：135 9439 8497&nbsp;'}
			,
			{province:'西藏',city:'',name:'李&nbsp;&nbsp;&nbsp;工：151 2322 1511&nbsp;'}
			,
			{province:'西藏',city:'',name:'周&nbsp;&nbsp;&nbsp;工：135 9462 0841&nbsp;<img src="http://smartcost.com.cn/global/images/24hour.jpg">'}
			,
			/*辽宁*/
			{province:'辽宁',city:'',name:'王&nbsp;&nbsp;&nbsp;工：136 9641 6682&nbsp;<img src="http://smartcost.com.cn/global/images/24hour.jpg">'}
			,
			/*黑龙江*/
			{province:'黑龙江',city:'',name:'王&nbsp;&nbsp;&nbsp;工：136 9641 6682&nbsp;<img src="http://smartcost.com.cn/global/images/24hour.jpg">'}
			,
			/*吉林*/
			{province:'吉林',city:'',name:'王&nbsp;&nbsp;&nbsp;工：136 9641 6682&nbsp;<img src="http://smartcost.com.cn/global/images/24hour.jpg">'}
			,
			];
	
$(function(){
	$(".tabbreadcrumb>ul>li>a").bind("click", function () {
		$(this).parent().parent().find("li").removeClass("current");
		$(this).parent().addClass("current");
		$(".catalogue").hide().eq($(this).parent().index()).show();
	});
	
	$(".tabbreadcrumb>ul>li").eq(0).find("a").click(); 
	
	$('#btn_close').click(function(){
		zone_close();
	});
	
	
	
	
	
	var provinces = $.map(dataSource,function(val){
		return val.province;
	});

	provinces = filterArray(provinces);
	
	$.each(provinces,function(key,val){
		$('#s1').append('<option value="'+val+'">'+val+'</option>');
	})
	
	$('#s1').bind('change',function(){
		var $v = $(this).val();
		$('#s2').find('option:gt(0)').remove();
		if($v==''){
			zone_close();
		}
		else{
			var result = $.grep(dataSource,function(val,key){
				if(val.province == $v){
					return true;
				}
				else{
					return false;
				}
			});
			var citys = $.map(result,function(val){
				return val.city;
			});
			citys = filterArray(citys);
			$.each(citys,function(key,val){
				$('#s2').append('<option value="'+val+'">'+val+'</option>');
			});
			zone_show($v,'',1);
		}
	});
	
	$('#s2').bind('change',function(){
		var $v = $(this).val();
		if($v==''){
			zone_close();
		}
		else{
			zone_show($('#s1').val(),$v,2);
		}
	});
	
});

function zone_close(){
		$('#mylist').empty();
		$('#myzone').hide();
	}
	
	function zone_show(p,c,type){
		$('#mylist').empty();
		var result = null;
		if(type == 1){
			result = $.grep(dataSource,function(val,key){
				if(val.province == p){
					return true;
				}
				else{
					return false;
				}
			});
			
		}
		else{
			result = $.grep(dataSource,function(val,key){
				if(val.city == c){
					return true;
				}
				else{
					return false;
				}
			});
		}

		if(result == null){
			zone_close();
		}
		
		$.each(result,function(key,val){
			$('#mylist').append('<tr><td class="one">'+val.city+'</td><td>'+val.name+'</td></tr>');
		});
		
		$('#mytitle').text(p+' '+c+' 客户服务中心');
		
		$('#myzone').show();
	}

function setProvince(p){
	var $v = p;
	if($v!=''){
		$('#s2').find('option:gt(0)').remove();
		$('#s1').find('option').removeAttr('selected');
		$('#s1').find('option[value="'+p+'"]').attr('selected','selected');
		
		var result = $.grep(dataSource,function(val,key){
			if(val.province == $v){
				return true;
			}
			else{
				return false;
			}
		});

		$.each(result,function(key,val){
			$('#s2').append('<option value="'+val.city+'">'+val.city+'</option>');
		});

		zone_show($v,'',1);
	}
}
