


function setObjValue(targetObj, srcObj){
	document.getElementById(targetObj).value= getIndexText(srcObj);
}


function getIndexText(parentObjectID){
	var Index = document.getElementById( parentObjectID ).selectedIndex;
	var obj = document.getElementById( parentObjectID );
	if( Index != -1){
		var inputs = obj.options[Index].text;
	} else{
		var inputs = "";
	}
	return inputs;
}


/* ***************************************************************************
**	Name: ProcessorCall
**
**	Inputs: 	URL:  The processor page
**
**
**				TblID: The ID of the Table we wish to replace.
**
**	Return: boolean : true or false
**
**	Summary: This function is called to work on processing a form as well as
**				return back the status messages to a specifc area on the page.
**
** ************************************************************************ */
function ProcessorCall(URL, TblID, Sort){
	//var files = new Object();
	paramdata = "ID="+Sort;
	//files.Page = "./?" + paramdata;

	var tmp = new net.ContentLoader	(	URL 	, ProcessorCallExitCheck ,
										null 				,	"POST" ,
										paramdata 		, null,
										TblID				,	null */files*/
									);
//									problematic doing stuff after return it seems,,

}




/* ***************************************************************************
**	Name: ProcessorCallExit
**
**	Inputs: None
**
**	Return: None
**
**	Summary:The load function for the initially called function ProcessorCall.
**
** ************************************************************************ */
function ProcessorCallExitCheck(){
//	alert("response: " + this.req.responseText);
	removeAllChildNodes(this.objectID);
//	alert(this.objectID);
	document.getElementById(this.objectID).innerHTML = this.req.responseText;
	//location.replace(this.passObject.Page);
}


/* ***************************************************************************
**	Name: removeAllChildNodes
**
**	Inputs: obj_ID:  This is the ID of whatever we plan to remove.
**
**	Return: None
**
**	Summary: This function is just a simple loop that goes through and removes
**			all children nodes of a specific node.
** Not tested to see if it also removes the parent node at the end...
**
** ************************************************************************ */
function removeAllChildNodes(obj_ID) {
var node = document.getElementById(obj_ID);
	if (node && node.hasChildNodes && node.removeChild) {
		while (node.hasChildNodes()) {
			node.removeChild(node.firstChild);
		}
	}
}


/* ***************************************************************************
**	Name: removeThisNode
**
**	Inputs: obj_ID:  This is the ID of whatever we plan to remove.
**
**	Return: None
**
**	Summary: A simple function that is used to remove the specified node
**			from the DOM tree.
**
** ************************************************************************ */
function removeThisNode(obj_ID){
	var node = document.getElementById(obj_ID);
	var nodeParent = node.parentNode;
	nodeParent.removeChild(node);
}
