function showComments(){
	$('.allComments').click(function(){
		tutorial = this.id;
		start = this.title;


		$.ajax({
			type: 'POST',
			url: '/_functions.php',
			data: 'func=getComments&tutorial='+tutorial+'&start='+start,
			cache:false,
			success: function(response){
				response = unescape(response);
				$('.allComments').hide();
				$('.userComments').append(response);

			}
		});
	});//END app_publishButton
};

$(document).ready(function () {
	$('.button').click(function(){
		var comment = $('#comment').val();
		var name = $('#name').val();
		var email = $('#email').val();
		var website = $('#website').val();
		var tutename = $('#tutename').val();
		$.ajax({
			type: 'POST',
			url: '/_functions.php',
			data: 'func=postComment&comment='+comment+'&name='+name+'&email='+email+'&website='+website+'&tutename='+tutename,
			cache:false,
			success: function(response){
				response = unescape(response);
				var newPos = $('.userComments').offset();topPos = newPos.top;
				r = response;
				var response = response.split("|");
				responseType=response[0];
				if(responseType=='success'){
					$('.userComments').prepend(response[1]);
						$('#comment').val(''); $('#name').val('');$('#email').val('');$('#website').val('');$('#tutename').val('');
						$('html,body').animate({scrollTop: topPos}, 1000);
				}else if(responseType=="error"){
					alert(response[1]);
				}else{
					alert(r);
				}
				
			}
		});
	});//END app_publishButton
});