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 = 2005;
	var curYear = (new Date()).getFullYear();
	document.write(startYear == curYear ? startYear : startYear + "-" + curYear);
}

function showImgLt(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";
		}
	}
}

function showImg(imgid)
{
	var gNodes = document.getElementById('gallery').childNodes;
	for (var i = 0; gNodes.length > i; i ++)
	{
		//
		if (gNodes[i].tagName == "H5")
		{
			if (gNodes[i].attributes['id'].value == 'h' +imgid)
				gNodes[i].style.display = "block";
			else
				gNodes[i].style.display = "none";
		}
		if (gNodes[i].tagName == "DIV")
		{
			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 liNodes = gNodes[i].childNodes;
			for(var j = 0; liNodes.length > j; j ++)
			{
				if (liNodes[j].tagName == "LI")
				{
					if (liNodes[j].attributes['id'].value == 'a' +imgid)
						liNodes[j].className = "on";
					else
						liNodes[j].className = "off";
				}
			}
		}
	}
}
