if (!ASB) var ASB = {};

ASB.Keywords = function() {
	var categories = $class('category');
	var self = this;
	for (var i=0;i<categories.length;i++) {
		var category = categories[i];
		category.onmouseover = function() {
			self.change(this,true);
		}
		category.onmouseout = function() {
			self.change(this,false);
		}
	}
}

ASB.Keywords.prototype.change = function(element,show) {
				if (show) {
					Atira.Element.addClassName(element,'highlighted');
				} else {
					Atira.Element.removeClassName(element,'highlighted');
				}
	var parent = element.parentNode.parentNode;
	while (parent) {
		for (var i=0;i<parent.childNodes.length;i++) {
			var child = parent.childNodes[i];
			if (child.nodeType!=1) continue;
			if (Atira.Element.hasClassName(child,'category')) {
				if (show) {
					Atira.Element.addClassName(child,'highlighted');
				} else {
					Atira.Element.removeClassName(child,'highlighted');
				}
			}
		}
		parent=parent.parentNode;
	}
}

Atira.Event.addLoadListener(
	function() {new ASB.Keywords()}
);