function login_chk(){

	if (document.login_form.login_name.value == "")
	{
       alert("帐号?");
       return false;
	}
  
	if (document.login_form.passwd.value == "")
	{
       alert("密码?");
       return false;
	}

     return true;
}

function chk_m_sch(mn){
   var f = document.MSCH_FORM ;
   f.mechod = 'get' ;   
   if(f.key.value == '' ){
       alert("杈撳叆鐐逛笢瑗垮惂.");
       f.key.focus();
	   return false;
   }else{
		
		switch(f.s_method.value) {
			case "song_title" :
				  f.action = "listcd.php";
				  break;
			case "album_title" :
				  f.action = "album.php";
				  break;
			case  "art_name" :
				  f.action = "album.php";
				  break;
			default :
				  return false;
		}
		f.action += "?s_method="+f.s_method.value;
        return true; 
   }
       

}


function MM_swapImage() {
	var i,j=0,x,a=MM_swapImage.arguments;
	document.MM_sr=new Array;
	for(i=0;i<(a.length-2);i+=3)
		if ((x=MM_findObj(a[i]))!=null){
			document.MM_sr[j++]=x;
			if(!x.oSrc)
				x.oSrc=x.src;
			x.src=a[i+2];
		}
}
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;
}
function MM_swapImgRestore() {
	var i,x,a=document.MM_sr;
	for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)
		x.src=x.oSrc;
}


function MM_swapImage1() {
	var i,j=0,x,a=MM_swapImage1.arguments;
	document.MM_sr1=new Array;
	for(i=0;i<(a.length-2);i+=3)
		if ((x=MM_findObj1(a[i]))!=null){
			document.MM_sr1[j++]=x;
			if(!x.oSrc)
				x.oSrc=x.src;
			x.src=a[i+2];
		}
}
function MM_findObj1(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_findObj1(n,d.layers[i].document);
	if(!x && document.getElementById) x=document.getElementById(n); return x;
}
function MM_swapImgRestore1() {
	var i,x,a=document.MM_sr1;
	for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)
		x.src=x.oSrc;
}

function open_scroll_no(xurl, tar, wid, hei){
	set = 'width='+wid+',height='+hei+',left=20,top=20,toolbar=no,location=no,directory=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no'
	window.open(xurl,tar,set);
}



function open_scroll_yes(xurl, tar, wid, hei){
	set = 'width='+wid+',height='+hei+',left=20,top=20,toolbar=no,location=no,directory=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no'
	window.open(xurl,tar,set);
}
function reload_form(xurl){
	location.href=xurl;
}

/*****************************************************************************************************

??? ?????? ??????.

*******************************************************************************************************/
function chkins(f)
{

  var chkcount = 0;    
  var chk_size = f.isr_mv.length;
  if (chk_size==null) chk_size = 0;

  if(chk_size == 0) { 
     if(f.isr_mv.checked == true) {
	     return true; 
	 }else{
	     alert("..??? ??????!");
		 return false;
     }
  }else{
     
	 for(var i=0;i < f.isr_mv.length;i++)
     {
        if(f.isr_mv[i].checked==true) 
	    {
	       chkcount++;
	    } 
     }
     if(chkcount==0){
        alert("??? ??????!");
        return false;
     }
     else
        return true;

  }

}

/////////////////////////////////////////////////////////////////////////

function InsertToMyalbum(obj){
 
   var f = obj;
   
   if (chkins(f) == true ){
       //f.action ="/member/myalbum01.asp" ;
       //f.target ="_NEW" ;
       //f.submit();
	   GoToMyAlbum(f.isr_mv);
	}
  
}
//////////////////////////////////////////////////////////////////////////

function InsertToMyalbum_02(title_no){
 
    open_win('/myalbum/album1.asp?D_MODE=album_ins&Ins_mode=titleall&title_no='+title_no,'360','525');
 
}
/////////////////////////////////////////////////////////////////////////


function open_win(xurl,wid,hei){
	div = "width=" + wid + ",height=" + hei + ",toolbar=no,location=no,directory=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no";
	window.open(xurl,"_new",div);
}

function PlayList2()
{

var  kd_idx = '';
var chk_size = document.bform.isr_mv.length;
if (chk_size==null)	chk_size = 0; 
	if (chk_size != 0){
        for(i=0; i<chk_size; i++) {
		  if (document.bform.isr_mv[i].checked == true) {
				kd_idx = kd_idx + document.bform.isr_mv[i].value + ',' ;
		  }
		 }
		 kd_idx = kd_idx.substring(0,(kd_idx.length-1));
//			alert(kd_idx);
	   }
	else if (document.bform.isr_mv.checked == true) // ??????? ????? 
	{  
				kd_idx = document.bform.isr_mv.value;
	}

	if (kd_idx != "") {
	   open_player('playids='+kd_idx);
	}
	else {
		alert("没有选择任何歌曲.");
	}

}

