function isTop()
{
	if (this.location != top.location)
	{
		top.location = this.location;
	}
}
isTop();

function reloadPage()
{
	// reload IE to reload css - concerns abs positioning
	if (document.all)
		document.location.href=document.location.href;
}

function writeYear()
{
	var startYear = 2001;
	var curYear = (new Date()).getFullYear();
	document.write(startYear == curYear ? startYear : startYear + "-" + curYear);
}

function showImg(imgid)
{
	var gNodes = document.getElementById('gallery').childNodes;
	for (var i = 0; gNodes.length > i; i ++)
	{
		if (gNodes[i].tagName == "IMG")
		{
			if (gNodes[i].attributes['id'].value == 'i' +imgid)
			{
				gNodes[i].style.display = "block";
			}
			else
				gNodes[i].style.display = "none";
		}
		if (gNodes[i].tagName == "UL")
		{
			var aNodes = gNodes[i].childNodes;
			for (var j = 0; aNodes.length > j; j ++)
			{
				if (aNodes[j].tagName == "LI")
				{
					if (aNodes[j].attributes['id'].value == 'a' +imgid)
						aNodes[j].className = "on";
					else
						aNodes[j].className = "off";
				}
			}
		}
		if (gNodes[i].tagName == "H5")
		{
			var aNodes = gNodes[i].childNodes;
			for (var j = 0; aNodes.length > j; j ++)
			{
				if (aNodes[j].tagName == "SPAN")
				{
					if (aNodes[j].attributes['id'].value == 's' +imgid)
						aNodes[j].style.display = "block";
					else
						aNodes[j].style.display = "none";
				}
			}
		}
	}
}