﻿Viostream.Category.CompleteLoad = function(oXML, categoryId, title){

        var ItemInfo = $(oXML).find("ItemInfo");
        
        var recordCount = parseInt(ItemInfo.find("TotalRows").text());
        var pageIndex = parseInt(ItemInfo.find("PageCurrent").text());
        var pageSize = parseInt(ItemInfo.find("PageSize").text());
        
        var totalPages = parseInt(ItemInfo.find("PageCount").text());

        //Viostream.redrawMedia redraws all media elements from responseXML object - returns number of items found/drawn
        if(Viostream.redrawMedia(oXML)==0){
            $("#" + Viostream.messageBoxId).html("There are currently no media files in "+ title +"").show();
        }
       
        ///Pagination
        Viostream.Paginate(recordCount, pageSize, totalPages, pageIndex, categoryId);


        //<del>dodgy hack</del> "solution" to hide the menu-controsl for "contact us" page
		if (!$("#" + Viostream.mediaItemListId + " li").length)
			$(".menu-controls").hide();
		else
			$(".menu-controls").show();
}