function addComment(scene) {
	var comment = $('newComment').value;
	var par = 'action=add&item_id=' + scene + '&comment=' + escape(comment);
	
	if (comment == "") {
		alert("Unable to add your comment since it contains no text.");
		return;
	}
	var ajax = new Ajax.Request ('/ajax/comment_action.php', {
			method: 'post',
			parameters: par,
			onLoading: function(request) {},
			onComplete: function(request) {
			    Element.hide("newCommentContainer");
			    Element.show("thankYouContainer");
			},
			onFailure: function(request){} 
		}
	);
}

function rateComment(member, comment_id, rating) {
        var par         = 'action=bump&comment_id=' + comment_id + '&bump=' + rating;
        var bump_rating = $(member).innerHTML;

        //window.location = "includes/comment_action.php?" + par;
        var ajax = new Ajax.Request( '/ajax/comment_action.php', {
                                    method: 'post',
                                    parameters: par,
                                    onLoading: function(request) {},
                                    onComplete: function(request) {
                                        try {
	                                        var new_rating = parseInt(bump_rating) + parseInt(rating);
	                                        var code = parseInt(request.responseText);
	                                        
	                                        if(code == 1) {
	                                            $(member).innerHTML = new_rating;
	                                            if( new_rating < 0 ) {
	                                                $(member).className = "neg";
	                                            } else {
	                                               	$(member).className = "pos";
	                                            }
	                                        }
											else if(code == 3) {
	                                            alert("You have already rated this comment.");
											} else {
	                                            alert("Unable to rate comment.");
	                                        }
                                        } catch (e) {
                                        	alert('err');
                                        }
                                    },
                                    onFailure: function(request){} 
                                } 
                            );
    }
