function getRadioValue(radioIn){

// This function returns the value of the selected radio button.
// The input value should be a radio button object.

	var dLen = radioIn.length;
	var radioValue;
	
	for (x = 0; x < dLen; x++) {
		if(radioIn[x].checked) {
			radioValue = radioIn[x].value;
			break;
			}
		}
	
	return radioValue;
	
	}
	
function getRadioIndex(radioIn){

// This function returns the index of the selected radio button.
// The input value should be a radio button object.

	var dLen = radioIn.length;
	var radioValue;
	
	for (x = 0; x < dLen; x++) {
		if(radioIn[x].checked) {
			radioValue = radioIn[x].value;
			break;
			}
		}
	
	return radioValue;
	
	}
	
function setSelect(selectIn){

// This function sets the first option in a select list to selected.
// The input value should be a radio button object.

	var dLen = selectIn.length;
	
	for (x = 0; x < dLen; x++) {
		if(x == 0) {
			selectIn[x].selected = true;
			}
		else {
			selectIn[x].selected = false;
			}
		}
	
	return true;
	
	}
	
function getSelectValue(selectIn){

// This function returns the value of the selected option in a select.
// The input value should be a seelct list object.

	var selectIndex = selectIn.selectedIndex;
	var selectValue = selectIn.options[selectIndex].value;
	
	return selectValue;
	
	}
	
function rndmNmbr(high) {

// Generate Random Number

// Return a random number between 1 and upper limit passed in.

	var rndmNmb = 0;
	
	rndmNmb = Math.random();
	rndmNmb = rndmNmb * high;
	rndmNmb = Math.floor(rndmNmb) + 1;	
	
	return rndmNmb;
	}
	
function rndmSubTitle() {

// Randomly chose a Title Image

// Returns a random title image to display at the top of the home page.

	var nmbr;
	var nmbrAlpha;
	var image;
	
	nmbr = rndmNmbr(6);
	nmbrAlpha = nmbr + "";
	if (nmbr < 10) {
		image = "MASSubTitle0" + nmbrAlpha + ".gif";
	}
	else {
		image = "MASSubTitle" + nmbrAlpha + ".gif";
	}
	
	return image;
	}

function rndmTitle() {

// Randomly chose a title image

// Returns a random title image to display at the top of the home page.

	var nmbr;
	var nmbrAlpha;
	var image;
	
	nmbr = rndmNmbr(12);
	nmbrAlpha = nmbr + "";
	if (nmbr < 10) {
		image = "MASTitle0" + nmbrAlpha + ".gif";
	}
	else {
		image = "MASTitle" + nmbrAlpha + ".gif";
	}
	
	return image;
	}

function roundNumber(number, position) {

// Round the number passed in to the decimal position specified, then return
// the rounded result.

	number = number * Math.pow(10, position);
	number = Math.round(number);
	number = number / Math.pow(10, position);
	
	return number;
	}

function vldString(theString) {

// Validate Alphanumeric String Fields

// This function validates that the alpha string field passed in 
// is not blank.

    var result = true;
    if (theString != "") {
        for (x=0; x < theString.length; x++) {
            var theChar = theString.charAt( x);
            if (theChar != " ") {
                result = true;
                break;
                }
            }
        }
    return result;
    }