// function to execute after data is returned and dom is ready
var populateRecent = function() {

	jQuery(document).ready(function($)
	{      
		$('ul#categories li:first').tplFromData(BP.data.stores.categoriesStore);
		$('tr.categoryrow:first').tplFromData(BP.data.stores.productsStore);
		
	});

}

// start loading data
BP.fetch.getCategories();
BP.fetch.getRecentProducts(populateRecent);
