function insertAutoplay()
{
	if (document.getElementById('chkAutoPlay').checked)
	{
		document.getElementById('blog').value = strEmbedBlogAutoPlay;
	}
	else
	{
		document.getElementById('blog').value = strEmbedBlog;
	}
}
ajax_updateListenQty(1, intDecSongId);
function getCommentListJS($p_intMemID, $p_intId, $p_intType, $p_intLimitStart, $p_intNewPage)
{
	ajax_getCommentList($p_intMemID, $p_intId, $p_intType, $p_intLimitStart, $p_intNewPage);
}

function delIT(idComment, idPlaylist, inTotal, intNewPage)
{
	if ( idComment != '' )
	{
		ajax_deleteCommentSong(intMemberId, idComment, idPlaylist, inTotal, intNewPage);
	}
}

function setSongFavorite()
{
	if (intAppUIMemberId < 0)
		caobox.show_popup('ym_popup_login_outer');
	else
	{
		if(!document.getElementById('btnSetFav').disable)
		{
			setFavorite(intMemberId, strMemberUsername, intDecSongId, strTitle);
			document.getElementById('btnSetFav').disable = true;
		}
	}
}

function setFavorite($p_intMemID, $p_strMemberUsername, $p_intId, $p_strTitle)
{
	ajax_setFavorite($p_intMemID, $p_strMemberUsername, $p_intId, "0", $p_strTitle);
}

function setSongHot()
{
	if (intAppUIMemberId < 0)
		caobox.show_popup('ym_popup_login_outer');
	else
	{
		if(song_ishot>0)
		{
			if(confirm('Bạn có muốn thay thế Bài hát "' + strTitle + '" cho Bài hát nổi bật hiện tại ?'))
			{
				if (intDecSongId == song_ishot)
				{
					alert('Bài hát "' + strTitle + '" đã được chọn làm nổi bật . Vui lòng chọn Bài hát khác!');
					return false;
				}
				else
					setHot(intDecSongId, strTitle, 0);
			}
		}
		else
		{
			setHot(intDecSongId, strTitle, 0);
		}
	}
}

function setHot(intID, strTitle,type)
{
	ajax_setHot(intID, strTitle, type);
}


function messageDownload()
{
	if (intAppUIMemberId < 0)
		caobox.show_popup('ym_popup_login_outer');
	else
		caobox.show_popup('ym_popup_download_captcha');
}

function downloadMusic()
{
	if (intAppUIMemberId < 0)
		caobox.show_popup('ym_popup_login_outer');
	else
		ajax_getDownload(document.getElementById("frmDownload").txtDownloadCapcha.value, p1);
}
insertAutoplay();