if (top.location != location) top.location.href = location.href;
self.moveTo(0,0)  
self.resizeTo(screen.availWidth,screen.availHeight)
function songersuiji(songerid){window.open("http://play.51wma.com/playall2.asp?songerid="+songerid+"");return false;}
function playlb(songlist){window.open("http://play.51wma.com/playall2.asp?check="+songlist+"");return false;}

//收藏到曲库
function SavaMusic()
{
  var data_arr,PList;
  PList="";
  //取出当前选中的项
  data_arr = document.getElementsByTagName("input");
  if(0==data_arr.length)
  {
	return false;
  }
	for(var i=0;i<data_arr.length; i++)
	{
		if("checkbox" === data_arr[i].getAttribute("type"))
			if (data_arr[i].checked==true)
			{//检测是否重复
			  PList=PList+data_arr[i].value+"|";
			}
	}
   	
  if (PList=="")
  {
    MyBox("未选中歌曲,收藏失败","#");
    return false;
  }
  else
  {
   MyBox("","http://my.51wma.com/AspLib/MusicSava.asp?PList="+PList);
  }
  return false;
 }

//通用对话框
var winbox;
function MyBox(IStr,URL)
{ 
 var IHTML;
 winbox = document.createElement('div');
 document.body.appendChild(winbox);
 IHTML="";
 IHTML+="<div id=boxConter style='position:absolute; left:0px; top:0px; width:1px; height:1px; z-index:20; background-color: #F3FBFF;'></div>";
 IHTML+="<div id=box style='position:absolute;width:293px; height:102px; z-index:21; background-color: #F3FBFF; layer-background-color: #F3FBFF;border-top-width: 1px;border-right-width: 1px;border-bottom-width: 1px;border-left-width: 1px;border-top-style: solid;border-right-style: solid;border-bottom-style: solid;border-left-style: solid;border-top-color: #CCCCCC;border-right-color: #000000;border-bottom-color: #000000;border-left-color: #CCCCCC;'>";
 IHTML+="<img src='http://my.51wma.com/MusicImage/TitImage.gif' onMouseDown='down1()' onMouseMove='move1()' onMouseUp='javascript:count=0;'></img>";
 if (URL=="#" || IStr=="是否删除曲库中相应的歌曲?")
 {
   IHTML+="<div>　<font size='-1'>"+IStr+"</font></div>";
  }
 else   
 {
  IHTML+="<iframe frameborder='0' width='293' height='30' scrolling='no' src='"+URL+"'></iframe>";
 }
 
 if(IStr=="是否删除曲库中相应的歌曲?")
 {
  IHTML+="<br> 　　　 　　";
  IHTML+="<input Type='Image' value='Submit' src='http://my.51wma.com/MusicImage/But_Y.gif' onClick='javascript:window.location.href=\""+URL+"&YN=1\";'>　　　";
  IHTML+="<input Type='Image' value='Submit' src='http://my.51wma.com/MusicImage/But_N.gif' onClick='javascript:window.location.href=\""+URL+"&YN=0\";'>";
  IHTML+="</div>";
 }
 else
 {
  IHTML+="<br> 　　　　　　　 ";
  IHTML+="<input Type='Image' value='Submit' src='http://my.51wma.com/MusicImage/But_Yes.gif' width='58' height='23' onClick='CloseMsg()'>";
  IHTML+="</div>"; 
 }
 winbox.innerHTML=IHTML;
 boxConter.style.filter = "alpha(opacity=70)";
 boxConter.style.width=document.body.scrollWidth;
 boxConter.style.height=document.body.scrollHeight; 
 box.style.left=document.body.scrollLeft+300;
 box.style.top=document.body.scrollTop+200;
}

var count=0
var cleft,ctop,cx,cy;
function down1()
{
cleft=box.style.pixelLeft;
ctop=box.style.pixelTop;
cx=event.clientX;
cy=event.clientY;
count=1;
}

function move1()
{
if(count==1)
 {
  if ((cleft+event.clientX-cx)+300<boxConter.style.pixelWidth)
    box.style.pixelLeft=cleft+event.clientX-cx;
  if ((ctop+event.clientY-cy)+200<boxConter.style.pixelHeight)
    box.style.pixelTop=ctop+event.clientY-cy;
 }
}
//退出对话框
function CloseMsg()
{
 document.body.removeChild(winbox);
}

//08联盟铃声
//function sendsong(songname){window.open("http://mmscode.0cai.cn/mmscode/play1.htm?title="+songname+"&uid=11830",'MP3音乐网铃声');}
//function sendsong2(songname){window.open("http://mmscode.0cai.cn/mmscode/play1.htm?title="+songname+"&uid=11830",'MP3音乐网铃声');}
//function lingsheng(songname){window.open("http://mmscode.0cai.cn/mmscode/play1.htm?title="+songname+"&uid=11830",'MP3音乐网铃声');}
//function lingsheng2(songname){window.open("http://mmscode.0cai.cn/mmscode/play1.htm?title="+songname+"&uid=11830",'MP3音乐网铃声');}

function sendsong(songname){window.open("http://ringcache.wauee.com/ring/gongneng/gbk/gn_350_350.html?music_name="+songname+"&pid=11&mid=18217&channel=9&cid=924",'MP3音乐网铃声');}
function sendsong2(songname){window.open("http://ringcache.wauee.com/ring/gongneng/gbk/gn_350_350.html?music_name="+songname+"&pid=11&mid=18217&channel=9&cid=924",'MP3音乐网铃声');}
function lingsheng(songname){window.open("http://ringcache.wauee.com/ring/gongneng/gbk/gn_350_350.html?music_name="+songname+"&pid=11&mid=18217&channel=9&cid=924",'MP3音乐网铃声');}
function lingsheng2(songname){window.open("http://ringcache.wauee.com/ring/gongneng/gbk/gn_350_350.html?music_name="+songname+"&pid=11&mid=18217&channel=9&cid=924",'MP3音乐网铃声');}

