$a = 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; }
};
function create_div( _str, _msgw, _msgh ){
    var bgObj=document.createElement("div");
    bgObj.setAttribute('id','bgDiv');
    bgObj.style.position="absolute";
    bgObj.style.top="0px";
    bgObj.style.left="0px";
    bgObj.style.background="#FFFFFF";
    bgObj.style.opacity="0.60";
    bgObj.style.filter = "alpha(opacity=60)";
    bgObj.style.width="100%";
    bgObj.style.height=document.body.scrollHeight + "PX";
    bgObj.style.zIndex = "10000";
    document.body.appendChild(bgObj);
    var msgObj = document.createElement("div");
    var _width = document.body.clientWidth;
	var _height = document.documentElement.clientHeight||document.body.clientHeight;
    var LeftPosition = (_width) ? (_width - _msgw)/2 : 0  ;
    var TopPosition = (_height) ? (_height - _msgh)/2 + document.documentElement.scrollTop : 0 ;
    msgObj.setAttribute("id","msgDiv");
    msgObj.setAttribute("align","center");
    msgObj.style.position = "absolute";
    msgObj.style.border="0";
    msgObj.style.left = LeftPosition + "px";
	msgObj.style.top  = TopPosition + "px";
    msgObj.style.width = _msgw + "px";
    msgObj.style.height = _msgh + "px";
    msgObj.style.textAlign = "center";
    msgObj.style.zIndex = "10001";
    msgObj.innerHTML= _str;
    document.body.appendChild(msgObj);
};
function open_fav( _id, _type ){
    create_div( '<iframe id="ifm" src="/inc/fava.php?no='+_id+'" frameborder="0" width="500" height="206" scrolling="no"></iframe>', 500, 206 );
};
function open_down( _id ){
    create_div( '<iframe id="ifm" src="/inc/dlogin.php?no='+_id+'" frameborder="0" width="500" height="206" scrolling="no"></iframe>', 500, 206 );
};

function close_div(){
    document.body.removeChild($a("bgDiv"));
    document.body.removeChild($a("msgDiv"));
};

$ = function(em){	return document.getElementById(em);	};
$F = function(em){	return document.getElementById(em).value;	};

var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
var ver = "";
var VER_IE6 = "IE6";
var VER_IE7 = "IE7";
var VER_FE = "FE";

function stopError() {
return true;} 
window.onerror = stopError;


//全选
function CheckAll(form){
	for (var i=0;i<form.elements.length;i++){
		var e = form.elements[i];
		e.checked = true;
	}
}
//反选
function CheckAllfan(form){
	for (var i=0;i<form.elements.length;i++){
		var e = form.elements[i];
			if (e.checked==false)	e.checked = true;
			else			e.checked = false;
	}
}
//播放
function MusicPlay(myform){
	var strCBValue = "/lplay.php?no=0";	
	var checknum=0;
	var N = myform.elements.length;
	for (var i=0;i<N;i++){
		var e = myform.elements[i];
		if (e.type=="checkbox"){
			if(e.checked){
					strCBValue = strCBValue + "_" + e.value;	
					checknum=checknum+1;				
			}
		}
	}
	if(strCBValue=="/lplay.php?no=="){
		alert("请选择要播放的歌曲(可多选)");
		return false;
	}else{	
		if(checknum>100){
			alert("系统限制100首歌曲连播，您选择了"+checknum+"首歌曲超出了"+(checknum-100)+"！");
			return false;
		}else{
			window.open(strCBValue,'dj22_player');
		}
	}
}
//按钮导航条
function ChangeDiv(N,K,it){
	for(i=1;i<N+1;i++){
		$(it+"t_"+i).className="n";
		$(it+"b_"+i).className="n";
	}
	$(it+"t_"+K).className="y";
	$(it+"b_"+K).className="y";
}
document.writeln('  <script  language="JavaScript">  ')
document.writeln('  self.moveTo(0,0)  ')
document.writeln('  self.resizeTo(screen.availWidth,screen.availHeight)  ')
document.writeln('  </script>')
