function CRollover_omOver()
{
	if (!Check_omOver(this)) return;
	
	if (this.img)
	{
		this.img.src=this.img.hisrc;
	}

	if (this.text)
	{
		this.text.style.color=this.text.hicolor;
	}
}

function CRollover_omOut()
{
	if (!Check_omOut(this)) return;
	
	if (this.img)
	{
		this.img.src=this.img.normalsrc;
		this.img.style.top="0";
		this.img.style.left="0";
	}

	if (this.text)
	{
		this.text.style.color=this.text.normalcolor;
		this.text.style.top="0";
		this.text.style.left="0";
	}
}

function CRollover_omDown()
{
	if (this.img)
	{
		this.img.style.top="1";
		this.img.style.left="1";
	}

	if (this.text)
	{
		this.text.style.top="1";
		this.text.style.left="1";
	}
}

function CRollover_omUp()
{
	if (this.img)
	{
		this.img.style.top="0";
		this.img.style.left="0";
	}

	if (this.text)
	{
		this.text.style.top="0";
		this.text.style.left="0";
	}
}

function CRollover(el)
{
	var im = el.all("img",0);
	if (im)
	{
		if (im.hisrc)
		{
			im.normalsrc=im.src;
			el.img=im;
		}
	}
	
	var txt = el.all("text",0);
	if (txt)
	{
		if (!txt.hicolor)
		{
			txt.hicolor="blue";
		}
		txt.normalcolor=txt.style.color;
		el.text=txt;
	}

	if (! (el.img || el.text))
	{
		alert("Nothing for rollover to highlight");
		return;
	}

	el.onmouseover = CRollover_omOver;
	el.onmouseout  = CRollover_omOut;
	el.onmouseup   = CRollover_omUp;
	el.onmousedown = CRollover_omDown;

	el.onselectstart = CancelSelect;
	el.ondragstart = CancelSelect;
}

bindings.rollover = new CBinding(CRollover);
