//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>Comment By "+AuthorText+"</h3>";
else AuthorText = "<h3>Comment By <a href='"+AuthorUrl+"'>"+AuthorText+"</a></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="Preview" class="button" onclick="ReloadTextDiv()" />');
}