<!--

// Copyright © 2011 Jonathan Phillips

/////////////////////////
//
// changeElementValue
// - Prompts the user to input a value which can be passed to a variable.
//

function changeElementValue (elementID, newValue) {
	element = document.getElementById (elementID);
	element.value = newValue;
}





/////////////////////////
//
// changeImage
// - Changes the src property of an image.
//

function changeImage (imgID, newSource) {	
  	image = document.getElementById (imgID);
  	image.src = newSource;
}





/////////////////////////
//
// hideElement
// - Makes an element invisible.
// - See showElement.
//

function hideElement (elementID) {
	element = document.getElementById (elementID);
	element.style.visibility = "hidden";
}





/////////////////////////
//
// moveElement
// - Positions an element at the specified X and Y locations.
//

function moveElement (elementID, newX, newY) {
	element = document.getElementById (elementID);
	element.style.left = newX;
	element.style.top = newY;
}





/////////////////////////
//
// randomNumber
// - Generates a random number between 1 and maxValue.
//

function randomNumber (maxValue) {
	result = maxValue * Math.random();
	result = Math.ceil (randomNumber);
	return result;
}





/////////////////////////
//
// showElement
// - Makes an element visible.
// - See hideElement.
//

function showElement (elementID) {
	element = document.getElementById (elementID);
	element.style.visibility = "visible";
}

//-->
