﻿function showCommentEditor(CommentId, DocumentId)
{
/*    var EditorWindow = document.getElementById("divEditorShadow");

    var DialogOffsetTop = document.documentElement.scrollTop + 50;
    var DialogOffsetLeft = (document.documentElement.clientWidth - 673)/2;
    document.getElementById("divGrayWindow").style.display="block";
    EditorWindow.style.top = DialogOffsetTop + 50;
    EditorWindow.style.left = DialogOffsetLeft;
    
    EditorWindow.style.display="block";
    document.getElementById("editor").style.display="block";

    document.getElementById("editor").src="commenteditor.aspx?commentid=" + CommentId + "&DocumentID=" + DocumentId;
*/
    showClientWindow("commenteditor.aspx?commentid=" + CommentId + "&DocumentID=" + DocumentId,"435px");
}



function closeCommentEditor()
{
    parent.document.getElementById("divGrayWindow").style.display="none";
    parent.document.getElementById("divEditorShadow").style.display="none";
    parent.document.getElementById("editor").style.display="none";
}

function change(returnPage)
{
    closeCommentEditor()
    
    parent.document.location.href=returnPage;
}

/***************************************************
 *
 *  Forum scripts
 *
 ***************************************************/

function createThread()
{
    showClientWindow("createThread.aspx","435px");
}

function sendReply(ParentId)
{
    showClientWindow("forumreply.aspx?parentid=" + ParentId,"435px");
}

function showClientWindow(source, height)
{
    var EditorWindow = document.getElementById("divEditorShadow");

    var DialogOffsetTop = document.documentElement.scrollTop + 50;
    var DialogOffsetLeft = (document.documentElement.clientWidth - 673)/2;
    document.getElementById("divGrayWindow").style.display="block";
    EditorWindow.style.top = DialogOffsetTop + 50;
    EditorWindow.style.left = DialogOffsetLeft;
    
    EditorWindow.style.display="block";
    document.getElementById("editor").style.display="block";

    document.getElementById("editor").style.height=height;
    document.getElementById("editor").src=source;
}
