var play_win;

function init() {
	    DWRUtil.useLoadingImage("/images/ajaxload/animated_loading.gif",50,-300,40);
}
//spoken播放器
function initPlay() {
	    DWRUtil.useLoadingImage("/images/ajaxload/animated_loading.gif",75,-400,40);
}
function ShowOpen(url){
	try{
		window.status="正在准备播放，请等待!!";
		//play_win=window.open(url,'op','width=645px,height=500px;center:yes,help=no,resizable=no,status=no,resizeTo(100,200)');
		play_win=window.open(url,'op');
		play_win.focus();
		window.status="";
		return false; 
 	}catch(e){
		window.status="播放出错,请确认没有工具条屏蔽播放器！";
	}
}
//试听播放器
function ListenOpen(url){
	try{
		window.status="正在准备播放，请等待!!";
		var staticplay_win=window.open(url,'staticplay_win');
		staticplay_win.focus();
		window.status="";
		return false; 
	}catch(e){
		window.status="播放出错,请确认没有工具条屏蔽播放器！";
	}
	window.status="";
}

function ShowTestListen(url){
	// play_win=window.open(url,"testListen","scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,width=300,height=80");   
	 //play_win.focus();
	 //window.location=url;
	 ListenOpen(url);
	 
}
function ShowTestOrgListen(url){
 	
	play_win=window.open(url,'testListen','width=300px,height=80px;center:yes,help=no,resizable=no,status=no,resizeTo(300,500)');
	play_win.focus();   
}
function ShowTestTrackListen(url){
	
	var position=url.indexOf("lcode");
	var locode=url.substring(position+6,url.length);
	JPlay.testListenCheckLogin(locode,showTestListenResult);  
}
function ShowTestTrackListen(url){
	
	var position=url.indexOf("lcode");
	var locode=url.substring(position+6,url.length);
	JPlay.testListenCheckLogin(locode,showTestListenResult);  
}
/**
点试听播放器的处理结果方法
*/

function showTestListenResult(msg){
	var result=msg.substring(0,5);
	var lcode=msg.substring(5,msg.length);
	//alert(msg);
	//alert(result);
	//alert(lcode);
	if(result=="false"){
		var url="/kuke/Play?o=testtrack&lcode="+lcode;
		//alert(url);
		var newwin=window.open(url,'testListen','width=300px,height=130px;center:yes,help=no,resizable=no,status=no,resizeTo(300,500)');
	 	newwin.focus(); 
	}else{
		//alert(msg);
		window.location=msg;
	}
}

function playMusic(){
	JPlay.startPlay("aa",showPlayResult);
}

function CreateSelectList(lcode,ltype){
	var uu='/kuke/Play?o=createPlayList&lcode='+lcode+"&ltype="+ltype;
	alert(uu);
	ifrmPlayList.location.href(uu);
}
function showPlayResult(msg){
	if(msg=="false"){
		alert("播放过程出错了！请少后再试！");
	}else{
		//解吸创建结果
		var s=msg.split(",");
		//alert(s[0]);
		//alert(s[1]);
		var playurl="http://"+s[0]+"/"+s[1];
		Exobud.URL=playurl;
		Exobud.controls.play(); 
		showState(Exobud.URL);
	}
}