
var dropDownMenus = new Array('smenu1', 'smenu2', 'smenu3');

function isCompatible()
{
	var browser = navigator.appName;
	var ver = navigator.appVersion;
	var thestart = parseFloat(ver.indexOf("MSIE"))+1; //This finds the start of the MS version string.
	var brow_ver = parseFloat(ver.substring(thestart+4,thestart+7)); //This cuts out the bit of string we need.

	if ((browser=="Microsoft Internet Explorer") && (brow_ver < 7)) //By default the min. IE ver is set to 6. Change as desired.
	{
		return false;
	}
	return true;
}

function show(id)
{
	var d = document.getElementById(id);
	for (var i = 0; i < dropDownMenus.length; i++)
	{
		document.getElementById(dropDownMenus[i]).style.display='none';
	}
	if (d != null && isCompatible())
	{
		d.style.display='block';
	}
}


function removeAllChildren(element)
{
	while (element.hasChildNodes())
	{
		element.removeChild(element.lastChild);
	}
}

function addTextToElement(element, text)
{
	element.appendChild(document.createTextNode(text));
}

function initPage()
{
	var anchors = document.getElementsByTagName("a");
	for (var i = 0; i < anchors.length; i++)
	{
		var anchor = anchors[i];
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external")
		{
			anchor.target = "_blank";
		}
	}
}