function PlayDown()
{

var  kd_idx = '';
var chk_size = document.bform.isr_mv.length;
if (chk_size==null)	chk_size = 0; 
	if (chk_size != 0){
        for(i=0; i<chk_size; i++) {
		  if (document.bform.isr_mv[i].checked == true) {
				kd_idx = kd_idx + document.bform.isr_mv[i].value + ',' ;
		  }
		 }
		 kd_idx = kd_idx.substring(0,(kd_idx.length-1));
//			alert(kd_idx);
	   }
	else if (document.bform.isr_mv.checked == true) // ??????? ????? 
	{  
				kd_idx = document.bform.isr_mv.value;
	}

	if (kd_idx != "") {
	   open_download('ids='+kd_idx);
	}
	else {
		alert("没有选择任何歌曲.");
	}

}

//??
function PlayList2_Down(fname, mtype, sellerID, caption_ok, caption_name, PreviewCheck)
{

var  kd_idx = '';
var chk_size = document.bform.isr_mv.length;
if (chk_size==null)	chk_size = 0; 
	if (chk_size != 0){
        for(i=0; i<chk_size; i++) {
		  if (document.bform.isr_mv[i].checked == true) {
				kd_idx = kd_idx + document.bform.isr_mv[i].value + ',' ;
		  }
		 }
		 kd_idx = kd_idx.substring(0,(kd_idx.length-1));
//			alert(kd_idx);
	   }
	else if (document.bform.isr_mv.checked == true) // ??????? ????? 
	{  
				kd_idx = document.bform.isr_mv.value;
	}

	if (kd_idx != "") {
	var tag = '?kd_idx='+ kd_idx +'&fname=' + fname + '&mtype=' + mtype + '&sellerID=' + sellerID + '&caption_ok=' + caption_ok + '&caption_name=' + caption_name + '&PreviewCheck=' + PreviewCheck ;
	window.open('/hanmaro/multidown/down_chk.asp' + tag, 'Streaming', 'width=364,height=514,menubar=no, directories=no,resizable=no,status=no,scrollbars=no' ) ;
	}
	else {
		alert("??? ??????");
	}

}

//////////////////

function PlayList2_free()
{

var  kd_idx = '';
var chk_size = document.bform.isr_mv.length;
if (chk_size==null)	chk_size = 0; 
	if (chk_size != 0){
        for(i=0; i<chk_size; i++) {
		  if (document.bform.isr_mv[i].checked == true) {
				kd_idx = kd_idx + document.bform.isr_mv[i].value + ',' ;
		  }
		 }
		 kd_idx = kd_idx.substring(0,(kd_idx.length-1));
//			alert(kd_idx);
	   }
	else if (document.bform.isr_mv.checked == true) // ??????? ????? 
	{  
				kd_idx = document.bform.isr_mv.value;
	}

	if (kd_idx != "") {
	   open_player('playids='+kd_idx);
	}
	else {
		alert("没有选择任何歌曲.");
	}

}


////// ????? /////////
function PlayList3(fname, mtype, sellerID, caption_ok, caption_name, PreviewCheck)
{

var  kd_idx = '';
var chk_size = document.bform.isr_mv.length;
if (chk_size==null)	chk_size = 0; 
	if (chk_size != 0){
        for(i=0; i<chk_size; i++) {
		  if (document.bform.isr_mv[i].checked == true) {
				kd_idx = kd_idx + document.bform.isr_mv[i].value + ',' ;
		  }
		 }
		 kd_idx = kd_idx.substring(0,(kd_idx.length-1));
//			alert(kd_idx);
	   }
	else if (document.bform.isr_mv.checked == true) // ??????? ????? 
	{  
				kd_idx = document.bform.isr_mv.value;
	}
	if (kd_idx != "") {
	var tag = '?kd_idx='+ kd_idx +'&fname=' + fname + '&mtype=' + mtype + '&sellerID=' + sellerID + '&caption_ok=' + caption_ok + '&caption_name=' + caption_name + '&PreviewCheck=' + PreviewCheck ;
	window.open('/hanmaro/live/video/skin1.asp' + tag, 'movie', 'width=676,height=487,menubar=no, directories=no,resizable=no,status=no,scrollbars=no' ) ;
	}
	else {
		alert("?????? ??????");
	}

}

