var myrules = {
	'ul.menu span' : function(el) {
		el.mayopened = (el.className == 'pactive');
		el.onclick = function() {
			var ul = this.parentNode.firstChild.nextSibling.nextSibling;
			this.mayopened = ((!ul.style.display || ul.style.display == 'none') && !this.mayopened);
			ul.style.display = (this.mayopened) ? 'block' : 'none';
			this.className =  (this.mayopened || (this.className != 'pactive')) ? 'pactive'  : '';
			return false;
		},
		el.onmouseover = function() {
			this.className = (!this.mayopened) ? 'phover' : 'pvisited';
		},
		el.onmouseout = function() {
			this.className = (this.mayopened) ? 'pactive'  : '';
		}
	},
	'ul.sub a' : function(el){
		el.onmouseover = function(){
			this.className = 'ahover';
		},
		el.onmouseout = function(){
			this.className = 'alink';
		}
	}
};

Behaviour.register(myrules);
