function blogComments( offset) {
	var req = '/ajax/Blog/comments/'+$('#blogId').val()+',0,'+$('#entryId').val()+'/'+offset;
	$.get( req, blogCommentsClb);
	$('#comments').slideUp( 'fast');
}
function blogCommentsClb( msg) {
	$('#comments').html( msg);
	$('#comments').slideDown();
}
function blogOffset( offset, type, blogId, date) {
	var req = '/ajax/Blog/grid/'+blogId+','+offset+',0,'+type+','+date;
	if ($('#searchQuery').val() != '' && $('#searchQuery').val() != $('#searchQuery').attr( 'title')) {
		req += '?q='+$('#searchQuery').val();
	}
	$.get( req, blogOffsetClb);
}
function blogOffsetClb( msg) {
	if (!msg) {
		return( false);
	}
	$('#blogGrid').html( msg);
}
var blogDates = '';
var blogDateHref = '';
function blogIsDateSelectable( date) {
//	alert( date.getFullYear()+'-'+(date.getMonth()+1)+'-'+date.getDate());
	var selectable = (blogDates.indexOf( ','+date.getFullYear()+'-'+(date.getMonth()+1)+'-'+date.getDate()+',') >= 0);
	return( [selectable, ((selectable) ? 'blogDateSelectable' : '')]);
}
function blogDateSelec( date) {
	var defaultLoc = [0,0,0,0,'']
	
	window.location.href = blogDateHref+date;
//	alert( date);
}
function blogRate( caller, blogId) {
	if (!caller.title) {
		return( false);
	}
	$.get( '/ajax/Blog/rate/'+blogId+'/'+caller.title, blogRateClb);
}
function blogRateClb( msg) {
	if (!msg) {
		return( false);
	}
	var num = Number( msg);
	if (num == -1) {
		window.location.href = '/User';
		return( true);
	}
//	$('#blogRatings img').attr( 'src', '/img/bStars'+num.toFixed()+'.png');
	$('#activeStars span').text( num.toFixed( 2).replace( '.', ','));
}
