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;
	
	imageElement.src = "images_up/" + HD_imageList[HD_curIndex] + "";
	linkElement.href = HD_seoList[HD_curIndex];
	
	titleElement.innerHTML = HD_titleList[HD_curIndex];
	
	document.getElementById("news_arrow").style.backgroundPosition = (22 + HD_curIndex * 58 ) + "px 0px";
	
	
	HD_prevItem = HD_curIndex;
	
	if(HD_isChangeable)
		HD_timeoutIndex = setTimeout(timeoutFunction, 8000);
}

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, 8000);
}

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 imageElement = document.getElementById("news_image");
var linkElement = document.getElementById("news_link");
var titleElement = document.getElementById("news_title");