////// ????? ?? /////////
function Play_Etc(fname, mtype, sellerID, caption_ok, caption_name, PreviewCheck)
{

var  kd_idx = '';
var chk_size = document.bform.isr_mv.length;
if (chk_size==null)	chk_size = 0; 
	if (chk_size != 0){
        for(i=0; i<chk_size; i++) {
		  if (document.bform.isr_mv[i].checked == true) {
				kd_idx = kd_idx + document.bform.isr_mv[i].value + ',' ;
		  }
		 }
		 kd_idx = kd_idx.substring(0,(kd_idx.length-1));
//			alert(kd_idx);
	   }
	else if (document.bform.isr_mv.checked == true) // ??????? ????? 
	{  
		kd_idx = document.bform.isr_mv.value;
	}

	if (kd_idx != "") {
	var tag = '?kd_idx='+ kd_idx +'&fname=' + fname + '&mtype=' + mtype + '&sellerID=' + sellerID + '&caption_ok=' + caption_ok + '&caption_name=' + caption_name + '&PreviewCheck=' + PreviewCheck ;
	window.open('/hanmaro/live/video/skin_etc.asp' + tag, 'movie', 'width=676,height=487,menubar=no, directories=no,resizable=no,status=no,scrollbars=no' ) ;
	}
	else {
		alert("?????? ??????");
	}

}

function PlayList_all()
{

var  kd_idx = '';
var chk_size = document.bform.isr_mv.length;
if (chk_size==null)	chk_size = 0; 
	if (chk_size != 0){
        for(i=0; i<chk_size; i++) 
			{
				if (bform.isr_mv[i].disabled == false) {
				kd_idx = kd_idx + document.bform.isr_mv[i].value + ',' ;
				document.bform.isr_mv[i].checked=true;
				}
		  }
		  kd_idx = kd_idx.substring(0,(kd_idx.length-1));
		 }
	else  // ??????? ????? 
	{  
				kd_idx = document.bform.isr_mv.value;
				document.bform.isr_mv.checked=true;
	}	
   open_player('playids='+kd_idx);
	   
}

//??
function PlayDown_all(fname, mtype, sellerID, caption_ok, caption_name, PreviewCheck)
{

var  kd_idx = '';
var chk_size = document.bform.isr_mv.length;
if (chk_size==null)	chk_size = 0; 
	if (chk_size != 0){
        for(i=0; i<chk_size; i++) 
			{
				if (bform.isr_mv[i].disabled == false) {
				kd_idx = kd_idx + document.bform.isr_mv[i].value + ',' ;
				document.bform.isr_mv[i].checked=true;
				}
		  }
		  kd_idx = kd_idx.substring(0,(kd_idx.length-1));
		 }
	else  // ??????? ????? 
	{  
			kd_idx = document.bform.isr_mv.value;
			document.bform.isr_mv.checked=true;
	}	
			

	   
	var tag = '?kd_idx='+ kd_idx +'&fname=' + fname + '&mtype=' + mtype + '&sellerID=' + sellerID + '&caption_ok=' + caption_ok + '&caption_name=' + caption_name + '&PreviewCheck=' + PreviewCheck ;
	window.open('/hanmaro/multidown/down_chk.asp' + tag, 'Streaming', 'width=364,height=514,menubar=no, directories=no,resizable=no,status=no,scrollbars=no' ) ;
	   
	   }
//////////////////////////////////


function PlayList_all_free(fname, mtype, sellerID, caption_ok, caption_name, PreviewCheck,event_nm) //free_Event? ??
{

var  kd_idx = '';
var chk_size = document.bform.isr_mv.length;
if (chk_size==null)	chk_size = 0; 
	if (chk_size != 0){
        for(i=0; i<chk_size; i++) 
			{
				if (bform.isr_mv[i].disabled == false) {
				kd_idx = kd_idx + document.bform.isr_mv[i].value + ',' ;
				document.bform.isr_mv[i].checked=true;
				}
		  }
		  kd_idx = kd_idx.substring(0,(kd_idx.length-1));
		 }
	else  // ??????? ????? 
	{  
				kd_idx = document.bform.isr_mv.value;
				document.bform.isr_mv.checked=true;
	}	
			
	var tag = '?kd_idx='+ kd_idx +'&fname=' + fname + '&mtype=' + mtype + '&sellerID=' + sellerID + '&caption_ok=' + caption_ok + '&caption_name=' + caption_name + '&PreviewCheck=' + PreviewCheck + '&event=' + event_nm ;
	window.open('/hanmaro/live/skin/skin1_Free.asp' + tag, 'Streaming', 'width=364,height=514,menubar=no, directories=no,resizable=no,status=no,scrollbars=no' ) ;
	   
	   }



