/*function GetXmlHttpObject(handler)
{
   var objXMLHttp=null
   if (window.XMLHttpRequest)
   {
       objXMLHttp=new XMLHttpRequest()
   }
   else if (window.ActiveXObject)
   {
       objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
   }
   return objXMLHttp
}

function stateChanged(resultBox)
{
   if (xmlHttp.readyState==4 && xmlhttp.status==200)
   {
           document.getElementById(resultBox).innerHTML=xmlhttp.responseText;
   }
   else {
           document.getElementById(resultBox).innerHTML="<font color='#0000ff'>Loading...</font>";
   }
   //alert(xmlHttp.readyState);
}

// Will populate data based on input
function htmlData(url, resultBox, qStr)
{
   if (url.length==0)
   {
       document.getElementById(resultBox).innerHTML="";
       return;
   }
   xmlHttp=GetXmlHttpObject()
   if (xmlHttp==null)
   {
       alert ("Browser does not support HTTP Request");
       return;
   }

   url=url+"?"+qStr;
   xmlHttp.onreadystatechange=stateChanged(resultBox);
   xmlHttp.open("GET",url,true) ;
   xmlHttp.send();
}
*/

function getSub1List(num)
{
    //alert("loaded: "+num);
    if (window.XMLHttpRequest)
	{// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp=new XMLHttpRequest();
	}
	else
	{// code for IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange=function()
	{
                document.getElementById('sub1Box').style.display = "block";
		if (xmlhttp.readyState==4 && xmlhttp.status==200)
		{
                    document.getElementById("sub1Box").innerHTML=xmlhttp.responseText;
		}
                else
                {
                    document.getElementById("sub1Box").innerHTML="<font color='#0000ff'>Loading...</font>";
                }
	}
	xmlhttp.open("GET","getsub1.php?q="+num,true);
	xmlhttp.send();
}

function getSub2List(num)
{
    //alert("loaded: "+num);
    if (window.XMLHttpRequest)
	{// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp=new XMLHttpRequest();
	}
	else
	{// code for IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange=function()
	{
                document.getElementById('sub2Box').style.display = "block";
		if (xmlhttp.readyState==4 && xmlhttp.status==200)
		{
                    document.getElementById("sub2Box").innerHTML=xmlhttp.responseText;
		}
                else
                {
                    document.getElementById("sub2Box").innerHTML="<font color='#0000ff'>Loading...</font>";
                }
	}
	xmlhttp.open("GET","getsub2.php?q="+num,true);
	xmlhttp.send();
}

function getListEdit(cat, sub1, sub2)
{
    //alert("loaded: "+num);
    if (window.XMLHttpRequest)
	{// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp=new XMLHttpRequest();
	}
	else
	{// code for IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange=function()
	{
                document.getElementById('sub1Box').style.display = "block";
		if (xmlhttp.readyState==4 && xmlhttp.status==200)
		{
                    document.getElementById("sub1Box").innerHTML=xmlhttp.responseText;
		}
                else
                {
                    document.getElementById("sub1Box").innerHTML="<font color='#0000ff'>Loading...</font>";
                }
	}
	xmlhttp.open("GET","get_list_edit.php?cat="+cat+"&sub1="+sub1+"&sub2="+sub2,true);
	xmlhttp.send();
}
