


function getidname(kanyucodefield, field1, field2, type, site_url_ssl){
var kanyucode = $(kanyucodefield).value;
var url = site_url_ssl + 'index.php?action_ajax_kanyucodetoidname=ture&kanyucode='+kanyucode+'&field1='+field1+'&field2='+field2+'&type='+type;
var http = new JKL.ParseXML( url );
http.async(showFiled);
var data = http.parse();
}

function showFiled(xml) {

	var field1 = xml.item.idfield;
	var field2 = xml.item.namefield;

	var return_id = xml.item.id;
	var return_name = xml.item.name;

	if(return_id == undefined){

		return_id = '';
	}


	if(return_name == undefined){

		return_name = '';
	}

	$(field1).value = return_id;
	$(field2).value = return_name;

}

function getJuusho(field, zip1, zip2, site_url_ssl){

var zipcode1 = $(zip1).value;

var zipcode2 = $(zip2).value;

var zipcode = zipcode1 + zipcode2

var url = site_url_ssl + 'index.php?action_ajax_zipcode=true&zipcode=' + zipcode + '&field=' + field;

var http = new JKL.ParseXML( url );
http.async(showFiled2);
var data = http.parse();
}

function showFiled2(xml) {

	var value = xml.item.value;

	if(value == undefined){
		value = '';
	}

	$(xml.item.field).value = value;

}



function showFiled3(xml) {

	var meishou = xml.item.value;

	if(meishou == undefined){
		$("taikaimeishou").style.color = "#FF0000";
		meishou = 'そのような大会は存在しません。';
	} else {
		$("taikaimeishou").style.color = "#000000";
	}


	$("taikaimeishou").innerHTML = meishou;

}





function showFiled4(xml) {

	var team_name = xml.item.value;

	if(team_name == undefined){
		$("team_name").style.color = "#FF0000";
		team_name = 'そのようなチームは存在しません。';
	} else {
		$("team_name").style.color = "#000000";
	}


	$("team_name").innerHTML = team_name;

}

//function getNameFromMemberID(field, memberid, password){
function getNameFromMemberID(field, memberid, password, site_url_ssl){

var memberid = $(memberid).value;
var password = $(password).value;

var url = site_url_ssl + 'index.php?action_ajax_memberidtoname=true&password=' + password + '&memberid=' + memberid + '&field=' + field;

var http = new JKL.ParseXML( url );
http.async(showFiled5);
var data = http.parse();
}

function showFiled5(xml) {

	var value = xml.item.value;

	if(value == undefined){
		value = '';
	}

	$(xml.item.field).value = value;

}

function getDantaimeishou(id, field, site_url_ssl){

	var url = site_url_ssl + 'index.php?action_ajax_dantaimeishou=true&id=' + id + '&field=' + field;

	var http = new JKL.ParseXML( url );
	http.async(showFiled6);
	var data = http.parse();
}

function showFiled6(xml) {

	var value = xml.item.value;

	if(value == undefined){
		value = '';
	}

	document.getElementById(xml.item.field).innerHTML = value;

}

//修正必要
//function search_taikai_meishou(){
//	var taikaiid = $("jouitaikaiid").value;
//	var url = 'http://jvamrs.jp/_sys/demo/index.php?action_ajax_taikai_meishou=ture&taikaiid='+taikaiid;
//	var http = new JKL.ParseXML( url );
//	http.async(showFiled3);
//	var data = http.parse();
//}

//修正必要
//function search_team_name_for_taikai(taikaiid){
//	var teamid = $("suisen_teamid").value;
//	var url = 'http://jvamrs.jp/_sys/demo/index.php?action_ajax_taikai_team_name=ture&teamid='+teamid+'&taikaiid='+taikaiid;
//	var http = new JKL.ParseXML( url );
//	http.async(showFiled4);
//	var data = http.parse();
//}

//修正必要
//function search_team_name_for_taikai(taikaiid){
//	var teamid = $("suisen_teamid").value;
//	var url = 'http://jvamrs.jp/_sys/demo/index.php?action_ajax_taikai_team_name=ture&teamid='+teamid+'&taikaiid='+taikaiid;
//	var http = new JKL.ParseXML( url );
//	http.async(showFiled4);
//	var data = http.parse();
//}
