/////////////////////////////////////////////////////////////////////////////////////////
// FUNCTION LIST
//
// function GetInputBoxValueByID(theID)
// function SetInputBoxValueByID(theID, myValue)
// function GetDropdownByID(theID)
// function SetDropdownByID(theID, myValue)
// function GetTextareaValueByID(theID)

/*****************************************************************************************/
function GetInputBoxValueByID(theID) {
	var inputs = document.getElementsByTagName('input');
	var myValue = "";	
	for (var i=0;i<inputs.length;i++) {
		if (inputs[i].id == theID) { myValue = inputs[i].value;		break;  } // process first instance only 
	}		
	return myValue;
}
/*****************************************************************************************/
function SetInputBoxValueByID(theID, myValue) {

	var inputs = document.getElementsByTagName('input');
	for (var i=0;i<inputs.length;i++) {
	 	if (inputs[i].id == theID) { inputs[i].value = myValue;			break; } // process first instance only
	}		
}
/********************************************/
function GetDropdownValueByID(theID) {

	var TheDropdown = document.getElementById(theID);
	var myValue;

	if (TheDropdown) {
		myValue = TheDropdown.options[TheDropdown.selectedIndex].value; }


	return myValue;
}
/********************************************/
function SetDropdownByID(theID, theValue) {

	var selectObj = document.getElementById(theID);
	
	for (var i = 0; i < selectObj.options.length; i++) {
		if (theValue == selectObj.options[i].value) {
			selectObj.selectedIndex = i;
			break; // Break out to stop at the first value
		}
	}

}
/*****************************************************************************************/
function GetTextareaValueByID(theID) {
	var TheTextarea = document.getElementById(theID);
	if (TheTextarea)  {
		return TheTextarea.value }
	else { return 0};
}
/*****************************************************************************************/
