function dir_set(str1,str2){
 _dir=str1;
 id=str2;
}

function selectList(){
	var tmp='';
	for(i=0;i<document.select_list.length;i++){
	  if(document.select_list[i].type=="checkbox"){
		if(document.select_list[i].checked){
		  if(!tmp) tmp=document.select_list[i].value; 
		     else tmp+=","+document.select_list[i].value;
		}
	  }
	}
	return tmp;
}

function DeselectList(){
	var tmp='';
	for(i=0;i<document.select_list.length;i++){
	  if(document.select_list[i].type=="checkbox"){
		if(!document.select_list[i].checked){
		  if(!tmp) tmp=document.select_list[i].value; 
		     else tmp+=","+document.select_list[i].value;
		}
	  }
	}
	return tmp;
}

function play_list(){
	var tmp=selectList();
	if(!tmp) alert('°îÀ» ¼±ÅÃÇÏ¼¼¿ä');
	 else play_win=window.open(_dir+'LordPlayer2.php?id='+id+'&tmp='+tmp,'LordPlayer','width=510,height=227,scrollbars=auto,resizeable=yes');
}

function play_list_all(){
	play_win=window.open(_dir+'LordPlayer2.php?id='+id+'&tmp=all','LordPlayer','width=510,height=227,scrollbars=auto,resizeable=yes');
}

function select_all(mode){
	for(i=0;i<document.select_list.length;i++){
	  if(document.select_list[i].type=='checkbox') {
		if(mode==1) document.select_list[i].checked='checked';
			else document.select_list[i].checked='';
	  }
	}
}

function play_list_reverse(){
	for(i=0;i<document.select_list.length;i++){
	  if(document.select_list[i].type=="checkbox"){
		if(document.select_list[i].checked) document.select_list[i].checked="";
		 else document.select_list[i].checked="checked";
	  }
	}
}

function thisplay(no){
	play_win=window.open(_dir+'LordPlayer2.php?id='+id+'&tmp='+no,'LordPlayer','width=510,height=227,resizeable=yes');
}

function albumAdd(plag){
	var tmp=selectList();
	if(plag) album_win=window.open(_dir+'album_register.php?id='+id+'&tmp='+tmp,'Album','width=500,height=600,resizeable=yes');
	 else play_win=window.open(_dir+'album_register.php?id='+id+'&tmp='+tmp,'Album','width=500,height=600,resizable=yes');
}

function albumplay(no){
	var tmp=selectList();
	play_win=window.open(_dir+'album_play.php?id='+id+'&tmp='+tmp,'LordPlayer','width=300,height=200,resizable=yes');
}

function randomplay(no){
	var tmp=selectList();
	play_win=window.open(_dir+'LordPlayer2.php?id='+id+'&tmp='+tmp+'&rdplay=1','LordPlayer','width=510,height=200,resizable=yes');
}

function deleteList(rdplay){
	var tmp=DeselectList();
	location.href='LordPlayer2.php?id='+id+'&tmp='+tmp+'&rdplay='+rdplay;
}

function Addalbum(tmp){
	album_win=window.open(_dir+'album_register.php?id='+id+'&tmp='+tmp,'Album','width=500,height=600,resizable=yes');
}

function ListMuviPlay(url){
	if(!url) return;
	muvi_win=window.open(_dir+'muviplay.php?url='+url,'MusicVideoPlay','width=40,height=30,scrollbars=no,resizable=yes');
}

function battery_charge(){
	charge_win=window.open(_dir+'battery.php?id='+id,'Charge','width=340,height=250,scrollbars=no,resizable=yes');
}

function delList(bid,target){
	var tmp=DeselectList();
	location.href="album_register2.php?id="+bid+"&mode=register&target="+target+"&tmp="+tmp;
}

function openAlbum(){
	openAlbum_win=window.open(_dir+'open_album.php?id='+id,'OpenAlbum','width=400,height=500,scrollbars=no');
}

function albumInfo(){
	album_win=window.open(_dir+'album_register.php?mode=info&id='+id,'Album','width=500,height=600,resizable=yes');
}
