function regexpMatch(strHREF) 
{
	var re = new RegExp("\\b[^#]*[a-z]$");
	var m = re.exec(strHREF);
	if (m == null) 
	{
		// alert("No match");
	} 
	else 
	{
		for (i = 0; i < m.length; i++) 
		{
			if (m[i] != undefined)
			{
				return m[i];
			}
		}
	}
}

hideDescriptions = function()
{
	var descHolder = document.getElementById("req_area_descriptions");
	var arrDivs = descHolder.getElementsByTagName("div");
	
	for (i = 0; i < arrDivs.length; i++)
	{
		arrDivs[i].style.display = 'none';
	}

}

showDescription = function(thelink)
{
	document.getElementById(thelink).style.display = 'block';	
	document.location.href="requirements.htm#startcontent";
}

reqLinks = function()
{
	var linksHolder = document.getElementById("req_area_links");
	var arrLinks = linksHolder.getElementsByTagName("a");

	for (x in arrLinks)
	{
		arrLinks[x].onclick = function()
		{
			hideDescriptions();
			showDescription(regexpMatch(this.href));
			return false;
		}
	}
}

popupWin = function()
{
	var reqPop = document.getElementById("req_popup");
	
	popWidth = 600;
	popHeight = 700;

	var x,y;
	if (self.innerHeight) // all except Explorer
	{
		x = self.innerWidth;
		y = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight)
		// Explorer 6 Strict Mode
	{
		x = document.documentElement.clientWidth;
		y = document.documentElement.clientHeight;
	}
	else if (document.body) // other Explorers
	{
		x = document.body.clientWidth;
		y = document.body.clientHeight;
	}

	popLeft = x/2 - popWidth/2;
	popTop = y/2 - popHeight/2;
	
	reqPop.onclick = function()
	{
		newwindow=window.open(this.href,'req_popup','height=' + popHeight + ',width=' + popWidth + ',resizable=1,scrollbars=1,left=' + popLeft + ',top=' + popTop);
		if (window.focus) {newwindow.focus()}
		return false;
	}
}
			
reqInit = function()
{
	hideDescriptions();
	reqLinks();
	popupWin();
}