var xmlHttp

function gettopsubs() {
	xmlHttp=GetXmlHttpObject();

	if (xmlHttp==null) {
		alert('Giving up :( Cannot create an XMLHTTP instance. Something is borked.');
		return;
	}
	var cat = document.getElementById('catdrop').value

	var url = "newsubdrop.php?cat=" + cat + "&bleh=" + Math.random();
	xmlHttp.onreadystatechange=  function() {
		if (xmlHttp.readyState==4) {
			document.getElementById('subsdrop').innerHTML=xmlHttp.responseText;
		}
	}
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function GetXmlHttpObject() {
	var xmlHttp=null;
	try {
		// Firefox, Opera 8.0+, Safari, IE7
		xmlHttp=new XMLHttpRequest();
	}
	catch (e) {
		// IE6 and under
		try {
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e) {
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}

