// obj set for all
function create_obj(){
	if(window.ActiveXObject){// for win.ie
		try{
			return new ActiveXObject("Msxml2.XMLHTTP");// for msxls2 or more
		}catch(e){
			try{
				return new ActiveXObject("Microsoft.XMLHTTP");// for msxls
			}catch(e2){
				return null;
			}
		}
	}else if(window.XMLHttpRequest){// for other browser that mounts XMLHttpRequest object
		return new XMLHttpRequest();
	}else{
		return null;
	}
}

// for ymd1
function sendymd1(url){
	var ym1 = document.getElementById('ym1').value;
	if(ym1 == 0){
		document.getElementById('d1').options.length=0;
	}else{
		var obj = create_obj();
		obj.onreadystatechange = function(){
			if( (obj.readyState == 4) && (obj.status == 200) ){
				document.getElementById('d1').innerHTML = obj.responseText;
			}
		}
		if(obj){
			obj.open('GET', url + '?md=ajax_ymd1&ym1=' + escape(ym1), true);
			obj.send(null);
		}
	}
}
// for ymd2
function sendymd2(url){
	var ym2 = document.getElementById('ym2').value;
	if(ym2 == 0){
		document.getElementById('d2').options.length=0;
	}else{
		var obj = create_obj();
		obj.onreadystatechange = function(){
			if( (obj.readyState == 4) && (obj.status == 200) ){
				document.getElementById('d2').innerHTML = obj.responseText;
			}
		}
		if(obj){
			obj.open('GET', url + '?md=ajax_ymd2&ym2=' + escape(ym2), true);
			obj.send(null);
		}
	}
}
// for ymd3
function sendymd3(url){
	var ym3 = document.getElementById('ym3').value;
	if(ym3 == 0){
		document.getElementById('d3').options.length=0;
	}else{
		var obj = create_obj();
		obj.onreadystatechange = function(){
			if( (obj.readyState == 4) && (obj.status == 200) ){
				document.getElementById('d3').innerHTML = obj.responseText;
			}
		}
		if(obj){
			obj.open('GET', url + '?md=ajax_ymd3&ym3=' + escape(ym3), true);
			obj.send(null);
		}
	}
}
// for ymd4
function sendymd4(url){
	var ym4 = document.getElementById('ym4').value;
	if(ym4 == 0){
		document.getElementById('d4').options.length=0;
	}else{
		var obj = create_obj();
		obj.onreadystatechange = function(){
			if( (obj.readyState == 4) && (obj.status == 200) ){
				document.getElementById('d4').innerHTML = obj.responseText;
			}
		}
		if(obj){
			obj.open('GET', url + '?md=ajax_ymd4&ym4=' + escape(ym4), true);
			obj.send(null);
		}
	}
}
