//use the following var to remember an image's original src value
//the imageRoll function will constantly update this value, allowing the imageOut function to use its current value
var imageSourceValue = '';
function imageRoll(imageObject)
{
    //store the current src value
    imageSourceValue = imageObject.src;
    //grab the directory from the src attribute
    var folderIndex = imageObject.src.lastIndexOf("/");
    var theDirectory = imageObject.src.substring(0,folderIndex+1);//returns the DIR in the form http://domain.com/folder
    //test for image file type, jpg v. gif
    var extIndex = imageObject.src.lastIndexOf(".");
   
    var theFileName = imageObject.src.substring(folderIndex+1,extIndex);//returns the filename in the form NAME
    var theFileType = imageObject.src.substring(imageObject.src.length-(imageObject.src.length-extIndex-1));//grab the extension
   
    imageObject.src=theDirectory+'/'+theFileName+'-on.'+theFileType;
}
function imageOut(imageObject)
{
    //retrieve the original image src attribute
    imageObject.src = imageSourceValue;
}

function hideElement(elementId){
	if(document.getElementById(elementId)){
		document.getElementById(elementId).style.display = 'none';
	}
}

function showElement(elementId){
	if(document.getElementById(elementId)){
		document.getElementById(elementId).style.display = '';
	}
}

////////////////////////
