﻿ICL.Web.ImageLink = 
	function(el)
	{	
		if (arguments.length > 0)
		{
			this.init(el);
		}
	}

ICL.Web.ImageLink.prototype.init = 
	function(el)
	{
		if (typeof el == 'string') 
		{
			this.el = YAHOO.util.Dom.get(el);
		}
		else
		{
			this.el = el;
		}
		YAHOO.util.Event.addListener(this.el, 'mouseout', ICL.Web.ImageLink.OnMouseOut);
		YAHOO.util.Event.addListener(this.el, 'mouseover', ICL.Web.ImageLink.OnMouseOver);
	}

ICL.Web.ImageLink.OnMouseOut = 
	function(e)
	{
		var el = YAHOO.util.Event.getTarget(e);
		el.src = el.src.replace(ImageButtonHighlighted, ImageButtonNormal);
	}


ICL.Web.ImageLink.OnMouseOver = 
	function(e)
	{
		var el = YAHOO.util.Event.getTarget(e);
		
		if (ImageButtonNormal.length > 0)
		{
			el.src = el.src.replace(ImageButtonNormal, ImageButtonHighlighted);
		}
		else
		{
			el.src = el.src.replace(ImageButtonExtension, ImageButtonHighlighted + ImageButtonExtension);
		}
		
	}
