function request_new_comments(pid){
	ajax('requestNewComments','&pid='+pid,
		function(ndata){
			document.getElementById('blog_comments_'+pid).innerHTML=''+ndata+'';
			document.getElementById('div_comments_'+pid).style.display='block';
		}
	);
}

function ajax_addcomment(pid,iname,icontent,iemail){

	$('cmt_status').innerHTML='<img src="/_img/loading.gif" alt="Speichere... " title="lade" /> Speichere...';
	Element.hide('cmt_form');

	var handler = function(x){
		ndata=ajax_strip(x.responseText);
		answer=ndata.split('|||');
		if(answer[0]=='err'){
			alert(answer[1]);
			$('cmt_status').innerHTML='';
			Element.show('cmt_form');
		}else if(answer[0]=='suc'){
			request_new_comments(pid);
			myLightbox.end();
		}
	}

	icontent=encodeURIComponent(icontent);
	iname=encodeURIComponent(iname);
	iemail=encodeURIComponent(iemail);

	new Ajax.Request(_wp+'logz_ajax.php', {asynchronous:'false', method:'post', parameters:'fn=addCommentSave&pid='+pid+'&iname='+iname+'&icontent='+icontent+'&iemail='+iemail, onSuccess:handler});

}
