function HD_changeItem(opcode, type)
{	
//	eval('author_data[' +type+'] = author_data_' + type);

	HD_clearTimeout(type);

	HD_curIndex[type] += opcode;

	if(HD_curIndex[type] >= count[type])
		HD_curIndex[type] = 0;
	else if (HD_curIndex[type] < 0)
		HD_curIndex[type] = count[type] - 1;

	authorName[type].innerHTML = author_data[type][HD_curIndex[type]]['author_name'];
	titleElement[type].innerHTML = '<a href="' + author_data[type][HD_curIndex[type]]['link']  + '">' + author_data[type][HD_curIndex[type]]['title'] + '</a>';
	dateValue[type].innerHTML = author_data[type][HD_curIndex[type]]['date'];
	imageValue[type].src = './images/author/' + author_data[type][HD_curIndex[type]]['id'] + '_b.jpg';

	HD_prevItem[type] = HD_curIndex[type];
	
	if(HD_isChangeable[type])
	{
		HD_timeoutIndex[type] = setTimeout(HD_timeoutFunction[type], 8000);
	}
}

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

function HD_jumpTo(idx, type)
{
	if(idx == HD_prevItem[type])
	
	//HD_isChangeable = 0;
	HD_clearTimeout(type);
	HD_changeItem(idx - HD_prevItem[type], type);
}

function HD_forwClick(type)
{
	HD_isChangeable[type] = 1;

	HD_timeoutFunction[type] = "HD_changeItem(1," + type + ")";
	if(HD_curIndex[type] == -1)
	{
		HD_changeItem(1, type);
		return;
	}

	HD_clearTimeout(type);
	
	HD_timeoutIndex[type] = setTimeout(HD_timeoutFunction[type], 8000);
}

function HD_backClick(type)
{
	HD_isChangeable[type] = 1;
	HD_timeoutFunction[type] = "HD_changeItem(-1, " + type +")";
	HD_changeItem(-1, type);
}

var HD_isChangeable = new Array();
var HD_curIndex = new Array();
var HD_prevItem = new Array();
var HD_timeoutIndex = new Array();
var HD_timeoutFunction = new Array();

var titleElement = new Array();
var authorName = new Array();
var dateValue = new Array();
var imageValue = new Array();
var count = new Array();
var author_data = new Array();
var opcode =  new Array();


