//javascript function for inline comment preview

function ReloadTextDiv()
{
var CommentText = document.getElementById("comment").value;
var AuthorText = document.getElementById("author").value;
var AuthorUrl = document.getElementById("url").value;
var CommentElement = document.getElementById("preview-div");
if(AuthorText == '') AuthorText = "Anonymous";
CommentText = CommentText.split(/\n/).join("<br />");
if(AuthorUrl == '') AuthorText = "<h3>"+AuthorText+" sagt ...</h3>";
else AuthorText = "<h3><a href='"+AuthorUrl+"'>"+AuthorText+"</a> sagt ...</h3>";
CommentElement.innerHTML = AuthorText+" <div>"+CommentText+"</div>";
document.getElementById("preview-div").style["display"] = "block";
}


function PreviewButton()
{
document.write('<input name="preview" id="preview" type="button" tabindex="6" value="Vorschau" class="button" onclick="ReloadTextDiv()" />');
}

