﻿function ContactSearchMenu()
{
	this.init = function(parentSelector)
	{
		var _parent = this; 
		parentSelector.find('h2 a').each(function(){
			$(this).click(function(){
				_parent.expand($(this));
			});
		});
	}
	
	this.expand = function(item)
	{
		item.parent().toggleClass('active');
		item.parent().parent().find('.expandable').toggle();

		if(item.parent().parent().attr('class').indexOf('closed') > -1)
			item.parent().parent().removeClass('closed');
		else
			item.parent().parent().addClass('closed');
			
	}
}



var sMenu = new ContactSearchMenu();