function Play_video_etc(kd_idx,fname, mtype, sellerID, caption_ok, caption_name, PreviewCheck)
{

	var tag = '?kd_idx='+ kd_idx +'&fname=' + fname + '&mtype=' + mtype + '&sellerID=' + sellerID + '&caption_ok=' + caption_ok + '&caption_name=' + caption_name + '&PreviewCheck=' + PreviewCheck ;
	window.open('/hanmaro/live/video/skin_etc.asp' + tag, 'movie', 'width=676,height=487,menubar=no, directories=no,resizable=no,status=no,scrollbars=no' ) ;
	   
	   }	

function chkall()
{
    
	
	var f = document.bform;

    var chk_size = f.isr_mv.length;
    if (chk_size==null) chk_size = 0;
    if(chk_size > 0 ) { 
       if (chk_size != 0){
            for(i=0; i<chk_size; i++) {
		      if(f.isr_mv[i].disabled == false)
                  f.isr_mv[i].checked=true
            }
       }
	 }else{
           f.isr_mv.checked=true ;
	 }

 }
 function chknotall()
{
    
	var f = document.bform;
        
	var chk_size = f.isr_mv.length;
    if (chk_size==null) chk_size = 0;
    
    if(chk_size > 0  ) { 
   
	   if (chk_size != 0){
           for(i=0; i<chk_size; i++) {
		     if (f.isr_mv[i].disabled == false)
               f.isr_mv[i].checked=false
		   }
	   }
	 }else{

         f.isr_mv.checked=false ;
	 }

 }



function open_scroll_isr(te1, te2, te3){
	var isr_url = 	'/music/word.asp?text_song_no=' + escape(te1) + '&isr_mttl_org=' + escape(te2) + '&isr_artist_name_org=' + escape(te3) ; 
	window.open(isr_url,'isr_on','width=362,height=490,menubar=no, directories=no,resizable=no,status=no,scrollbars=no' ) ;
}



function open_player(htmlurl){
  var newwin=window.open("http://music.oncity.cc/player.php?"+htmlurl,"oncity_song","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=381,height=498");
  newwin.focus();
}

function open_song_txt(id){
	var newst=window.open("http://music.oncity.cc/songtxt.php?id="+id,"oncity_music_txt","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=400,height=256");
	newst.focus();
}

function open_song_fav(oid){
	var newfa=window.open("favorites.php?"+oid,"oncity_favorites","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=400,height=335");
	newfa.focus();
}

function openNewWindow(fileName,windowName,theWidth,theHeight)
 {
	if (windowName == "newMessageWindow") 
	{
		uniqueName = new Date();
		windowName = uniqueName.getTime();
	}
	window.open(fileName,windowName,"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,width="+theWidth+",height="+theHeight)
}

function random(number) {
	return Math.floor(Math.random() * number);
}

function open_buy_song(tagid,id){
	if(confirm('使要用3000G购买此歌吗？')){
		var newwa=window.open("buy_song.php?tagid="+tagid+"&id="+id,"oncity_song","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=200,height=72");
		newwa.focus();
	}
}

function open_im_buy_song(id){
	var newwa=window.open("http://im.oncity.cc/ibg/optmusic.php?t=buy&id="+id,"rm_list","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=318,height=382");
}

function open_download(htmlurl){
	newwa=window.open("http://music.oncity.cc/download.php?"+htmlurl,"oncity_down","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=400,height=306");
	newwa.focus();
}

function open_vip_download(htmlurl){
	newwa=window.open("http://music.oncity.cc/vip_download.php?"+htmlurl,"oncity_down","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=400,height=306");
	newwa.focus();
}

function open_radio_player(){
	var newwa=window.open("radio_player.php","oncity_radio","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=300,height=465");
	newwa.focus();
}

function openwinpoll(id){
	var newwa=window.open("s_vote.php?id="+id,"oncity_vote","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=150,height=100");
	newwa.focus();
}

function ShowMusicFooter()
{
	var snect='<a href=http://www.oncity.cc target=_blank>www.OnCity.cc</a> | <a href=http://love.oncity.cc target=_blank>Love.OnCity.cc</a>';
 	document.write(snect);
}