
var handleSubmitCommentSuccess = function(o) {
	
	if (o.responseText == 'auth_error') {
		alert('XHR: Autentikációs hiba!');
	} else {
		//$('d_comments').innerHTML = o.responseText;
		//document.location.reload();
		document.location = '/video/' + o.responseText;
	}
}

var handleSubmitCommentFailure = function(o) {
	alert('XHR-hiba! CommentSubmit');
}

var callbackSubmitComment = {
	success:handleSubmitCommentSuccess, 
	failure:handleSubmitCommentFailure
};


function submitComment(id, kind, body) {
	if (body != '') {
		var request = YAHOO.util.Connect.asyncRequest('GET', '/xhr.php?t=submit_comment&kind=' + kind + '&id='+ id + '&message=' + body, callbackSubmitComment);
	} else {
		alert('Töltsd ki az üzenet mezőt!');
	}
}




