function Dynamic()
{
}

Dynamic.content = "model.content";
Dynamic.uri = "../../content/dynamic/comment-create.xhtm";

Dynamic.comments = function ()
{
    var comments = document.getElementById("comments");
    
    if(comments==undefined || comments==null)
        return;
    
    if(comments.offsetHeight>300)
        comments.style.height = "300px";
}

Dynamic.replaceTextarea = function ()
{
    var editor = new FCKeditor(Dynamic.content);
    editor.BasePath = "../../common/script/fckeditor/";
    editor.Height = "200";
    editor.ToolbarSet = "Basic";
    editor.ReplaceTextarea();
}

Dynamic.createComment = function (form)
{
    form.elements["submit"].disabled = true;
    form.elements[Dynamic.content].value = FCKeditorAPI.GetInstance(Dynamic.content).GetHTML();
    
    dojo.io.bind({url:Dynamic.uri,
        formNode:form,
        method:form.method,
        useCache:false,
        handler:Dynamic.update,
        mimetype:"text/html"});
    
    return false;
}

Dynamic.update = function (type, data, event)
{
    alert(data);
    
    location = location;
}
