function addComment()
{
	$('#parent_comment_div').css('display','block');
}	
	
function saveComment()
{
	$.ajax({
		contentType: "application/x-www-form-urlencoded; charset=iso-8859-2",
		type: "POST",
		url: "ajax_comments_table_helper.php",
		data: "text=" + $('#text_comment').get(0).value + 
				"&id=" + $('#id').get(0).value + "&action=add" + "&type=" + $('#type').get(0).value,
		success: function(obj)
		{
			//alert(obj);
			$('#comment_div').get(0).innerHTML = obj;
		}
	});
}	

function hideComment(comment_id)
{
	$.ajax({
		contentType: "application/x-www-form-urlencoded; charset=iso-8859-2",
		type: "POST",
		url: "ajax_comments_table_helper.php",
		data: "comment_id=" + comment_id + "&action=hide&type=" + $('#type').get(0).value + 
		 "&id=" + $('#id').get(0).value,
		success: function(obj)
		{
			//alert(obj);
			$('#comment_div').get(0).innerHTML = obj;
		}
	});
}

function reloadCommentsTable(value){
	$.ajax({
		contentType: "application/x-www-form-urlencoded; charset=iso-8859-2",
		type: "POST",
		url: "helpers/ajax_category_select_helper.php",
		data: "category=" + value,
		success: function(obj)
		{
			//alert(obj);
			$('#for_ajax_table').get(0).innerHTML = obj;
		}
	});
}

function addMovieToFever(id, type)
{
	$.ajax({
		contentType: "application/x-www-form-urlencoded; charset=iso-8859-2",
		type: "POST",
		url: "ajax_fevers.php",
		data: "movie_id=" + id + "&type=" + type,
		success: function(obj)
		{
			//alert(obj)
			$('#fever_movie_info').get(0).innerHTML = obj;			
		}
	});
}

function addAuthorsToFever(authors)
{
	//alert(authors)
	$.ajax({
		contentType: "application/x-www-form-urlencoded; charset=iso-8859-2",
		type: "POST",
		url: "ajax_fevers.php",
		data: "authors=" + authors,
		success: function(obj)
		{
			if ($('#fever_authors_info').get(0) != undefined)
				$('#fever_authors_info').get(0).innerHTML = obj;
			else alert('Autora dodano');			
		}
	});
}