function highLightLink() {
	var aLinks = document.getElementsByTagName("A"), x, nLen, cPage, cHref, cParPage0, cParPage1, cParPage2
	if (typeof(cParentPage0) == "string") //cParentPage is loaded from the include submenu page. It keeps the parent page link highlightedd.
		{
		cParPage0 = "/" + cParentPage0
		}
		else
		{
		cParPage0 = ""
		}

	if (typeof(cParentPage1) == "string") //cParentPage is loaded from the include submenu page. It keeps the parent page link highlightedd.
		{
		cParPage1 = "/" + cParentPage1
		}
		else
		{
		cParPage1 = ""
		}

	if (typeof(cParentPage2) == "string") //cParentPage is loaded from the include submenu page. It keeps the parent page link highlightedd.
		{
		cParPage2 = "/" + cParentPage2
		}
		else
		{
		cParPage2 = ""
		}

	for (x=0;x<aLinks.length;x++)
		{
		cPage = document.location.href.substr(document.location.href.lastIndexOf("/"))
		cHref = aLinks[x].href.substr(aLinks[x].href.lastIndexOf("/"))
		if (cPage == cHref ||  cPage == "/" &&	cHref == "/index.html" || cParPage0 == cHref || cParPage1 == cHref || cParPage2 == cHref)
			{
			switch (aLinks[x].className) {
				case "topMenuLinks": {
					aLinks[x].style.backgroundColor="E8E8FF";
					aLinks[x].style.borderBottom="1pt solid #FFFFFF"
					aLinks[x].style.borderRight="1pt solid #FFFFFF"
					aLinks[x].style.borderTop="1pt solid #666666"
					aLinks[x].style.borderLeft="1pt solid #666666"
					break;
					}
				}
			}
		}
	}

//MUST BE LOADED ALONE, at the first page that calls openModal()
//Create modal window:
if (typeof(_oModalDiv) == "undefined")
	{
	var _oModalDiv = false, _oModalWind = false, _nWindLeft = 0, _nWindTop = 0, _oModalClose = false, __nCloseHeight = 0
	}

function openModal(cURL, nPercent, nLeft, nTop, nWidth, nHeight, cExtraSetting)
	{
	/*
	This will open mdal window. You can change the nPercent to fit need
	Example: 
		openModal()
		openModal("http://google.com")
		openModal("http://google.com",0.6)
		openModal("http://google.com", 0, 50, 50, 400, 500)
		openModal("http://google.com", 0, 0, 0, 400, 500) This will center a window, 500h and 400w.
	*/
	var nScreenWidth = screenSize(1), nScreenHeight = screenSize(2), oDoc, cCloseTop
	nPercent = (nPercent ? nPercent : 0.9)
	_nWindLeft = (nLeft ? nLeft : (nWidth ? nScreenWidth - nWidth : (nScreenWidth * (1 - nPercent))) / 2)
	cLeft = _nWindLeft + "px"
	cWidth = (nWidth ? nWidth : (nScreenWidth * nPercent)) + "px"
	_nWindTop = (nTop ? nTop : (nHeight ? nScreenHeight - nHeight : (nScreenHeight * (1 - nPercent))) / 2)
	cTop = _nWindTop + "px"
	_nCloseHeight = 20
	cCloseTop = (_nWindTop - _nCloseHeight - 26) + "px"
	cHeight = (nHeight ? nHeight : (nScreenHeight * nPercent)) + "px"

	if (!_oModalDiv)
		{
		_oModalDiv = document.createElement("div")
		_oModalDiv.style.position = "fixed"
		_oModalDiv.style.left = "-200px"
		_oModalDiv.style.top = "-200px"
		_oModalDiv.style.width = (nScreenWidth + 400) + "px"
		_oModalDiv.style.height = (nScreenHeight + 400 ) + "px"
		_oModalDiv.style.backgroundColor = "#808080"
		_oModalDiv.style.zIndex = 1000

		_oModalClose = document.createElement("div")
		_oModalClose.id = "_CL"
		_oModalClose.style.position = "fixed"
		_oModalClose.style.left = cLeft
		_oModalClose.style.top = cCloseTop
		_oModalClose.style.width = cWidth
		_oModalClose.style.height = _nCloseHeight + "px"
		_oModalClose.style.zIndex = 1002

		_oModalWind = document.createElement("iframe")
		_oModalWind.id = "_MW"
		_oModalWind.style.position = "fixed"
		_oModalWind.style.left = cLeft
		_oModalWind.style.top = cTop
		_oModalWind.style.width = cWidth
		_oModalWind.style.height = cHeight
		_oModalWind.style.zIndex = 1001

		_oModalWind.scrolling = "yes"

		_oModalWind.style.backgroundColor = "#FFFFFF"
		if (cExtraSetting)
			{
			if (cExtraSetting.indexOf("scrolling=no") > -1)
				{
				_oModalWind.scrolling = "no"
				}
			}
		}

	if (document.all)
		{
		_oModalDiv.style.filter = "alpha(opacity = 80)"
		}
		else
		{
		_oModalDiv.style.opacity = 0.8
		}

	document.body.appendChild(_oModalDiv)
	document.body.appendChild(_oModalClose)
	document.body.appendChild(_oModalWind)

/*
	_oModalClose.style.borderTop = "2px ridge #C0C0C0"
	_oModalClose.style.borderLeft = _oModalClose.style.borderTop
	_oModalClose.style.borderRight = _oModalClose.style.borderTop
	_oModalClose.style.borderBottom = _oModalClose.style.borderTop
*/
	_oModalClose.style.border = "2px ridge #C0C0C0"
	_oModalClose.style.backgroundColor = "#FFFFFF"
	_oModalClose.style.paddingTop = "0px"
	_oModalClose.style.paddingBottom = "6px"
	_oModalClose.style.height = "30px"
	_oModalClose.style.marginBottom = "1px"
	_oModalClose.innerHTML = 
		"<p style=\"text-align:center;margin:10px;\"><button style=\"vertical-align:middle;\" onclick=\"closeModal()\">Close</button></p>"

	_oModalDiv.setAttribute("onclick","_oModalWind.focus()")
	_oModalWind.focus()
	if (cURL)
		{
		_oModalWind.src = cURL
		}
		else
		{
		oDoc = (_oModalWind.contentWindow ? _oModalWind.contentWindow : window.frames["_MW"])
		oDoc.document.writeln("<table width=100% height=100%><tr><td valign=center style='text-align:center'>" +
			"<button style='vertical-align:middle;' id='oButt' onclick='parent.closeModal()'>Close</button></td></tr></table>" + 
			"<scr" + "ipt>document.getElementById('oButt').focus();</scr" + "ipt>")
		oDoc.document.close()
		}
	return _oModalWind
	}

function screenSize(nWhat)
	{
	switch (nWhat)
		{
		case 1:
			if (self.innerHeight) {return self.innerWidth;}
			if (document.documentElement && document.documentElement.clientWidth) {return document.documentElement.clientWidth;}
			if (document.body) {return document.body.clientWidth}
			break
		case 2: 
			if (self.innerHeight) {return self.innerHeight;}
			if (document.documentElement && document.documentElement.clientHeight) {return document.documentElement.clientHeight;}
			if (document.body) {return document.body.clientHeight}
			break
		}
	return -1
	}

function closeModal()
	{
	if (_oModalWind)
		{
		document.body.removeChild(_oModalWind)
		document.body.removeChild(_oModalDiv)
		document.body.removeChild(_oModalClose)
		}
	_oModalWind = false
	_oModalDiv = false
	_oModalClose = false
	}
//END Create modal window:
