﻿
// 显示播放器

var playerAction = new Object();

playerAction.prelisten = "0";
playerAction.order = "1";
playerAction.present = "2";
function pauseRandomPlayer()
{
    if(typeof(ctl00_ContentPlaceHolder1_RoundPlayer1_PlayerControler) != 'undefined' )
    { 
        ctl00_ContentPlaceHolder1_RoundPlayer1_PlayerControler.pause();
    }
}


//打开铃音播放器
function showPlayer(ringNo, action, progCode)
{
    pauseRandomPlayer();
    window.open("http://he.10155.com/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("http://he.10155.com/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("http://he.10155.com/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)
{ 
    window.open("LibraryPlayer.aspx?url=" + prelistenUrl, "libraryPlayer", "width=370px,height=150px,toolbar=no").focus();
}
