ajax = false;
if(window.XMLHttpRequest) {
ajax = new XMLHttpRequest();
} else if(window.ActiveXObject) {
try {
ajax = new ActiveXObject("Msxml2.XMLHTTP");
} catch(e) {
ajax = new ActiveXObject("Microsoft.XMLHTTP");
}
}

function getData(serverURL , objID) {

	var obj = document.getElementById(objID);

	obj.disabled="true";

	ajax.open("GET", serverURL);

	ajax.onreadystatechange = function() {

		var obj = document.getElementById(objID);

		if (ajax.readyState == 4 && ajax.status == 200) {

			obj.disabled="";
			
			obj.innerHTML = ajax.responseText;

			obj.focus();
			obj.blur();
		}
	}

	ajax.send(null);

}


function getPullDown(serverURL , objID) {

	var obj = document.getElementById(objID);

    len = obj.options.length;

    for (i=len-1; i>=0; i--){
        obj.options[i] = null;
    }

    obj.options[0] =
         new Option('データ取得中です...', '');

	obj.focus();

	document.body.style.cursor = 'wait';
	obj.disabled="true";


	ajax.open("GET", serverURL);

	ajax.onreadystatechange = function() {

		var obj = document.getElementById(objID);

		if (ajax.readyState == 4 && ajax.status == 200) {

			obj.options[0] = null;
			
			var result = ajax.responseText;

		    var resArray = result.split(",");

		    for (i=0; i<resArray.length; i++) {
		        var detailArray = resArray[i].split("/");

		        obj.options[i] =
		             new Option(detailArray[1], detailArray[0]);
		    }

			obj.disabled="";
			document.body.style.cursor = 'auto';
			obj.focus();

		}
	}

	ajax.send(null);
}


function getPullDown(serverURL , objID) {

	var obj = document.getElementById(objID);

    len = obj.options.length;

    for (i=len-1; i>=0; i--){
        obj.options[i] = null;
    }

    obj.options[0] =
         new Option('データ取得中です...', '');

	obj.focus();

	document.body.style.cursor = 'wait';
	obj.disabled="true";


	ajax.open("GET", serverURL);

	ajax.onreadystatechange = function() {

		var obj = document.getElementById(objID);

		if (ajax.readyState == 4 && ajax.status == 200) {

			obj.options[0] = null;
			
			var result = ajax.responseText;

		    var resArray = result.split(",");

		    for (i=0; i<resArray.length; i++) {
		        var detailArray = resArray[i].split("/");

		        obj.options[i] =
		             new Option(detailArray[1], detailArray[0]);
		    }

			obj.disabled="";
			document.body.style.cursor = 'auto';
			obj.focus();

		}
	}

	ajax.send(null);
}


function clearPullDown(objID) {

	var obj = document.getElementById(objID);

    len = obj.options.length;

    for (i=len-1; i>=0; i--){
        obj.options[i] = null;
    }

	document.body.style.cursor = 'wait';

    obj.options[i] =
         new Option("", "");


	document.body.style.cursor = 'auto';

}