var xmlHttp

function newsubdrop() {
	xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null) {
			alert('Giving up :( Cannot create an XMLHTTP instance. Something is borked.');
			return;
	}

	if (document.getElementById("subcategory").value == 'newsub') {
		var url="newsub.php?";
		xmlHttp.onreadystatechange=stateChangeds;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}
}

function stateChangeds() {
	if (xmlHttp.readyState==4) {
		document.getElementById("newsubid").innerHTML=xmlHttp.responseText;
	}
}

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;
}
