function initPage()
{
	var n = document.getElementById("navigation");
	if (n)
	{
		var lis = n.getElementsByTagName("li");
		for (var i = 0; i < lis.length; i++)
		{
			if (lis[i].getElementsByTagName("ul").length)
			{
				var a = lis[i].getElementsByTagName("a").item(0);
				if (a)
				{
					a.onclick = function ()
					{
						var p = this.parentNode;
						if (p.className.indexOf("active") != -1)
							p.className = p.className.replace("active", "");
						else
							p.className += " active";
						return false;
					}
				}
			}
		}
	}
}

if (window.addEventListener) {
	window.addEventListener("load", initPage, false);
	window.addEventListener("load", initImg, false);
}
else if (window.attachEvent) {
	window.attachEvent("onload", initPage);
	window.attachEvent("onload", initImg);
}

var _list = null;
var _img = null;

function initImg() {
	_list = document.getElementById("select");
	_img = document.getElementById("select-img");
	if(_list && _img)
	{
		var links = _list.getElementsByTagName("a");
		for(i = 0; i < links.length; i++)
		{
			if (links[i].href.indexOf("#") == -1)
			{
				links[i].onmouseover = function() {
					_img.src = this.href;
					return false;
				};
			}
		}
	}
}

