﻿function MakeForm(id) {
 	text = $E('p', 'comment' + id).innerHTML;
 	text = text.split("<br>").join("");
 	bittewarten = "&lt;img src=\\'/style/monsterball.gif\\' alt=\\'\\' /\&gt;";
	
	$('commentpost' + id).innerHTML = '<form id="comment_form_' + id + '"><input type="hidden" name="do" value="editcomment" /><input type="hidden" name="id" value="' + id + '" /><textarea cols="50" rows="5" name="content">' + text + '</textarea><br /><input type="button" value="Bearbeiten" onclick="$(\'commentpost' + id + 'a\').innerHTML = \'' + bittewarten + '\'; new Ajax(\'/kaihou/ajax.php\', {postBody: $(\'comment_form_' + id + '\'), update: $(\'comment' + id + '\')}).request()" /> oder <span onclick="$(\'commentpost' + id + 'a\').innerHTML = \'' + bittewarten + '\'; new Ajax(\'/kaihou/ajax.php\', {postBody: \'do=delcomment&id=' + id + '\', update: $(\'comment' + id + '\')}).request();"><img src="/kaihou/delete.gif" title="Löschen" alt="Löschen" border="0" style="cursor: pointer;" /></span></form>';
}

function loadContentMore(id) {
	$('newsmore' + id).innerHTML = '<?=$_bittewarten;?>';
	new Ajax('/kaihou/news_more.php', {postBody: 'id=' + id + '', update: $('newsmore' + id)}).request();
	setTimeout('hs.setClickEvents(); hs.updateAnchors();', 1500);
}

function insertTags(str, i) {
	if (i==1) {
		document.getElementsByName('content')[0].value += str;
	} else if (i==2) {
		document.getElementsByName('content_more')[0].value += str;
	}
}