﻿// 显示播放器

var playerAction = new Object();

playerAction.prelisten = "0";
playerAction.order = "1";
playerAction.present = "2";
playerAction.givensong = "3";
function pauseRandomPlayer()
{
    if(typeof(ctl00_ContentPlaceHolder1_RoundPlayer1_PlayerControler) != 'undefined' )
    { 
        ctl00_ContentPlaceHolder1_RoundPlayer1_PlayerControler.pause();
    }
}


//打开铃音播放器
function showPlayer(ringNo, action, progCode)
{
    pauseRandomPlayer();
    window.open("OrderRing.aspx?ringNo=" + ringNo + "&type=" + action + "&ProgCode=" + progCode+"&Seed="+new Date().getMilliseconds(), "player", "width=930px,height=600px,toolbar=no").focus();
}

//打开节日定制的播放器
function showFestivalPlay(ringNo, action, progCode, seed)
{
    pauseRandomPlayer();
    window.open("../../OrderRing2.aspx?ringNo=" + ringNo + "&type=" + action + "&ProgCode=" + progCode+"&Seed="+seed, "player", "width=930px,height=600px,toolbar=no").focus();
}

//打开铃音播放器，播放多首歌曲
function showPlayerMulti(ringInfos, progCode)
{
    if(ringInfos && ringInfos != "")
    {
        pauseRandomPlayer();
        var url="OrderRing.aspx?RingInfos=" + ringInfos + "&ProgCode=" + progCode+"&seed="+new Date().getMilliseconds();
        if(url.length>1950)
        {
            alert('您选择的铃音太多了，\r请少选几个！');
            return;
        }
        window.open(url, "player", "width=930px,height=600px,toolbar=no").focus();
    }
    else
    {
        alert("请先选择要播放的铃音。");
    }
}

//打开音乐盒播放器
function showRingboxPlayer(ringboxNo)
{
    pauseRandomPlayer();
    window.open("OrderRingbox.aspx?RingboxNo=" + ringboxNo,"player", "width=930px,height=600px,toolbar=no").focus();
}
function ShowRingboxPlayer(ringboxNo,progCode)
{
if (progCode=="0040") {
    isRingBox="1";
}
else
{
    isRingBox="0";
}
    pauseRandomPlayer();
    window.open("OrderRingbox.aspx?RingboxNo=" + ringboxNo+"&isRingBox="+isRingBox,"player", "width=930px,height=600px,toolbar=no").focus();
}
function showRingBagPlayer(ringbagNo)
{
    pauseRandomPlayer();
    window.open("OrderRingbag.aspx?RingbagNo=" + ringbagNo,"player", "width=930px,height=600px,toolbar=no").focus();
}

function showLibraryPlayer(prelistenUrl, ringName, ringAuthor)
{ 
    window.open("LibraryPlayer.aspx?url=" + encodeURI(prelistenUrl)+"&ringName="+encodeURI(ringName)+"&ringAuthor="+encodeURI(ringAuthor), "libraryPlayer", "width=448px,height=200px,toolbar=no").focus();
}
 