//<![CDATA[
function GetXmlHttp() {
	var x = null;
	try {
		x = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch (e) {
		try {
			x = new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch (e) {
			x = null;
		}
	}
	if (!x && typeof XMLHttpRequest != "undefined") {
		x = new XMLHttpRequest();
	}
	return x;
}

function lookuptechnology(technology) {
	if (isblank(technology)) {	
		technology = '0003'
	}
	var url = "loaddropdowns.asp?technology=" + technology;
	document.getElementById("sub-technology").selectedIndex=0;
	document.getElementById("partner").selectedIndex=0;
	var xmlhttp = GetXmlHttp();
	if (xmlhttp) {
		xmlhttp.open("GET", url, true);
		xmlhttp.onreadystatechange = function() {
			if (xmlhttp.readyState == 4) {
				var result = xmlhttp.responseText;
				eval(result);
			}
		}
		xmlhttp.send(null);
	}
}

function lookupsubtechnology(subtechnology) {
	var url = "loaddropdowns.asp?subtechnology=" + subtechnology;
	document.getElementById("partner").selectedIndex=0;
	var xmlhttp = GetXmlHttp();
	if (xmlhttp) {
		xmlhttp.open("GET", url, true);
		xmlhttp.onreadystatechange = function() {
			if (xmlhttp.readyState == 4) {
				var result = xmlhttp.responseText;
				eval(result);
			}
		}
		xmlhttp.send(null);
	}
}

function DisableControl(ControlId) {
	ListControl = document.getElementById(ControlId);
	ListControl.disabled=true;
}
	
function EnableControl(ControlId) {
	ListControl = document.getElementById(ControlId);
	ListControl.disabled=false;
}

function ClearOptions(ControlId) {
	ListControl = document.getElementById(ControlId);
	while (ListControl.options.length > 0) {
		ListControl.options[0] = null;
	}
}

function AddToOptionList(ControlId, OptionText, OptionValue) {
	ListControl = document.getElementById(ControlId);
	// Add option to the bottom of the list
	ListControl[ListControl.length] = new Option(OptionText, OptionValue);
}
//]]>
