var hoverImage = new Class(
{
	id:				undefined,
	imagelink:		undefined,
	hoverImage:		undefined,
	hoverImageOn:	undefined,
	hoverImageOff:	undefined,
	
	initialize: function(imagelink, i)
	{
		//Panel
		this.id = i;
		this.imagelink = imagelink;
		this.imagelink.setProperty('id', 'hoverImage-' + this.id);

        this.hoverImage = this.imagelink.getElement('img');
        this.hoverImageOff = this.hoverImage.getProperty('src');
        this.hoverImageOn = getHoverImageName(this.hoverImageOff);
		
		if (this.imagelink.hasClass('active'))
		{
			this.hoverImage.setProperty('src', this.hoverImageOn);
		}

		this.imagelink.addEvent('mouseenter', this.on.bind(this));
		this.imagelink.addEvent('mouseleave', this.off.bind(this));
	},
	
	on: function(e)
	{
		if (!this.imagelink.hasClass('active'))
		{
			this.hoverImage.setProperty('src', this.hoverImageOn);
		}
	},
	
	off: function(e)
	{
		if (!this.imagelink.hasClass('active'))
		{
			this.hoverImage.setProperty('src', this.hoverImageOff);
		}
	}
});
