// FUNCTION:  Add hover state to input buttons
// PRECONDITIONS:  Input elements must have the "input_img_rollover" class applied within the HTML
// POSTCONDITIONS:  Input elements will have a onmouseover and onmouseout "hover_changeImgSrc" function applied
function init_InputBtnMouseover()
{
	var inputs = document.getElementsByTagName("input");
	
	for (var i = 0; i < inputs.length; i++)
	{		
		if (hasClass(inputs[i], "input_img_rollover")) {
			inputs[i].onmouseover = hover_changeImgSrc;
			inputs[i].onmouseout = hover_changeImgSrc;
		}
	}
	return true;
}


// FUNCTION:  Removes or adds a "_over" string to the src of 'this' element.
function hover_changeImgSrc() {
	if (this.src.indexOf("_over.") != -1) {
		// roll out - remove "_over"
		this.src = (this.src.substring(0, this.src.indexOf("_over")) + this.src.substring(this.src.indexOf("_over") + 5));
	} else {
		// roll over - add "_over"
		if (this.src.indexOf(".gif") != -1) {
			this.src = (this.src.substring(0, this.src.indexOf(".gif")) + "_over.gif");
		} else { 
			this.src = (this.src.substring(0, this.src.indexOf(".jpg")) + "_over.jpg");
		}
	}
	
	return true;
}






