function CreateHttpRequest() {
	//for Win+IE
	if (window.ActiveXObject) {
		try {
			//for MSXML2
			return new ActiveXObject('Msxml2.XMLHTTP');
		} catch(e) {
			try {
				//for Old MSXML
				return new ActiveXObject('Microsoft.XMLHTTP');
			} catch(e2) {
				return null;
			}
		}
	} else if (window.XMLHttpRequest) {
		//for Other browser
		return new XMLHttpRequest();
	}

	return null;
}

function getFile(method, fileName, target) {
	var http_ins = new CreateHttpRequest();
	if (!http_ins) {
		return;
	}
	http_ins.onreadystatechange = function() {
		if (http_ins.readyState == 4) {
			on_loaded(target,http_ins.responseText);
		}
	}
	http_ins.open(method, fileName, true);
	http_ins.send(null);
}

function on_loaded(target,response) {
	document.getElementById(target).innerHTML = response;
}

function eqsearch() {

	listy=document.eqform.eqyear.selectedIndex;
	year=document.eqform.eqyear.options[listy].value;
	listm=document.eqform.eqmonth.selectedIndex;
	month=document.eqform.eqmonth.options[listm].value;
	listd=document.eqform.eqday.selectedIndex;
	day=document.eqform.eqday.options[listd].value;

	str='./cgi-bin/eqsearch.cgi?eqyear='+year+'&eqmonth='+month+'&eqday='+day;
	getFile('GET',str,'eqsearchres');
}

function eqdisplay() {

	list=document.eqset.eqdata.selectedIndex;
	filename=document.eqset.eqdata.options[list].value;

	str='./container/p'+filename;
	getFile('GET',str,'container3');
	str='./container/n'+filename;
	getFile('GET',str,'container2');

}
