function getoption(url,newsid){//url是网址
var ajax = createXMLHttpRequest();
ajax.open("GET", url, true);
ajax.onreadystatechange = function() {//如果执行是状态正常，那么就把返回的内容赋值给指定的地方
if (ajax.readyState == 4 && ajax.status == 200) {
	var obj = ajax.responseXML;
	var games = obj.getElementsByTagName("game");
	if(games.length>0){
		for (var i=0;i<games.length;i++) {
			var this_game_id = games[i].getElementsByTagName("this_game_id")[0].firstChild.nodeValue;
		}
	}
			
	var serverss = obj.getElementsByTagName("server");
	if(serverss.length>0){
		for (var i=0;i<serverss.length;i++) {
			var this_server_id = serverss[i].getElementsByTagName("this_server_id")[0].firstChild.nodeValue;
		}
		
	}else{
		var this_server_id = "";
	}
	
	
	if (this_server_id == "" && this_game_id != ""){
		var properties = obj.getElementsByTagName("property");
		if (properties.length > 0) {
			document.productsform.server_id.options.length = 1;
			for (var i=0,x=1;i<properties.length;i++,x++) {
				name = properties[i].getElementsByTagName("name")[0].firstChild.nodeValue;
				value = properties[i].getElementsByTagName("value")[0].firstChild.nodeValue;
				document.productsform.server_id.options[x] = new Option();
				document.productsform.server_id.options[x].text = name;
				document.productsform.server_id.options[x].value = value;
			}
		}else{
				document.productsform.server_id.options[1] = new Option();
				document.productsform.server_id.options[1].text = "";
				document.productsform.server_id.options[1].value = "";
		}
	} 
	
	if (this_server_id != "" && this_game_id != ""){
		var gold_tables = obj.getElementsByTagName("gold_table");
		if (gold_tables.length > 0) {
			document.productsform.products_gold_id.options.length = 1;
			for (var i=0,x=1;i<gold_tables.length;i++,x++) {
				name6 = gold_tables[i].getElementsByTagName("gold_count")[0].firstChild.nodeValue;
				value6 = gold_tables[i].getElementsByTagName("gold_id")[0].firstChild.nodeValue;
				document.productsform.products_gold_id.options[x] = new Option();
				document.productsform.products_gold_id.options[x].text = name6;
				document.productsform.products_gold_id.options[x].value = value6;
			}
		} else {
			document.productsform.products_gold_id.length=0;
			document.productsform.products_gold_id.click;
			document.productsform.products_gold_id.options[0] = new Option();
			document.productsform.products_gold_id.options[0].text = "Choose the production";
			document.productsform.products_gold_id.options[0].value = "";
		}
	}
	
	
	
}
}
ajax.send(null);
}


function getoption1(url,newsid){//url是网址
var ajax = createXMLHttpRequest();
ajax.open("GET", url, true);
ajax.onreadystatechange = function() {//如果执行是状态正常，那么就把返回的内容赋值给指定的地方
if (ajax.readyState == 4 && ajax.status == 200) {
	var obj = ajax.responseXML;
	var games = obj.getElementsByTagName("game");
	if(games.length>0){
		for (var i=0;i<games.length;i++) {
			var this_game_id = games[i].getElementsByTagName("this_game_id")[0].firstChild.nodeValue;
		}
	}
			
	var serverss = obj.getElementsByTagName("server");
	if(serverss.length>0){
		for (var i=0;i<serverss.length;i++) {
			var this_server_id = serverss[i].getElementsByTagName("this_server_id")[0].firstChild.nodeValue;
		}
		
	}else{
		var this_server_id = "";
	}
	
	
	if (this_server_id == "" && this_game_id != ""){
		var properties = obj.getElementsByTagName("property");
		if (properties.length > 0) {
			document.productsform1.server_id.options.length = 1;
			for (var i=0,x=1;i<properties.length;i++,x++) {
				name = properties[i].getElementsByTagName("name")[0].firstChild.nodeValue;
				value = properties[i].getElementsByTagName("value")[0].firstChild.nodeValue;
				document.productsform1.server_id.options[x] = new Option();
				document.productsform1.server_id.options[x].text = name;
				document.productsform1.server_id.options[x].value = value;
			}
		}else{
				document.productsform1.server_id.options[1] = new Option();
				document.productsform1.server_id.options[1].text = "";
				document.productsform1.server_id.options[1].value = "";
		}
	} 
	
	if (this_server_id != "" && this_game_id != ""){
		var gold_tables = obj.getElementsByTagName("gold_table");
		if (gold_tables.length > 0) {
			document.productsform1.products_gold_id.options.length = 1;
			for (var i=0,x=1;i<gold_tables.length;i++,x++) {
				name6 = gold_tables[i].getElementsByTagName("gold_count")[0].firstChild.nodeValue;
				value6 = gold_tables[i].getElementsByTagName("gold_id")[0].firstChild.nodeValue;
				document.productsform1.products_gold_id.options[x] = new Option();
				document.productsform1.products_gold_id.options[x].text = name6;
				document.productsform1.products_gold_id.options[x].value = value6;
			}
		} else {
			document.productsform1.products_gold_id.length=0;
			document.productsform1.products_gold_id.click;
			document.productsform1.products_gold_id.options[0] = new Option();
			document.productsform1.products_gold_id.options[0].text = "Choose the production";
			document.productsform1.products_gold_id.options[0].value = "";
		}
	}
	
	
	
}
}
ajax.send(null);
}

