// POPULATE DROP DOWN LIST FUNCTIONS
//function accepts source DLL, target DLL, string of subDDLs to hide, and table prefix for sql string on data page
function popList(ddlSourceID, ddlTargetID, strDDLs, tableID, valueNullID) {
	//hide the sub-ddls
	var arrDDLs = strDDLs.split(";"); //strDDLs is a semicolon separated array of ddls to hide
	for (var ddl in arrDDLs) {
		var ddlElement = document.getElementById(arrDDLs[ddl]);
		if(ddlElement.options.length > 0) {
			ddlElement.options[0].selected = true;
		}
		var ddlElement = document.getElementById(arrDDLs[ddl]).style;
		ddlElement.display = "none";
	}
	//get the selected source value
	var ddlSourceValue = document.getElementById(ddlSourceID).value;
	if (ddlSourceValue=="" || ddlSourceValue==valueNullID){
		return false
	}
	//show the wait image
	var processingImage = document.getElementById("processingImage" + ddlTargetID).style;
	processingImage.display = processingImage.display? "":"block";
	createRequest();
	var url = "prc_edit.php?pageID=documents&subID=popList&tableID=" + escape(tableID) + "&ddlSourceValue=" + escape(ddlSourceValue) + "&ddlTargetID=" + escape(ddlTargetID);
	request.open("GET", url, true);
	request.onreadystatechange = updateViewPopList;
	request.send(null);
}
