﻿function selectAll(t)
{
    var checkboxs = document.getElementsByName('checkbox_' + t);
    for (var i = 0; i < checkboxs.length; i++)
    {
        checkboxs[i].checked = true;
    }
}

function selectReverse(t)
{
    var checkboxs = document.getElementsByName('checkbox_' + t);
    for (var i = 0; i < checkboxs.length; i++)
    {
        if (checkboxs[i].checked)
        {
            checkboxs[i].checked = false;
        }
        else
        {
            checkboxs[i].checked = true;
        }
    }
}

function playList(t, order, sort)
{
    var checkboxs = document.getElementsByName('checkbox_' + t);
    var idList = '';
    for (var i = 0; i < checkboxs.length; i++)
    {
        if (checkboxs[i].checked)
        {
            idList += checkboxs[i].value + ',';
        }
    }
    
    if (idList != "")
    {
        var URL= "/play/" + idList + "+" + order + "+" + sort + ".html";
        var width=693;
        var height=600;
        var left = ( screen.width - width ) / 2;
        var top = ( screen.height - height ) / 2;
        window.open(URL,'','width='+width+',height='+height+',top='+top+',left='+left+',scrollbars=0,resizable=0');
    }
    
    return false;
}

function popMusic(obj) 
{
    URL=obj.href;
    var width=693;
    var height=600;
    var left = ( screen.width - width ) / 2;
    var top = ( screen.height - height ) / 2;
    window.open(URL,'','width='+width+',height='+height+',top='+top+',left='+left+',scrollbars=0,resizable=0');
    return false;
}

function popWin(obj,width,height) 
{
    URL=obj.href;
    
    if (width == '' || width==null)
    {
        width=693;
    }
    if (height == '' || height==null)
    {
        height=600;
    }
    var left = ( screen.width - width ) / 2;
    var top = ( screen.height - height ) / 2;
    window.open(URL,'','width='+width+',height='+height+',top='+top+',left='+left+',scrollbars=0,resizable=0');
    return false;
}

function changeTag(id, count, prefix)
{
    for (var i = 1; i <= count; i++)
    {
        var tag = document.getElementById(prefix + "_menu_" + i);
        var ul = document.getElementById(prefix + "_tag_" + i);
        
        if (i == id)
        {
            tag.className = "tags_active";
            ul.style.display = "block";
        }
        else
        {
            tag.className = "tags_inactive";
            ul.style.display = "none";
        }
    }
}


