//Define j as jQuery
var j = jQuery;
var acRecipientsHeight;
var acOccasionsHeight;
var acProductsHeight;
j(function(){
	// Display more links.
	j(".acMoreLink").css({"display": "block"});
	
	// Store original heights of category sections.
	acRecipientsHeight 	= j("#acRecipients").height();
	acOccasionsHeight 	= j("#acOccasions").height();
	acProductsHeight 	= j("#acProducts").height();
	
	// If the size hasn't been stored then try a different method (IE7)
	if(acRecipientsHeight == 0) acRecipientsHeight 	= (j("#acRecipients a.cat").size() 	* 18) + 4;
	if(acOccasionsHeight == 0) 	acOccasionsHeight 	= (j("#acOccasions a.cat").size() 	* 18) + 4;
	if(acProductsHeight == 0) 	acProductsHeight 	= (j("#acProducts a.cat").size() 	* 18) + 4;
	
	// Apply new heights to category sections.
	j("#acRecipients").css({"height": "72px", "overflow": "hidden"});
	j("#acOccasions").css({"height": "72px", "overflow": "hidden"});
	j("#acProducts").css({"height": "72px", "overflow": "hidden"});
});

function acExpandCategory(category){
	j('#ac' + category + 'MoreLink').fadeOut('slow');
	j('#ac' + category).animate({'height': eval('ac' + category + 'Height')}, 'slow');
	
}

