/***************** Editor Comment *****************/
function getEditor(name)
{
	tinyMCE.init({
		mode : "exact",
		elements : "txt_write_comment",
		theme : "advanced",
		entities : "",
		plugins : "inlinepopups,emotions,eBizIcon",
		theme_advanced_buttons1 : "mybutton,bold,italic,underline,justifyleft,justifycenter,justifyright,justifyfull,forecolor,emotions,eBizIcon,fontselect,fontsizeselect",
		theme_advanced_buttons2 : "",
		theme_advanced_buttons3 : "",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_statusbar_location : "none",
		theme_advanced_resizing : false,
		setup: function(ed) {
			ed.addButton('mybutton', {
				label : name,
				onclick : function() {

				}
			});
		}
	});
}

function sendComment(type, newpage)
{
	contentComment 		= tinyMCE.get('txt_write_comment').getContent();
	intComment = document.getElementById('ComentsTotal').value;
	if($.trim(contentComment) == "")
	{
		alert('Vui lòng nhập Bình Luận');
		$("#txt_write_comment").focus();
		return false;
	}
	else
	{
		if (contentComment != '<p>Hãy cho mọi người biết ý kiến của bạn đi nào!</p>')
		{
			if(type==1)
			{
				document.getElementById('hrefSendComment').disabled = true;
				ajax_insertCommentSong(strMemberUsername, intMemberId, intDecSongId, contentComment, intComment, strTitle, newpage);
				tinyMCE.get('txt_write_comment').setContent('<p>Hãy cho mọi người biết ý kiến của bạn đi nào!</p>');
			}
			else
			{
				document.getElementById('hrefSendComment').disabled = true;
				ajax_insertCommentPlaylist(strMemberUsername, intMemberId, intDecPlaylistId, contentComment, intComment, strTitle, newpage);				
				tinyMCE.get('txt_write_comment').setContent('<p>Hãy cho mọi người biết ý kiến của bạn đi nào!</p>');
			}
		}
	}
}