/*******************************
Short functions to handle news
items in the news display pages.
********************************/

function LoadItem(newsindex) {
	var itemname = "news/" + nws_sht[newsindex].substring(0,4) + "/news" + nws_sht[newsindex] + "_txt.htm";

	var item = frames['newsframe'];
        item.location.replace(itemname);
}

function ShowItem(newsindex) {

	var item = frames['newsframe'];

	divitem=document.getElementById('newsitem');
	divitem.innerHTML = item.document.body.innerHTML;
}


// this allows dynamic updating of the right-hand image list
// based on the contents of the news item arrays from the page header
function NewsLister(){
	for (var index = nws_sht.length-1; index >= 0; --index) {
		document.write("<p align='center'><a href='#top'><img onclick='LoadItem(");
		document.write(index);
		document.write(") ' alt='");
		document.write(nws_tip[index]);
		document.write("' src='");
		var im = "news/" + nws_sht[index].substring(0,4) + "/news" + nws_sht[index] + "_thm." + nws_thm[index]; 
		document.write(im);
		document.write("' height='56' width='96' border='0'></a><br>");
		document.write(nws_lng[index]);
		document.write("</p>");
	}
}
