function provinceList()
{
	this.length=18;
	this[0] = new Option("合肥","合肥");
	this[1] = new Option("黄山","黄山");
	this[2] = new Option("巢湖","巢湖");
	this[3] = new Option("马鞍山","马鞍山");
	this[4] = new Option("蚌埠","蚌埠");
	this[5] = new Option("亳州","亳州");
	this[6] = new Option("池州","池州");
	this[7] = new Option("安庆","安庆");
	this[8] = new Option("六安","六安");
	this[9] = new Option("滁州","滁州");
	this[10] = new Option("宿州","宿州");
	this[11] = new Option("铜陵","铜陵");
	this[12] = new Option("淮北","淮北");
	this[13] = new Option("阜阳","阜阳");
	this[14] = new Option("淮南","淮南");
	this[15] = new Option("宣城","宣城");
	this[16] = new Option("芜湖","芜湖");
	this[17] = new Option("请选择","请选择");
	return this;
}
function cityList()
{
	this.length=18;
	this[0] = new Array(4);
		this[0][0] = new Option("合肥市","合肥市");
		this[0][1] = new Option("肥东县","肥东县");
		this[0][2] = new Option("肥西县","肥西县");
		this[0][3] = new Option("长丰县","长丰县");
	this[1] = new Array(6);
		this[1][0] = new Option("黄山市","黄山市");
		this[1][1] = new Option("黄山风景区","黄山风景区");
		this[1][2] = new Option("休宁县","休宁县");
		this[1][3] = new Option("歙县","歙县");
		this[1][4] = new Option("黟县","黟县");
		this[1][5] = new Option("祁门县  ","祁门县");

	this[2] = new Array(4);
		this[2][0] = new Option("无为县","无为县");
		this[2][1] = new Option("和县","和县");
		this[2][2] = new Option("庐江县","庐江县");
		this[2][3] = new Option("含山县","含山县");
		this[2][4] = new Option("巢湖市","巢湖市");
	this[3] = new Array(3);
		this[3][0] = new Option("马鞍山","马鞍山");
		this[3][1] = new Option("当涂县","当涂县");
		this[3][2] = new Option("马鞍山市","马鞍山市");
	this[4] = new Array(3);
		this[4][0] = new Option("怀远县","怀远县");
		this[4][1] = new Option("固镇县","固镇县");
		this[4][2] = new Option("五河县","五河县");
	this[5] = new Array(4);
		this[5][0] = new Option("蒙城县","蒙城县");
		this[5][1] = new Option("涡阳县","涡阳县");
		this[5][2] = new Option("利辛县","利辛县");
		this[5][3] = new Option("亳州市","亳州市");
	this[6] = new Array(4);
		this[6][0] = new Option("石台县","石台县");
		this[6][1] = new Option("青阳县","青阳县");
		this[6][2] = new Option("东至县","东至县");
		this[6][3] = new Option("贵池区","贵池区");
	this[7] = new Array(8);
		this[7][0] = new Option("潜山县","潜山县");
		this[7][1] = new Option("桐城市","桐城市");
		this[7][2] = new Option("枞阳县","枞阳县");
		this[7][3] = new Option("望江县","望江县");
		this[7][4] = new Option("怀宁县","怀宁县");
		this[7][5] = new Option("太湖县","太湖县");
		this[7][6] = new Option("岳西县","岳西县");
		this[7][7] = new Option("宿松县","宿松县");
	this[8] = new Array(5);
		this[8][0] = new Option("寿县","寿县");
		this[8][1] = new Option("霍邱县","霍邱县");
		this[8][2] = new Option("金寨县","金寨县");
		this[8][3] = new Option("霍山县","霍山县");
		this[8][4] = new Option("舒城县","舒城县");
	this[9] = new Array(7);
		this[9][0] = new Option("天长市","天长市");
		this[9][1] = new Option("明光市","明光市");
		this[9][2] = new Option("凤阳县","凤阳县");
		this[9][3] = new Option("定远县","定远县");
		this[9][4] = new Option("全椒县","全椒县");
		this[9][5] = new Option("来安县","来安县");
		this[9][6] = new Option("滁州市","滁州市");
	this[10] = new Array(5);
		this[10][0] = new Option("宿州市","宿州市");
		this[10][1] = new Option("萧县","萧县");
		this[10][2] = new Option("灵璧县","灵璧县");
		this[10][3] = new Option("泗县","泗县");
		this[10][4] = new Option("砀山县","砀山县");
	this[11] = new Array(2);
		this[11][0] = new Option("铜陵市 ","铜陵市");
		this[11][1] = new Option("铜陵县","铜陵县");

	this[12] = new Array(2);
		this[12][0] = new Option("濉溪县","濉溪县");
		this[12][1] = new Option("淮北市","淮北市");

	this[13] = new Array(6);
		this[13][0] = new Option("界首市","界首市");
		this[13][1] = new Option("颍上县","颍上县");
		this[13][2] = new Option("临泉县","临泉县");
		this[13][3] = new Option("阜南县","阜南县");
		this[13][4] = new Option("太和县","太和县");
		this[13][5] = new Option("阜阳市","阜阳市");

	this[14] = new Array(2);
		this[14][0] = new Option("淮南市 ","淮南市");
		this[14][1] = new Option("凤台县","凤台县");
	this[15] = new Array(7);
		this[15][0] = new Option("宣州市","宣州市");
		this[15][1] = new Option("广德县","广德县");
		this[15][2] = new Option("泾县","泾县","");
		this[15][3] = new Option("绩溪县","绩溪县");
		this[15][4] = new Option("郎溪县","郎溪县");
		this[15][5] = new Option("旌德县","旌德县");
		this[15][6] = new Option("宁国市","宁国市");

	this[16] = new Array(4);
		this[16][0] = new Option("芜湖县","芜湖县");
		this[16][1] = new Option("繁昌县","繁昌县");
		this[16][2] = new Option("南陵县","南陵县");
		this[16][3] = new Option("芜湖市","芜湖市","");
	this[17] = new Array(1);
		this[17][0] = new Option("请选择","请选择");
	return this;
}
provinceOp = new provinceList();
cityOp = new cityList();
//子函数加省份
function initialize(prov,city,provinceID,cityID)
{
	for(i=0;i<provinceOp.length;i++)
	{
		prov.add(provinceOp[i]);
	}
	prov.options[provinceID].selected = true;
	//要选中用户刚才的选择。
	addCity(prov,city);
	city.options[cityID].selected = true;
}
//子函数加城市
function addCity(prov,city)
{
	var i = prov.selectedIndex;
	for(j=0;j<cityOp[i].length;j++)
	{
		city.add(cityOp[i][j]);
	}
}
//子函数删城市
function delCity(city)
{
	var len = city.length;
	for(i=0;i<len;i++)
	{
		city.remove(0);
	}
}
//子函数：控制可选城市随所选省份改变
function province_onchange(prov,city)
{
	delCity(city);
	addCity(prov,city);
}

