function onBeforeUnloadWindow(){
        if(!isCommentBodyEmpty() && !isOnSubmit()){
            return Messages("common.comment.beforeunload.confirm");
        }
    }
Handles beforeunload event of window
In case of commentBody is not empty, show confirm to exit page.
Browser will shows confirm dialog with returned message string.