//Copyright Steve Holt 2005  - contact via http://www.clockbeat.com

/*
If you wish to use this code in your own web site you must:
	Contact Steve (see above) and let him know where you are using it and how
	Provide a link on your site back to http://www.clockbeat.com
	Leave all these comments in place
	Not modify the code (contact Steve if you want to do that)
*/

var extraScript = null;

function applyScripts() {
	var menusel = new CSSSelect(".link a");
	var menus = menusel.getSelectedElements();
	for (var m in menus) {
		var atag = menus[m];
		var td = findParentByClass(atag, "link");
		if (atag.href == location.href || atag.href == location.href+"index.shtml")
		{
			td.innerHTML = atag.innerHTML;
			td.style.backgroundColor = "#8080ff";
			td.style.color = "#FFFFFF";
		}
		else
		{
			var defcol = td.style.backgroundColor;
			var modcol = modifyColor(defcol, "sat", -5);
			if (modcol == null)
				modcol = "#E0E0F8";
			td.onmouseover = stringToEvent("this.style.backgroundColor='" + modcol + "';");
			td.onmouseout = stringToEvent("this.style.backgroundColor='" + defcol + "';");
			if (atag.target)
				td.onclick = stringToEvent("window.open('" + atag.href + "', '" + atag.target + "').focus(); return false;");
			else
				td.onclick = stringToEvent("location='" + atag.href + "';");
			td.style.cursor = "pointer";
		}
	}
	if (extraScript)
		extraScript();
}

