function HD_changeItem(opcode)
{
	if (navigator.appName != "Netscape")
	{
		imageElement.style.filter = 'blendTrans(duration = 0)';
		imageElement.filters.blendTrans.Apply();
		imageElement.filters.blendTrans.Play();
		
	/*	titleElement.style.filter = 'blendTrans(duration = 0)';
		titleElement.filters.blendTrans.Apply();
		titleElement.filters.blendTrans.Play();*/
	}
	
	HD_clearTimeout();
	
	HD_curIndex += opcode;
	
	if(HD_curIndex >= HD_imageList.length)
		HD_curIndex = 0;
	else if (HD_curIndex < 0)
		HD_curIndex = HD_imageList.length - 1;
	
	//alert(HD_titleList[HD_curIndex]);
	
	imageElement.src = "images/news/" + HD_imageList[HD_curIndex] + ".jpg";
	linkElement.href = HD_seoList[HD_curIndex];
	getFlashMovie("headlineFlashTitle").sendAUtoFlash(HD_titleList[HD_curIndex]);
	
	if(HD_prevItem >= 0)
	{
		document.getElementById("item_"+HD_prevItem).style.borderBottomColor = '#555555';
		document.getElementById("item_"+HD_prevItem).style.borderTopColor = '#555555';
	}

	document.getElementById("item_"+HD_curIndex).style.borderBottomColor = '#ec0000';
	document.getElementById("item_"+HD_curIndex).style.borderTopColor = '#ec0000';
	document.getElementById("news_arrow").style.backgroundPosition = (18 + HD_curIndex * 71 ) + "px 0px";	
	
	HD_prevItem = HD_curIndex;

	if(HD_isChangeable)
		HD_timeoutIndex = setTimeout(timeoutFunction, 4000);
}

function getFlashMovie(flash) {
	return (isIE) ? window[flash] : document[flash];
}

function HD_clearTimeout()
{
	if(HD_timeoutIndex != "")
	{
		clearTimeout(HD_timeoutIndex);
		HD_timeoutIndex = "";
	}
}

function HD_jumpTo(idx)
{
	if(idx == HD_prevItem)
		return;
	HD_isChangeable = 0;
	HD_clearTimeout();
	HD_changeItem(idx - HD_prevItem);
}

function HD_forwClick()
{
	HD_isChangeable = 1;
	
	timeoutFunction = "HD_changeItem(1)";
	
	if(HD_curIndex == -1)
	{
		HD_changeItem(1);
		return;
	}
	
	HD_clearTimeout();
	
	HD_timeoutIndex = setTimeout(timeoutFunction, 4000);
}

function HD_backClick()
{
	HD_isChangeable = 1;
	HD_timeoutFunction = "HD_changeItem(-1)";
	HD_changeItem(-1);
}

var HD_isChangeable = 1;
var HD_curIndex = -1;
var HD_prevItem = -1;
var HD_timeoutFunction = "HD_changeItem(1)";
var HD_timeoutIndex = "";
var HD_imageList = Array();
var HD_idList = Array();
var HD_titleList = Array();
var HD_seoList = Array();
var HD_spotList = Array();

var imageElement = document.getElementById("news_image");
var linkElement = document.getElementById("news_link");
var spotElement = document.getElementById("news_spot");