window.onerror=function(){ return true; };
CurrentID = 1;
function ChangeLayer(iSrc)
{
	var TarOB = eval("document.all.VW_" + CurrentID);
	if(TarOB != null){TarOB.style.display = "none";}

	var SrcOB = eval("document.all.VW_" + iSrc);
	SrcOB.style.display = "block";

	var TarOB = eval("document.all.VC_" + CurrentID);
	var SrcOB = eval("document.all.VC_" + iSrc);
	TarOB.className = "right238_BG_select2";
	SrcOB.className = "right238_BG_select";
	CurrentID = iSrc;
}
$$ = function(em) {
    if (document.getElementById){ return document.getElementById(em); }
    else if (document.all){ return document.all[em]; }
    else if (document.layers){ return document.layers[em]; }
    else{ return null; }
};

$$F = function(em){	return document.getElementById(em).value;	};

function show_select(_title, _options, _input){
    option_obj = $$(_options);
    option_obj.style.display = (option_obj.style.display == '') ? 'none' : '';
    option_obj.onblur = function() { option_obj.style.display = 'none'; };
    option_obj.focus();
    for (var i = 0; i < option_obj.childNodes.length; i++){
        option_obj.childNodes[i].onmouseover = function(){ this.className = 'options_over pointer'; };
        option_obj.childNodes[i].onmouseout = function(){ this.className = 'options_out pointer'; };
        option_obj.childNodes[i].onclick = function(){
            $$(_title).innerHTML = this.innerHTML;
            $$(_input).value = this.id;
            option_obj.blur();
            option_obj.style.display = 'none';
        }
    }
 };


function get_tags(parentobj, tag){
    if (typeof parentobj.getElementsByTagName != 'undefined'){ return parentobj.getElementsByTagName(tag);
    }else if (parentobj.all && parentobj.all.tags){ return parentobj.all.tags(tag);
    }else{ return new Array(); }
};

function clk(_act, _id, _tid) {
    var v = [];
    var a = get_tags($$(_id), 'input');

    for (var i = 0; i < a.length; i++) {
        if (_act == 'all' ) {a[i].checked = true;}
        else if (_act == 'un' ) { a[i].checked = (a[i].checked) ? false : true; }
		else if (_act == 'rundom' ) {
			var checkobj=document.getElementById(_id);
			var cboxs=checkobj.getElementsByTagName("input");
			var num=cboxs.length;			
			for(i=0;i<cboxs.length;i++){
				if(cboxs[i].type=="checkbox") cboxs[i].checked=false;
			}
			for(j=0;j<51;j++){
				var roundNum=Math.random()*num;
				if(cboxs[roundNum].type=="checkbox") {
						cboxs[roundNum].checked=true;
				}
			}			
		}else { if (0 < a[i].value && a[i].checked){ v.push(a[i].value); } }
    }
    if ( 'play' == _act ) {
        if (3 > v.length){ 
			alert('至少选择三首歌曲以上才能进行连播！'); 
			return; 
		}else if(v.length > 60){
			alert('一次最多连续播放30首歌曲！'); 
			return; 
		}else{
			window.open('../?cs=lb-id-' + v.join(',')+'.html', 'play');
		}
    }
};


