/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
* Roll Over Image Script 																			*
* Version: 2.0																								*
* Supported events:	over, out, click													*
*	Features:	extended function, status text modification				*
*																															*
*	16.03.04	MaAeb		Creation based on NavElement function			*
\* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

function RollOverImg(rollImgName,imgOver,imgClick,extended,statusText) {
	this.rollImg = eval("document.rollImg_"+rollImgName);
	this.imageOut = this.rollImg.src;
	this.status =	"out";
	this.statusText = statusText;
	this.statusOrig =	window.status;
	if (imgOver != "") {
		(new Image).src = imgOver;
		this.imageOver = imgOver;
	}
	if (imgClick != "") {
		(new Image).src = imgClick;
		this.imageClick = imgClick;
	}
	function mouseEvent(event) {
		// change image
		var eventImg = this["image"+(event.substr(0,1)).toUpperCase()+(event.substr(1,4)).toLowerCase()];
		if (eventImg)
			this.rollImg.src = eventImg;
		this.status =	event.toLowerCase();
		// change status text
		if (statusText != "") {
			if (event.toLowerCase() == "over") {
				this.statusOrig = (window.status)?window.status:"";
				window.status = this.statusText;
			} else if (event.toLowerCase() == "out") {
				window.status = this.statusOrig;
			}
		}
		// call extended functionality
		if (extended != "") {
			return eval(extended);
		}
	}
	this.mouseEvent = mouseEvent;
}		
