﻿var comments = null;
Type.registerNamespace("cancercompass.controls");
cancercompass.controls.Comments = function(){

}
cancercompass.controls.Comments.prototype = {
    initialize : function(){
        setTimeout("comments.tinyMCE()",1000);
        $("a[id*='lnkCommentSubmit']").click(function(){
            tinyMCE.triggerSave(false,true);
            return clientVal("comments",false);
        });
    },
    tinyMCE : function(){
        // init TinyMCE
        jQuery.getScript("/common/scripts/jquery.tinymce.js",function(){
            $(".tinymce").tinymce({
		        script_url : '/common/scripts/tiny_mce.js',
		        theme : "advanced",
                theme_advanced_buttons1:"bold,italic,underline",
                theme_advanced_buttons2:"",
                theme_advanced_buttons3:"",
                theme_advanced_buttons4:"",
                theme_advanced_toolbar_location:"top",
                theme_advanced_toolbar_align:"left",
                content_css:"/common/styles/tinymce.css",
                valid_elements: "+div[class],+strong[class]/b,ul[type|class],ol[type|class],b,li[type|class|id],blockquote,em/i,u,br[clear],+p[class|id|align],+table[class:cellpadding|cellspacing|border],+th[class],+tr[class],+td[class],+label[class],+tbody[class],+tfoot[class],+thead[class]"
	        });
        });
    }
}
$(document).ready(function(){
    comments = new cancercompass.controls.Comments;
    comments.initialize();
});