function call(htmlurl){var newwin=window.open(htmlurl,'song','scrollbars=no,width=700,height=600,top=0,left=50');newwin.focus();return false;}
function showgeci(id){window.open("http://play.51wma.com/showgeci.asp?id="+id+"",'歌词查看','scrollbars=yes,width=450,height=400,top=0,left=50');}
function shoucang(url){var newwin=window.open(url,'songadd','scrollbars=no,width=400,height=300,top=150,left=150');newwin.focus();return false;}
function CheckAll(form)
{
	for (var i=0;i<form.elements.length;i++)
	{
		var e = form.elements[i];
		e.checked = true
	}
}
function CheckOthers(form)
{
	for (var i=0;i<form.elements.length;i++)
	{
		var e = form.elements[i];
			if (e.checked==false)
			{
				e.checked = true;// form.chkall.checked;
			}
			else
			{
				e.checked = false;
			}
	}
}

//清空事件
function delselect()
{
    var data_arr;
  	data_arr = document.getElementsByTagName("input");
	if(0==data_arr.length)
	{
		return false;
	}
	for(var i=0;i<data_arr.length; i++)
	{
		if("checkbox" == data_arr[i].getAttribute("type"))
		{
			data_arr[i].checked=false;
		}
	}
	return false;
}

function selectoption()
{								
var fm=document.list;
for(i = 0; i < fm.check.length; i++)
 {
  if(fm.check[i].checked==true)
  {
      window.list.method = "post";
      window.list.action = "http://play.51wma.com/playall2.asp";
      window.list.submit();
      break
  }
 }	
}

function selectoption2()
{								
var fm=document.remen;
for(i = 0; i < fm.check.length; i++)
 {
  if(fm.check[i].checked==true)
  {
      window.remen.method = "post";
      window.remen.action = "http://play.51wma.com/playall2.asp";
      window.remen.submit();
      break
  }
 }	
}

function selectoption3()
{								
var fm=document.list2;
for(i = 0; i < fm.check.length; i++)
 {
  if(fm.check[i].checked==true)
  {
      window.list2.method = "post";
      window.list2.action = "http://play.51wma.com/playall2.asp";
      window.list2.submit();
      break
  }
 }	
}

function secBoard(n)
  {
    for(i=0;i<secTable.cells.length;i++)
      secTable.cells[i].className="sec1";
    secTable.cells[n].className="sec2";
    for(i=0;i<mainTable.tBodies.length;i++)
      mainTable.tBodies[i].style.display="none";
    mainTable.tBodies[n].style.display="block";
  }

function secBoard2(n,url)
  {
    for(i=0;i<4;i++)
    document.all["but"+i].className="sec1";
    document.all["but"+n].className="sec2";
    document.all["TempHtml"].innerHTML="<IFRAME src='"+url+"' width=100% height=300 frameborder=0 marginheight=0 marginwidth=0 scrolling=no></IFRAME>";
  }

function copyInBoard(s) { 			
	window.clipboardData.setData("text",s);
	alert("网址复制成功啦,请直接按Ctrl+V粘贴!");
}

function JM_cc(ob)
{
	var obj=MM_findObj(ob); 
	if (obj) 
	{
		obj.select();js=obj.createTextRange();js.execCommand("Copy");}
		alert('已经复制好了，请直接按Ctrl+V粘贴!');
	}

function MM_findObj(n, d) { //v4.0
  var p,i,x;
  if(!d) d=document;
  if((p=n.indexOf("?"))>0&&parent.frames.length)
   {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
   }
  if(!(x=d[n])&&d.all) x=d.all[n];
  for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

var how_many_ads = 9; 
var now = new Date() 
var sec = now.getSeconds() 
var ad = sec % how_many_ads;
ad +=1; 
if (ad==1) { 
var wmaserver='http://url.51wma.com';}
if (ad==2) { 
var wmaserver='http://url2.51wma.com';}
if (ad==3) { 
var wmaserver='http://url.51wma.com';}
if (ad==4) { 
var wmaserver='http://url2.51wma.com';}
if (ad==5) { 
var wmaserver='http://url3.51wma.com';}
if (ad==6) { 
var wmaserver='http://url2.51wma.com';}
if (ad==7) { 
var wmaserver='http://url.51wma.com';}
if (ad==8) { 
var wmaserver='http://url2.51wma.com';}
if (ad==9) { 
var wmaserver='http://url3.51wma.com';}

rnd.today=new Date(); 
rnd.seed=rnd.today.getTime() 
function rnd() 
{ 
rnd.seed = (rnd.seed*9301+49297) % 233280; 
return rnd.seed/(233280.0); 
} 

function rand(number) 
{ 
return Math.ceil(rnd()*number); 
} 

function subrnd(num,str,strb){
	
	var lens=eval("document."+str+"."+strb).length;
	for (var i=0;i<lens;i++) 
	{
	var temp=eval("document."+str+"."+strb+"["+i+"]");
	temp.checked=false;
	}

	for (var i=0;i<num;i++) 
	{
	var temp=eval("document."+str+"."+strb+"["+rand(lens-1)+"]");
	temp.checked=!temp.checked;
	}
        return false;
}