var num=1;

function changeFeatured (li_num)
{
	var workingImage = document.getElementById(num);
	workingImage.style.display = 'none';
	num = li_num;
	var workingImage = document.getElementById(num);
	workingImage.style.display = 'inline';
	return false;
}

function nextFeatured ()
{
	if (document.getElementById(num+1))
		changeFeatured (num+1);
	else
		changeFeatured (1);
	return false;
}

function prevFeatured ()
{
	if (document.getElementById(num-1))
		changeFeatured (num-1);
	else
	{
		var nl = document.getElementsByTagName('img');
		changeFeatured (nl.length);
	}
	return false;
}

function printControl()
{
	var num = 1;
	var theHTML = "Story Images: ";
	while (document.getElementById(num)) {
		theHTML += "<a href=\"#\" onclick=\"changeFeatured(" + num + "); return false;\">" + num + "</a>, ";
		num++;
	}
	theHTML = theHTML.substring(0,theHTML.length-2);
	var controlBox = document.getElementById("controls");
	controlBox.innerHTML = theHTML;
}

function photoWindow(url,divname)
{
	document.getElementById("photoWindow");
}