document.observe('dom:loaded',function(){
	$$('div.pracList p.subItems a').each(function(el){
		el.observe('click',function(event){
			Event.stop(event);
			var parent = $(el.parentNode.parentNode);
			if(parent.hasClassName('expanded'))
				parent.removeClassName('expanded');
			else
				parent.addClassName('expanded');
		});
	});

	// expand	
	$$('a.expButton').each(function(el){
		el.observe('click',function(event){
			Event.stop(event);
			$(el.parentNode.parentNode).select('p.subItems').each(function(el2){
				$(el2.parentNode).addClassName('expanded');
			});

			var expAll = $(el.parentNode.parentNode).select('p.expAll');
			expAll.each(function(el2){
				if(el2 == el.parentNode)
					el2.removeClassName('active');
				else
					el2.addClassName('active');
			});
		});
	});


	// collapse
	$$('a.collButton').each(function(el){
		el.observe('click',function(event){
			Event.stop(event);
			$(el.parentNode.parentNode).select('p.subItems').each(function(el2){
				$(el2.parentNode).removeClassName('expanded');
			});

			var expAll = $(el.parentNode.parentNode).select('p.expAll');
			expAll.each(function(el2){
				if(el2 == el.parentNode)
					el2.removeClassName('active');
				else
					el2.addClassName('active');
			});
		});
	});


	// practice detail page show/hide content
	if($('pracImage'))
	{
		display_items('overview', ['attorneys','experience','news','events','clients','cases']);

		$$('#contentNav a').each(function(el){
			el.observe('click',function(){
				$$('#contentNav li').each(function(el2){ el2.removeClassName('hLight'); });
				$(el.parentNode).addClassName('hLight');
			});
		});
	}
	
});
