function new_window(theURL,winName,features) { //v2.0
	window.open(theURL,winName,features);
}

function in_ch (st){ st.style.backgroundColor ='#DDE1EB'; }
function cbar (st) { st.style.backgroundColor = ''; }
//Ã¼Å©¹Ú½º ¼±ÅÃ ¹ÝÀü..
function RevCheck(frm,object) {
  	var frmobj = document.forms[frm];
	for( var i=0; i<frmobj.elements.length; i++) {
		var ele = frmobj.elements[i];
		if(ele.name == object)
			ele.checked = !ele.checked;
	}
	return;
}

//·£´ýµè±â
function ranMusic(){
	url="http://www.withjesus.co.kr/gospel/random_play.php";
	window.open(url, 'jesusplayer','Width=400,Height=545,top=0,left=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0');
}

		
//Àü°îµè±â
function listenAll(frm,object){
	AllCheck(frm,object);
	var frmobj = document.forms[frm];
    anyOneChecked = false;
	trecordno="";
    for( var i=0; i<frmobj.elements.length; i++) {
	      var ele = frmobj.elements[i];
		  if(ele.name == object && ele.checked == true){
			  anyOneChecked = true;
			  recordno=ele.value;
				if(recordno==""){
				}else{
				  trecordno=trecordno+recordno+"/";
				}
		  }
 	}
	url="http://www.withjesus.co.kr/gospel/music_listen.php?recordno="+trecordno
 	var newWin = window.open(url,"jesusplayer",'Width=380,Height=545,top=0,left=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0');	
}	

//Ã¼Å©¹Ú½º ÀüºÎ ¼±ÅÃ..
function AllCheck(frm,object){
	var frmobj = document[frm];
   	for( var i=0; i<frmobj.elements.length; i++) {
		var ele = frmobj.elements[i];
		if(ele.name == object)
			ele.checked = true;
   }
   return;
}
		
function AllDeCheck(frm,object){
	var frmobj = document.forms[frm];
	for( var i=0; i<frmobj.elements.length; i++) {
		var ele = frmobj.elements[i];
		if(ele.name == object)
		ele.checked = false;
	}
	return;
}
		
function oneMusic(music_no){
	url="http://www.withjesus.co.kr/gospel/music_listen.php?recordno="+music_no;
	window.open(url, 'jesusplayer','Width=380,Height=545,top=0,left=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0');
}

/*
function selectlistview(frm,object){
	var frmobj = document.forms[frm];
    anyOneChecked = false;
	trecordno="";
    for( var i=0; i<frmobj.elements.length; i++) {
	      var ele = frmobj.elements[i];
		  if(ele.name == object && ele.checked == true){
			  anyOneChecked = true;
			  recordno=ele.value;
				if(recordno==""){
				}else{
				  trecordno=trecordno+recordno+"/";
				}
		  }
 	}
    if (anyOneChecked == false) {
    	alert("¾Æ¹« ±Ûµµ ¼±ÅÃÀÌ µÇÁö ¾Ê¾Ò½À´Ï´Ù. ±ÛÀ» ¼±ÅÃÇÑÈÄ ¼±ÅÃµè±â¸¦ ´­·¯ ÁÖ¼¼¿ä..!");
        return;
	}
	url="http://www.withjesus.co.kr/gospel/music_listen.php?recordno="+trecordno
 	var newWin = window.open(url,"jesusplayer",'Width=380,Height=530,top=0,left=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0');	
}
*/

function SelectListView(id)
{
    anyOneChecked = false;
    var listSection = document.getElementsByTagName("input");
    trecordno = "";
    for(var i=0; i<listSection.length; i++) {
        if (listSection[i].type == 'checkbox' && listSection[i].checked == true) {
            anyOneChecked = true;
            trecordno = trecordno + listSection[i].value + "/";
        }
    }

    if (anyOneChecked == false) {
        alert("선택된 곡이 없습니다. 한 곡 이상을 선택해주세요.");
        return;
    }
    url = "MusicPlayer.aspx?pl=" + trecordno;
    var newWin = window.open(url, "sscplayer", 'Width=380,Height=530,top=0,left=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0');
    
    /*
    var frmobj = document.forms[0];
    trecordno = "";
    for (var i = 0; i < frmobj.elements.length; i++) {
        var ele = frmobj.elements[i];
        
        if (ele.name == object && ele.checked == true) {
            anyOneChecked = true;
            recordno = ele.value;
            if (recordno == "") {
            } else {
                trecordno = trecordno + recordno + "/";
            }
        }
        
        alert(typeof (ele));
    }
    if (anyOneChecked == false) {
        alert("¾Æ¹« ±Ûµµ ¼±ÅÃÀÌ µÇÁö ¾Ê¾Ò½À´Ï´Ù. ±ÛÀ» ¼±ÅÃÇÑÈÄ ¼±ÅÃµè±â¸¦ ´­·¯ ÁÖ¼¼¿ä..!");
        return;
    }
    url = "http://www.withjesus.co.kr/gospel/music_listen.php?recordno=" + trecordno
    var newWin = window.open(url, "jesusplayer", 'Width=380,Height=530,top=0,left=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0');
    */
}

// ÇÑÆÄÀÏÀ» ¾Ù¹üÀ¸·Î ´ã±â
function album_add(frm,object){
	var frmobj = document.forms[frm];
    anyOneChecked = false;
	recordno=object;
	if(recordno==""){
	}else{
		trecordno=recordno+"/";
	}
	url="http://www.withjesus.co.kr/gospel/my/myalbum_make.php?trecord_no="+trecordno
	var newWin = window.open(url,"myalbum",'Width=395,Height=500,left=200,top=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0');	
}

function album_make(frm,object){
	var frmobj = document.forms[frm];
    anyOneChecked = false;
	trecordno="";
   	for( var i=0; i<frmobj.elements.length; i++) {
		var ele = frmobj.elements[i];
		if(ele.name == object && ele.checked == true){
			anyOneChecked = true;
			recordno=ele.value;
			if(recordno==""){
			}else{
				trecordno=trecordno+recordno+"/";
			}
		}
 	}
    if (anyOneChecked == false) {
    	alert("¾Æ¹« ±Ûµµ ¼±ÅÃÀÌ µÇÁö ¾Ê¾Ò½À´Ï´Ù. ±ÛÀ» ¼±ÅÃÇÑÈÄ ¾Ù¹ü´ã±â¸¦ ´­·¯ ÁÖ¼¼¿ä..!");
        return;
    }
	url="http://www.withjesus.co.kr/gospel/my/myalbum_make.php?trecord_no="+trecordno
	var newWin = window.open(url,"myalbum",'Width=395,Height=500,left=200,top=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0');	
}

function album_view(){
	url="http://www.withjesus.co.kr/gospel/my/myalbum.php";
	var newWin = window.open(url,"myalbum",'Width=395,Height=500,left=200,top=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0');	
}

function view_gasa(music_no){
	url="http://www.withjesus.co.kr/gospel/gasa.php?music_no="+music_no;
	window.open (url,'gasawindow','width=395,height=500,left=420,top=0,status=no,scrollbars=yes,resizable=1');
}

function kind_list(m_code){
	location.href="http://www.withjesus.co.kr/gospel/music_list.php?m_code="+m_code;
}

function order_list(orderby){
	location.href="http://www.withjesus.co.kr/gospel/music_list.php?orderby="+orderby;
}

function openalbum_order(orderby){
	location.href="http://www.withjesus.co.kr/gospel/open/openalbum_list.php?orderby="+orderby;
}
