var itemsPerRow = 6;
var numLines = 2;

function initHide( hideSetup )
{
	$('#content-wrapper .section').each( function()
	{
		$('#' + $(this).attr('id') + ' a.more-link').attr('section' , $(this).attr('id')).bind('click' , function(){ toggleItems( $(this).attr('section') , 7);return false;});
		var i = 0;
		var limit = hideSetup[ $(this).attr('id') ] ? hideSetup[ $(this).attr('id') ] : 6 ;
		var current = $(this).attr('id');
		$('#' + $(this).attr('id') + ' .item' ).each( function()
		{
			if (++i > limit)
			{
				$('#' + current + ' a.more-link').css('display' , 'block');
				$(this).css('display' , 'none');
			}
		});
	});
}

function toggleItems( str, start )
{
	var toggle = $('#' + str).hasClass('expanded');
	
	if (toggle)
	{
		hideItems( str, start );
		$('#' + str).removeClass('expanded');
	}
	else
	{
		showItems(str);
		$('#' + str).addClass('expanded');
	}
	

}

function hideItems( str , start )
{
	var i=0;
	var limit = hideSetup[ str ] ? hideSetup[ str ] : 6 ;

	$('#' + str + ' .item').each( function()
	{
		if (++i > limit) $(this).fadeOut();	
	});
}

function showItems( str )
{
	$('#' + str + ' .item' ).each( function()
	{
		$(this).fadeIn();
//		alert("balls");																						
	});
}