var tbl;
var ColorChangeInterval = 100;
var colorArray = new Array ( "#5B81D2", "#5A7ECD", "#587BC7", "#5677BE", "#5372B5", "#516DAC", "#4E68A1", "#4B6296", "#485C8A", "#44557E", "#414F72", "#3E4966", "#3B435B", "#383D4F", "#343744", "#323139" );
var colorIndex = 0;
var ColorTimeoutID;
var countingDown = false;

function openCustomerServiceWindow ( )
{
	var w = window.open ( "KnownIssues.aspx", "vcc", "height=600,width=800, scrollbars" );
	w.focus ( );
}

function isIE()
{
	var App = window.navigator.appName;
	if (App == "Microsoft Internet Explorer")
		return true;
}

function recentVersion()
{
	var Agent = window.navigator.userAgent;
	if ((Agent.indexOf("MSIE 5.5") >= 1) || Agent.indexOf("MSIE 6") >= 1 );
		return true;
}

function isNN()
{
	var App = window.navigator.appName;
	if (App == "Netscape")
		return true;
}			

function initLogo ( )   
{
	var e = document.getElementById ( "imgHZLogo" );
	if ( isIE ( ) && recentVersion ( ) )
	{
		e.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader ( src='/gfx/horizons_logo.png', sizingMethod='image' )";
	}
	else if ( isIE ( ) && ( !recentVersion ( ) ) )
	{
		var o = document.getElementById ( "divHZLogo" ).style;
		o.visibility = "hidden";
	}
	else
		e.src = "../gfx/horizons_logo.png";				
}

function ChangeColor ( )
{
	try
	{
		tbl = document.getElementById ( "playHorizons" ).style;
		if ( tbl == null ) 
			return;

		if ( isNN ( ) )
		{
			tbl.borderWidth = "2px";
			tbl.borderStyle = "solid";
		}
		
		tbl.borderColor = colorArray [ colorIndex ];

		if ( !countingDown )
		{
			colorIndex++;
			if ( colorIndex == colorArray.length - 1 )
				countingDown = true;
		}
		else
		{
			colorIndex--;
			if ( colorIndex == 0 )
				countingDown = false;					
		}
		ColorTimeoutID = setTimeout ( 'ChangeColor ( )', ColorChangeInterval);

	}
	catch ( exception ) { return; }
	
}
