function getLotByArea(){
	var LotSelect="<select name='lottype' onchange='getExpectByLot(this.value)'><option> 选择彩种 </option>";
	fw.callXml("/static/info/kaijiang/xml/index.xml", function (xmlData){
		if(!xmlData)return;
		var sourceList = fw.xml.selectNodes(xmlData, '/open/lottery');
		var lotshortname="";
		var lotname="";
		for(var i=0;i<sourceList.length;i++){
			lotshortname= fw.xml.selectSingleNode(sourceList[i], "lotshortname").firstChild.nodeValue;
			lotname= fw.xml.selectSingleNode(sourceList[i], "lotchinesename").firstChild.nodeValue;
			if(/ejxq|slxq/i.test(lotshortname))continue;
			LotSelect +="<option value='"+lotshortname+"'> "+lotname+" </option>";
		}
		LotSelect +="</select>";
		fw.get("lottypesel").innerHTML=LotSelect;
	});
}
function getExpectByLot(lot){
	var ExpectSelect="<select name='expect'><option>选择期号</option>"
	fw.xml.callXml("/static/info/kaijiang/xml/"+lot+"/list.xml", function(sourceXml){
		if(!sourceXml)return;
		var sourceList=fw.xml.selectNodes(sourceXml, "/xml/row[@opencode!='']");
		var expect="";
		for(var i=0;i<sourceList.length;i++){
				expect= sourceList.item(i).attributes.getNamedItem("expect").value;
			ExpectSelect +="<option value='"+expect+"'>"+expect+"</option>";
		}
		ExpectSelect +="</select>";
		fw.get("expectsel").innerHTML=ExpectSelect;
	});
}
function viewKaiJiangByExpect(){
	var lot=fw.get("lottype").value;
	var expect=fw.get("expect").value;
	if(lot!=""){
		if(expect!=""){
			var url="/sina/opencode/kj_"+lot+".shtml?"+expect;
			window.open(url);
		}else{
			alert("请选择期号！");
		}
	}else{
		alert("请选择彩种！");
	}
}


function LoadExpectList(lottype){
	if(lottype=='ssc' || lottype=='ssl'){
		LoadSSExpectList();
		return;
	}
	var expectlist = fw.get('expectlist');	//期号列表
	if(expectlist){
		var xmlData = fw.callXml("/static/info/kaijiang/xml/"+lottype+"/list.xml");
		if(!xmlData)return;
		var nodes = fw.xml.selectNodes(xmlData, "/xml/row");
		var expect,opt;
		for(var i=0;i<nodes.length;i++){
			expect=nodes[i].getAttribute('expect');
			opt=new Option(expect,expect);
			expectlist.options.add(opt);		
		}
		LoadExpectDetail(lottype, nodes[0].getAttribute('expect'));
	}
}