Afisha = {
	showAddCommentForm: function()
	{
		$('commentDiv').style.display = "block";
		$('hideCommentForm').style.display = "block";
		$('showCommentForm').style.display = "none";
	},
	hideAddCommentForm: function()
	{
		$('commentDiv').style.display = "none";
		$('hideCommentForm').style.display = "none";
		$('showCommentForm').style.display = "block";
	},
	commentSend: function(eventId)
	{
		var err = false;
		View.clearErrors('commentEmpty');
		View.clearErrors('commentLong');
		var textObj = $('commentTextForm');
		var text = textObj.getValue();

		if(text == '') {
			err = true;
			View.showErrors('commentEmpty');
		} else if(text.length > 2000) {
			err = true; 
			textObj.setValue(text.substr(0, 2000));
			View.showErrors('commentLong');
		}
		if (err == false) {
			Afisha.hideAddCommentForm();
			textObj.setValue('');
			var argsObj = new Object();
			argsObj["operation"]   = "sendComment";
			argsObj["eventId"]     = eventId;
			argsObj["commentText"] = Filter.encodeURIComponent(text);
			makeCall('Afisha/showAfisha', argsObj);
		}
	},
	showCalendar: function()
	{
		$('calendarDiv').style.display = "block";
	},
	hideCalendar: function()
	{
		$('calendarDiv').style.display = "none";
	},
	toComments: function()
	{
		$('commentsArea').scrollTo();
	}
}