$(document).ready(function(){
	$('input.commentSubmit').click(function(){
		var objectID = $('.commentSubmit').attr('id');
		var comAuthor = $('.commentLineUser input').val();
		var comAuthor = $('.commentLineUser input').val();
		var comText = $('.commentLineMessage textarea').val();
		$('.commentLineMessage textarea').attr('disabled','disabled');
		$('.commentLineUser input').attr('disabled','disabled');
		$('.commentSubmit').attr('disabled','disabled');
		$.post('/'+$('#commentLang').val()+'/comments',{'fun':'submit','objectID':objectID,'commentsText': comText,'comAuthor':comAuthor},function(comData){
			alert(comData);
		});
		return false;
	});
	
	$('.commentDelete').click(function(){
		var comID = $(this).attr('comid');
		$.post('/lv/comments',{'fun':'delete','comID':comID},function(comData){
			if(comData=='OK'){
				$('.commentLineContainer#cml'+comID).fadeOut(1000);
			}else{
				alert(comData);
			};
		});
		
	});
});
