function jump()
{
	var id = document.getElementById("city4");
	var nameid = id.options[id.selectedIndex].text;
	window.open("/html/weather/"+nameid+".shtml",window.opener);
}
var Menu={
	q: null,
	data: null,
	depth: 4,
	init: function(){
		Menu.build();
		Menu.loadDATA("/tools/weather/ajax.aspx");
	},
	loadDATA: function(url,level){
		var l=0;
		if(level){
			l=level;
		}
		Menu.q=new $G.Q(url,"GET");
		Menu.q.level=l;
		Menu.q.parse(Menu.loadS,Menu.loadF);
	},
	loadS: function(){
		Menu.data=Menu.q.$().split(",");
		var cities=new Array();
		for(var i=0;i <Menu.data.length;i++){
			cities.push({id:Menu.data[i].split("|")[0],name:Menu.data[i].split("|")[1]});
		}
		while(Menu.groups[Menu.q.level].firstChild){
			Menu.groups[Menu.q.level].removeChild(Menu.groups[Menu.q.level].firstChild);
		}
		for(var i=0;i<cities.length;i++){
			var node=new $E("option",{value:cities[i].id});
			node.appendChild(cities[i].name);
			node.insertTo(Menu.groups[Menu.q.level]);
		}
		if(Menu.q.level<Menu.depth-1){
			var _url="/tools/weather/ajax-"+cities[0].id+".aspx";
			window.open(_url);
			Menu.loadDATA(_url, Menu.q.level+1);
		}
	},
	loadF: function(){
		window.msg("load error");
	},
	regAction: function(node,level){
		node.onchange=function(){
			var _url="/tools/weather/ajax-"+node.value+".aspx";
			window.open(_url);
			Menu.loadDATA(_url,level+1);
		}
	},
	groups: new Array(),
	build: function(){
		for(var i=0;i<Menu.depth;i++){
			var flag=document.createElement("select");
			flag.id="city"+(i+1);
			flag.name="city"+(i+1);
			Menu.regAction(flag,i);
			flag.style.width="70px";
			flag.style.height="22px";
			Menu.groups.push(flag);
			$("city").appendChild(flag);
		}
		Menu.groups[Menu.depth-1].style.display="none";
	}
}
window.LOAD=window.LOAD?window.LOAD:new Array();
window.LOAD.push(Menu.init);