var stories = new Array (
	"top_story1",
	"top_story2",
	"top_story3"
	);
var total_stories = 3;
	
function setup() 
	{
	if (document.getElementById)
		{
		storyCntr = 1;
		showStory('top_story1', stories);
		/* 
		document.getElementById("prevcell").innerHTML = '<a href="#" onclick="prevStory(); return false;"><img src="graphics/home/top_prev.gif" border="0" alt="Previous" width="66" height="22" /></a>';
		document.getElementById("nextcell").innerHTML = '<a  href="#" onclick="nextStory(); return false;"><img src="graphics/home/top_next.gif" border="0" alt="Next" width="45" height="22" /></a>';
		document.getElementById("storyNums").innerHTML = storyCntr + "/" + total_stories;
		*/
		}
	}

// two simple hide/show functions
function hideIt(id) 
	{
	document.getElementById(id).style.display = "none";
	}

function showIt(id) 
	{
	document.getElementById(id).style.display = "block";
	}
	
function showStory(id, storyList)
	{
	for (i in storyList)
		{
		if (storyList[i] == id)
			{
			showIt(id);
			}
		else
			{
			hideIt(storyList[i]);
			}
		}
	}
	
function nextStory() 
	{
	tmp = 'top_story' + storyCntr;
	hideIt(tmp);
	storyCntr = storyCntr + 1;
	if (storyCntr > total_stories) 
		{
		storyCntr = 1;
		}
	tmp = 'top_story' + storyCntr;
	showIt(tmp);
	tmp = storyCntr + "/" + total_stories;
	document.getElementById("storyNums").innerHTML = tmp;
	}
	
function prevStory() {
	tmp = 'top_story' + storyCntr;
	hideIt(tmp);
	storyCntr = storyCntr - 1;
	if (storyCntr < 1)
		{
		storyCntr = total_stories;
		}
	tmp = 'top_story' + storyCntr;
	showIt(tmp);
	tmp = storyCntr + "/" + total_stories;
	document.getElementById("storyNums").innerHTML = tmp;
	}