
var accordian =
{
'li.accpart' : function(item)
{
		if(item.parts != null)
			return false;
		
		item.parts = $(item.parentNode).getElementsByTagName("li");
		item.contentNode = document.getElementsByClassName('accontent',item);

		if(item.className.match('open') && item.contentNode[0])
			item.contentNode[0].style.display = 'block';
        /*
		item.grow = function()
		{
			if(!this.growing)
				return false;
			this.contentNode.style.display = 'block';
			if(!this.className.match('open'))
				this.className = this.className+' open clion';
		};

		item.shrink = function() {
			if(!this.shrinking)
				return false;
			this.contentNode.style.display = 'none';
			if(this.className.match('open'))
				this.className = this.className.replace(/ open clion/,'');
		};
        */
        
		item.onmouseover = function(p)
		{
			if(!this.className.match(' clion'))
				this.className = this.className + ' clion';
			/*
			if(this.orgHeight < this.clientHeight && this.orgHeight)
			{
				return false;
			}
			else
			{ */
				this.style.cursor = 'pointer';
			//}
		};
		
		item.onmouseout = function(p)
		{
			this.style.cursor = '';
			if(!this.className.match(' open'))
				this.className = this.className.replace(/ clion/, '');
		}
		
		item.onclick = function(p)
		{
			// close all
			var c = this.parts;
			for(var i = 0;i<c.length;i++)
			{
				var e = c[i];
				e.contentNode.style.display = 'none';				
				e.className = 'accpart' + (e.className.match('clialt') ? ' clialt' : '');
			}
			// show me
			this.contentNode.style.display = 'block';
			this.className = 'accpart open ' + (this.className.match('clialt')?' clialt':'') + ' clion';
		};

	},
	'.accontent' : function(el) {
		el.parentNode.contentNode = el;
	}
}

Behaviour.register(accordian);