var xmlobj;
function CreateXMLHttpRequest()
{
    if(window.ActiveXObject)
         xmlobj = new ActiveXObject("Microsoft.XMLHTTP");
    else if(window.XMLHttpRequest)
         xmlobj = new XMLHttpRequest();
}

function show_select(obj,sel_id,sel_id2)
{
    CreateXMLHttpRequest();
    var showurl = "high_key.php?id=" + obj.value;
	xmlobj.onreadystatechange = function(){StatHandler(sel_id,sel_id2)};
    xmlobj.open("GET", showurl, true);
    xmlobj.send(null);
}
function StatHandler(sel_id,sel_id2)
{
    if(xmlobj.readyState == 4 && xmlobj.status == 200)
    {
		document.getElementById(sel_id).options.length=0;
		if(sel_id2) document.getElementById(sel_id2).options.length=0;
		if(xmlobj.responseText)
		{
			var class_info = new Array();
			class_info = xmlobj.responseText.split(",");
			for(var i=0;i<class_info.length;i+=2)
			{
				var objOption=document.createElement("option");
				objOption.value=class_info[i];
				objOption.text=class_info[i+1];
				document.getElementById(sel_id).add(objOption);
			}
		}
    }
}
