function buttonHover(source, hover)
{	
	if(source != null && hover != null)
	{
		if(hover)
			source.src = source.src.replace(".gif", "_ro.gif");
		else
		{
			//source.src = source.src.substring((source.src.length - 7), 0) + ".gif";
			source.src = source.src.replace("_ro.gif", ".gif");
			source.src = source.src.replace("_click.gif", ".gif");
		}
	}
}


function openWindow(url, windowName, features)
{
	try
	{
		var win = window.open(url, windowName, "resizable=1 scrollbars=1 location=1");
		void(0);
	}
	catch(e)
	{
		alert(e);
	}		
}

//Scrolling ticker functionality
var tickerIncrement = 24;
var tickerTargetPosition = 0;
var tickerPosition = 0;
var play, slide;
var playSpeed = 5000; // == 5 seconds.
var slideSpeed = 10;

function scrollTicker(adjustment)
{
	clearTimeout(play);
	clearTimeout(slide);
	var tickerArea = document.getElementById("tickerScrollArea");
	var tickerItems = tickerArea.getElementsByTagName("div");
	if((tickerTargetPosition - (adjustment * tickerIncrement)) <= 0 &&
		(tickerTargetPosition - (adjustment * tickerIncrement)) > (tickerItems.length * tickerIncrement * -1))
	{
		tickerTargetPosition = tickerTargetPosition - (adjustment * tickerIncrement);
		slide = scroll(tickerArea.id);
	}
	else if((tickerTargetPosition - (adjustment * tickerIncrement)) > 0)
	{
		tickerTargetPosition = ((tickerItems.length * tickerIncrement * -1) + tickerIncrement); // -240
		tickerPosition = (tickerItems.length * tickerIncrement * -1);			// -240 - 24 = -264
		tickerArea.style.top = tickerPosition + "px";						// -264px;
		slide = scroll(tickerArea.id);
	}
	else if((tickerTargetPosition - (adjustment * tickerIncrement)) <= (tickerItems.length * tickerIncrement * -1))
	{
		tickerTargetPosition = 0;
		tickerPosition = tickerIncrement;
		tickerArea.style.top = tickerIncrement + "px";
		slide = scroll(tickerArea.id);
	}
}

function scroll(objId)
{
	if(document.getElementById)
	{
		obj = document.getElementById(objId);
		if(tickerPosition != tickerTargetPosition)
		{
			if(tickerPosition < tickerTargetPosition)
				tickerPosition++;
			else
				tickerPosition--;
			obj.style.top = tickerPosition + "px";
			slide = window.setTimeout("scroll('"+objId+"')", slideSpeed);
		}
		else
		{
			play = window.setTimeout("scrollTicker(1)", playSpeed);
		}
	}
}

function gotoUrl(url) {
    if (url) {
        window.location = url;
    }
}
