var playid1;
var playid2;
function opennewmv(mname,msonger,id1,id2,file,songerutf,count,dnum,ckopen)
{
	var url='mvplay.html?mn='+encodeURI(mname)+'&ms='+encodeURI(msonger)+'&id1='+encodeURI(id1)+'&id2='+encodeURI(id2)+'&mf='+encodeURI(file)+'&msutf='+songerutf+'&me='+encodeURI(count)+'&md='+encodeURI(dnum);
	if(ckopen=='y')
	window.open(url);
	else if(ckopen=='n')
	window.location.href=url;
	alert("url:["+url+"]");
	return false;
}
function opensongerpage(keysonger){
	window.open('mv_class_'+keysonger+'1.html');	
	return false;
}
function SendCOMBDCZ(songtype,newid,u,uu){
	if(newid==''){
		//if(songtype=='1')
		newid=playid1;
		//else
		//newid=playid2;
	}
songtype=1;
	window.open('http://my.12530.com/newchannel/orderTone/'+newid+'/'+songtype+'/'+u+'/'+uu+'/-/-/order.htm','','width=502,height=331,scrollbars=yes,status=yes');	
	return false;
}
function loadf(){
	var mvname=decodeURI(GetQueryString2('mn'));
	var mvsonger='<a onclick="opensongerpage(\''+decodeURI(GetQueryString2('msutf'))+'\');">'+decodeURI(GetQueryString2('ms'))+'</a>';
	playid1=decodeURI(GetQueryString2('id1'));
	playid2=decodeURI(GetQueryString2('id2'));
	var mvfile=decodeURI(GetQueryString2('mf'));
	document.getElementById('mvname').innerHTML=mvname;
	document.getElementById('mvsonger').innerHTML=mvsonger;
//document.getElementById('per_imgscroll').innerHTML=ltext;
	if(mvfile!='null'){
		play('http://content.12530.com/media/v',mvfile);//
	}else{
		alert('请选择您要看的MV！');
		if(document.referrer==''){
			window.location.href='ououmv_index.html';
		}else{
			window.location.href=document.referrer;
		}
	}	
}

function GetQueryString2(name)
{
	var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
	var r = window.location.search.substr(1).match(reg);
	if (r!=null)
	return r[2];
	return   null;
}

function play(path,file){
	var s1 = new SWFObject("mediaplayer.swf","mediaplayer","480","380","7");
	s1.addParam("allowfullscreen","true");
	s1.addVariable("width","480");
	s1.addVariable("height","360");
	s1.addVariable("file",path+file);
	s1.addVariable("image","video.jpg");
	s1.addVariable("autostart","true");
	s1.write("container");
}

//copy
function copyText(id) {
	try{
		var targetText = document.getElementById(id);
		targetText.focus();
		targetText.select();
		var clipeText = targetText.createTextRange();
		clipeText.execCommand("Copy");
		alert('已复制，使用Ctrl+V粘贴出来');
			document.body.removeChild(pbgObj);
			document.getElementById("msgDiv").removeChild(ptitle);
			document.body.removeChild(pmsgObj);

	}catch(e){
		alert('此浏览器不支持复制粘贴功能，请使用其它方式复制');

	}
}
var pbgObj;
var ptitle;
var pmsgObj;
function sAlert(){
	var msgw,msgh,bordercolor;
	msgw=400;//提示窗口的宽度
	msgh=80;//提示窗口的高度
	titleheight=25 //提示窗口标题高度
	bordercolor="#336699";//提示窗口的边框颜色
	titlecolor="#99CCFF";//提示窗口的标题颜色
	var sWidth,sHeight;
	sWidth=document.body.offsetWidth;
	sHeight=screen.height;
	var bgObj=document.createElement("div");
	bgObj.setAttribute('id','bgDiv');
	bgObj.style.position="absolute";
	bgObj.style.top="0";
	bgObj.style.background="#777";
	bgObj.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=25,finishOpacity=75";
	bgObj.style.opacity="0.6";
	bgObj.style.left="0";
	bgObj.style.width=sWidth + "px";
	bgObj.style.height=sHeight + "px";
	bgObj.style.zIndex = "10000";
	document.body.appendChild(bgObj);
	var msgObj=document.createElement("div")
	msgObj.setAttribute("id","msgDiv");
	msgObj.setAttribute("align","center");
	msgObj.style.background="white";
	msgObj.style.border="1px solid " + bordercolor;
    msgObj.style.position = "absolute";
    msgObj.style.left = "230px";
    msgObj.style.top = "80px";
    msgObj.style.font="12px/1.6em Verdana, Geneva, Arial, Helvetica, sans-serif";
    msgObj.style.marginLeft = "-225px" ;
    msgObj.style.marginTop = -75+document.documentElement.scrollTop+"px";
    msgObj.style.width = msgw + "px";
    msgObj.style.height =msgh + "px";
    msgObj.style.textAlign = "center";
    msgObj.style.lineHeight ="25px";
    msgObj.style.zIndex = "10001";
   
     var title=document.createElement("h4");
     title.setAttribute("id","msgTitle");
     title.setAttribute("align","right");
     title.style.margin="0";
     title.style.padding="3px";
     title.style.background=bordercolor;
     title.style.filter="progid:DXImageTransform.Microsoft.Alpha(startX=20, startY=20, finishX=100, finishY=100,style=1,opacity=75,finishOpacity=100);";
     title.style.opacity="0.75";
     title.style.border="1px solid " + bordercolor;
     title.style.height="18px";
     title.style.font="12px Verdana, Geneva, Arial, Helvetica, sans-serif";
     title.style.color="white";
     title.style.cursor="pointer";
     title.innerHTML="关闭";
     title.onclick=function(){
          document.body.removeChild(bgObj);
          document.getElementById("msgDiv").removeChild(title);
          document.body.removeChild(msgObj);
     }
     document.body.appendChild(msgObj);
     document.getElementById("msgDiv").appendChild(title);
     var txt=document.createElement("p");
     txt.style.margin="1em 0"
     txt.setAttribute("id","msgTxt");
     txt.innerHTML='<input style="width: 250px;" value="'+document.URL+'" onclick="copyText(this.id);" id="cpurl"/>  <a id="mva" onclick="copyText(\'cpurl\');">复制连接</a>';

	 document.getElementById("msgDiv").appendChild(txt);
				pbgObj=bgObj;
				ptitle=title;
				pmsgObj=msgObj;

}
