﻿function OnLoadArtistDetailsPage()
{
    MusicPortal.Web.Services.Reviews.GetArtistPageCount(artistId, ReviewsInitial, ReviewsFailure);
}


ReviewListGroupChangePage = function(page) {

    MusicPortal.Web.Services.Reviews.GetArtistPage(artistId, (page * 1 - 1), ReviewsRenderReviewList, ReviewsFailure);
}
ReviewsRenderReviewList = function(result, eventArgs)
{
	var list = eval(result);

	var str = '';
	for (var i = 0; i < list.length; i++)
	{
		str += '<li>';
		str += '<div class=\"leftBlock\"><h3>' + list[i].Title + '</h3></div>';
		str += '<div class=\"rightBlock\">' + list[i].Date + '</div>';
		str += '<div class=\"simpleText\">';
		if (list[i].ImageId != null)
		{
			str += '<img src=\"' + imageUrl.replace("{0}", list[i].ImageId) + '\" width=\"70\" height=\"70\">';
		}
		str += '<a href=\"' + reviewUrl + list[i].Id + '\">' + list[i].ShortDescription + '</a></div>';
		str += '</li>';
	}
	content = document.getElementById('ReviewsListContent');
	if (content != null)
	{
		content.innerHTML = str;
	}
}
ReviewsFailure= function(result, eventArgs)
{
}
ReviewsInitial = function(result, eventArgs)
{
    if (result > 0)
    {
        document.getElementById('ReviewListGroupMaxItm').value = result;
        MusicPortalJS.Paging.GoToIndex(1, 'ReviewListGroup');
    }
}


