﻿var
	defaultBC='#images',
	imgDir='images/',
	imgExt='.gif';
var
   	aCnt=0;
	dAList=new Array();
	dList='swf';
	sCnt=0;
	dSList=new Array();
        tCnt=0;
	dTList=new Array();



function nguoi_dau_khovn(Ten_Ca_Si)
{
	aCnt++;
	sCnt=0;tCnt=0;
	dAList[aCnt]=Ten_Ca_Si;
	dSList[aCnt]=new Array();
              dTList[aCnt]=new Array();
              }
               

function nguoi(Link_Nhac)
{
	sCnt++;
	dSList[aCnt][sCnt]=Link_Nhac;
}
function khovn(Ten_Bai_Hat)
{
    
	tCnt++;
	dTList[aCnt][tCnt]=Ten_Bai_Hat;
	
}



function showAList()
{
	html='<TABLE width=100%  cellspacing=0 cellpadding=0>';
	html+='<TR><TD class=TH></TD></TR>';
	html+='<TR><TD><SPAN style="overflow-X: auto; overflow-Y: auto; width: 100%; height: 100%;"><TABLE cellspacing=0 cellpadding=0>';
	for (i=1; i<dAList.length; i++)
        html+='<TR><TD width=10 class=TD></TD><TD class=TD><font color=red><font face=tahoma>◊ <A href=#Play_'+i+'>'+mediaName(vniName(dAList[i]))+'</TD></TR>';
	html+='</TABLE></SPAN></TD></TR>';
	html+='</TABLE>';
	aListHTML.innerHTML=html;
}

function showSongList(ab)
{
	html='<TABLE width=100%  cellspacing=0 cellpadding=0>';
	html+='<TR><TD class=TH></TD></TR>';
	html+='<TR><TD><SPAN style="overflow-X: auto; overflow-Y: auto; width: 100%; height: 100%;"><TABLE cellspacing=0 cellpadding=0>';
	t=getVar(2);
	for (i=1; i<dTList[ab].length; i++)
	if (t==i)
	   html+='<TR><TD width=10 class=TD></TD><TD class=TD><font color=yellow><IMG src="'+imgDir+'play'+imgExt+'" ></B>. <A href=#Play_'+ab+'_'+i+'><font color=blue>'+mediaName(vniName(dTList[ab][i]))+'</TD></TR>';
	else
		html+='<TR><TD width=10 class=TD></TD><TD class=TD><font color=red>'+i+'. <A href=#Play_'+ab+'_'+i+'>'+mediaName(vniName(dTList[ab][i]))+'</TD></TR>';
	html+='</TABLE></SPAN></TD></TR>';
	html+='</TABLE>';
	songListHTML.innerHTML=html;
}



function mediaPlay()
{ 
Media.controls.play();
}

function mediaStop()
{
Media.controls.stop();
}

function mediaPause()
{
Media.controls.pause();
}
function mediaEnded()
{
	mediaNext();
}


function mediaEnded()
{
	mediaNext();
}


function mediaError()
{

}


function mediaHide()
{	
	Media.style.display="none";	
}
function mediaShow()
{
	Media.style.display="";	
}
function mediaName(st)
{
	st=st.replace(/_/,' ');
	st=st.replace('.mp3','.%6Dp%33');
	st=st.replace('.mp9','');
	st=st.replace('.swf','');
	st=st.replace('.wma','.%77m%61');
	st=st.replace('.wm9','');
    st=st.replace('.MP3','.%4DP%33');
    st=st.replace('../default.htm','');
	return st;
}

function mediaPre()

{	
	s=getVar(2);
	if (s>1)
		s--;
	else
		s=dSList[ab].length-1;
	window.location='#Play_'+ab+'_'+s;
}

function mediaNext()
{	
	s=getVar(2);
	if (s<dSList[ab].length-1)
		s++;
	else
		s=1;
	window.location='#Play_'+ab+'_'+s;
}

function media_DoFSCommand(command, args)
{
	if (command=='mediaPlay')
		mediaPlay();
	else if (command=='mediaStop')
		mediaStop();
	else if (command=='mediaPause')
		mediaPause();
	else if (command=='mediaReverse')
		mediaReverse();
	else if (command=='mediaForward')
		mediaForward();
	else if (command=='mediaVolume')
		mediaVolume(args);
	else if (command=='mediaPresent')
		mediaPresent();
	else if (command=='mediaDownload')
		mediaDownload();
}

function doAction(sName)
{
	var d=new Date();
	v=d.getTime();
	v=1;
	actionScript.src=sName;
}


function mediaState(state)
{
	switch(state)
	{

case 1:
window.defaultStatus=vniName('» Stopped');
mstatus=
     '<div style="position: absolute; width: 200px; height: 18px; z-index: 1; left: 130px; top: 40px" id="dangDungBaiHat">'+
     '<font size=2 style="font-family: Tahoma;  color: white; font-weight: bold">Bài Hát Đang Dừng <br>Click vào "<font color=yellowsize=2> Play </font>"để nghe lại</div>';

break;


case 2:
window.defaultStatus=vniName('» Paused');
mstatus='<div style="position: absolute; width: 200px; height: 18px; z-index: 1; left: 130px; top: 40px" id="dangTamDungBaiHat">'+
     '<font size=2 style="font-family: Tahoma;  color: black; font-weight: bold">Bài Hát Đang Tạm Dừng <br>Click vào "<font color=yellowsize=2> Play </font>" để nghe tiếp</div>';
break;


case 3:	
window.defaultStatus=vniName('» Playing : '+mediaName(vniName(dTList[ab][song]))+'');
mstatus=  
        '<div style="position: absolute; width: 237px; height: 18px; z-index: 1; left: 160px; top: -80px" id="copyright"><marquee scrollamount="2" bgcolor="#000000" width=240" height="16" style="font-family: Tahoma; font-size: 10pt; color: #00FFFF; font-weight: bold">Bạn đang nghe ca khúc : <font color=yellow>'+mediaName(vniName(dTList[ab][song]))+'</font> Trong Album Của : <font color=yellow>  '+mediaName(vniName(dAList[ab]))+'</font> Tại website của <font color=red>  Hoàng Nhân </font>Nếu Bạn Muốn Gửi Tặng Ca Khúc Này Cho Bạn Của Mình Hãy Coppy Dòng Link Phía Bên Rồi Gửi Cho Nick Bạn Mình ! Chúc Các Bạn Có Giây Phút Vui Vẻ Và Thoải Mái Khi Đến Với Website Chúng Tôi.</marquee></div>'+
        '<div style="position: absolute; width: 100px; height: 18px; z-index: 1; left: 155px; top: 10px" id="copyright"><table align=right border="1" width="100" id="table1" style="border-width: 0px">'+
                '<tr>'+
		'<td style="border: 1px dotted red" colspan="2">'+
	    	'<p align="center"><font color=white>Coppy Dòng Link Phía Dưới Rồi Gửi Cho Nick YaHoo Của Bạn Mình<font></td>'+
	    '</tr>'+
                '<tr>'+
		'<td style="border: 1px dotted red" width="90"><p align="center">'+
                '<input type=text value="'+window.location.href+'" size="41" name="singuyen" style="border: 0px solid #A3D63B">'+
                '</td>'+
	    '</tr>'+  
	    '<tr>'+
		'<td style="border: 1px dotted red" colspan="2">'+
	    	'<p align="center"><a href="'+songLink+'" target=1 title="Nháy chuột phải chọn Save Target As ..."><img border="0" src="'+imgSite+''+imgDir+'downloads.gif" width="74" height="20"></a></td>'+
	    '</tr></div>'+
	    '</table>';
       

break;


case 9:
window.defaultStatus=vniName('» Đang kết nối tới bài : '+mediaName(vniName(dTList[ab][song]))+'');
mstatus=
        '<div style="position: absolute; width: 200px; height: 180px; z-index: 2; left: -40px; top: -495px" id="dangketnoivoimaychu">'+
        '<table align=right border="0" width="200" height="170" id="table1" >'+
                '<tr>'+
		'<td background="'+imgSite+''+imgDir+'saybox.gif" style="border: 0px  colspan="2">'+
	    	'<p align="center"><img src="'+imgSite+''+imgDir+'ld.gif" width="140" height="6" border=0><br><b><font color=red face=tahoma size=2>Đang kết nối tới <br>Ca Khúc:<br>&nbsp;&nbsp;&nbsp;<font size=1 color=yellow>'+mediaName(vniName(dTList[ab][song]))+'</font><br>Đợi Chút Nghe Cưng</font></td>'+
	    '</tr>'+
            '</div>'+
	    '</table>';
break;

case 10:
window.defaultStatus=vniName('» Mất kết nối tới bài : '+mediaName(vniName(dTList[ab][song]))+'');
mstatus=
      '<div style="position: absolute; width: 202px; height: 10px; z-index: 1; left: 140px; top: 50px; id="ketnoibingat">'+
	      '<center><b><font color=#000000 face=tahoma size=1><img src="'+imgSite+''+imgDir+'matketnoi.gif" border=0> Kết nối bị ngắt <img src="'+imgSite+''+imgDir+'matketnoi.gif" border=0></font></center><font face=tahoma size=1>Nếu ko nghe đc bạn bấm F5 vài lần nhá.<br>Ko đc PM vào nick <a href="ymsgr:sendim?nguoi_lang_thang_20062000">Admin</a></font></div>';

break;

case 11,6:
window.defaultStatus=vniName('» Buffering : '+mediaName(vniName(dTList[ab][song]))+'');
mstatus=
       '<div style="position: absolute; width: 220px; height: 74px; z-index: 3; left: 120px; top: 22px" id="KetNoiThanhCong">'+
	       '<center><br><br><br><font face="Tahoma" size="2" color="#FF0000"><img src="'+imgSite+''+imgDir+'ld.gif" border=0><br>Dữ liệu bài hát đang đc tải!!</font></center></div>';

break;


default:
	}
mediaLoadingHTML.innerHTML=''+mstatus+'';
}


function showContent()
{
html+='<div style="position: absolute; width: 0; height: 0px; z-index: 1; left: 0px; top: 0px; font-family: Tahoma; font-size: 0pt; color: red; font-weight: bold" id="Menu">'+
      '<img src=images/saybox.gif width="0" height="0">'+
      '</div>';



html+=
      '<DIV style="FONT-WEIGHT: bold; FONT-SIZE: 09px; LEFT: 325px; TEXT-TRANSFORM: capitalize; FONT-FAMILY: Verdana; POSITION: absolute; TOP: 211px; height:300px; width:300px" align=center>'+
      '<TABLE WIDTH=144 BORDER=0 CELLPADDING=0 CELLSPACING=0>'+
      '<TD style="filter: Chroma2(color=#216134) Alpha(Opacity=60) Chroma2(color=#216134) Chroma2(color=#216134);  COLSPAN=2 width="100%" height="100%">'+
      '<DIV STYLE="position: absolute; TOP: 0px; LEFT:-18px; height:220px"  id="MediaPlayer">'+
      '<object classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6" id="Media" width="280" height="240" style="border-style: solid; border-width: 1,5px">'+
	  '<PARAM name="volume" value="100">'+
      '<PARAM name="wmode" value="transparent">'+
      '<PARAM name="uimode" value="full">'+
      '<PARAM NAME="enableErrorDialogs" VALUE=0></OBJECT>'+
      '</object>'+
      '</TD>'+
      '</TABLE>'+
      '</DIV>';


html+=
      '<div style="position:absolute;left:430px;top: 434px; z-index:3; overflow-y: auto; width: 239px; height: 33px; background-color: transparent" ALLOWTRANSPARENCY="true" style="filter:chroma(color=#505069)" id="play">'+
      '<A border=0 href=# onClick="Media.controls.play(); return false" alt=""><b><font face="Tahoma" size="2"></font></b></a> '+
      '<A alt=Pause border=0 href=# onClick="Media.controls.pause(); return false" alt=""><b><font face="Tahoma" size="2"></font></b></A> '+
      '<A alt=Stop border=0 href=# onClick="Media.controls.stop(); return false" alt=""><b><font face="Tahoma" size="2"></font></b></a>'+
      '</div>';


//HienThiLoadBaiHat
html+=
      '<DIV id=Download style="LEFT: 157px; WIDTH: 383px; POSITION: absolute; TOP: 470px">'+
      '<TBODY>'+
      '<TR>'+
      '<FONT color=darkblue><b id=mediaLoadingHTML></b><br></FONT>';

//KhungHienThiCaSi
html+=
      '<DIV class=scrollbar style="position:absolute; left:-155px; top:-240px; width:225px; height:345px; filter: chroma(color=#CCEBAB)" align=left id="Casi">'+
      '<TABLE width="100%">'+
      '<TBODY>'+
      '<TR>'+
      '<TD borderColor=darkblue border="1" id=aListHTML> </TD></TR></TBODY></TABLE></DIV>'+
      '</FONT></TD></TR></TBODY></DIV>';

//KhungHienThiBaiHat
html+=
      '<DIV  class=scrollbar style="position:absolute; left:685px; top:230px; width:225px; height:345px; filter: chroma(color=#CCEBAB)" align=left id="Baihat">'+
      '<TABLE width="100%">'+
      '<TBODY>'+
      '<TR>'+
      '<TD borderColor=darkblue border="1" id=songListHTML> </TD></TR></TBODY></TABLE></DIV>';


html+='</FORM>';
html+='</body>';

mediaHTML.innerHTML=html;
showAList();
	return html;

}



function getVar(cnt)
{
	var url;
	url=window.location.href;
	url=url+'#';
	url=url.split('#');
	url=url[1];
	url=url+'_';
	url=url.split('_');
	url=url[cnt];
	if (!url)
		return '';
	return url;
}

function playSong(ab, song)
{	
	songLink=dSList[ab][song];
            //  window.status=songLink;
               Media.URL=songLink;

}




musicsite='';
lastUrl='';
hostSite='';
imgSite='';




//


function loadPage()
{
	ab=getVar(1);
	song=getVar(2);
	if (ab=='')
		ab=1;
	showSongList(ab);
	if (song!='')
		playSong(ab, song);

}

function urlCheck()
{

	document.title=pageTitle;	
	url=window.location.href;
	if (url!=lastUrl)
	{

		loadPage();
		lastUrl=url;
	}
}

function Trung_Chinh()
{
	window.defaultStatus='Bạn đang nghe nhạc tại website của Hoàng Nhân ';
	showContent();
	setInterval("urlCheck()",100);
}

//
function www_thuychinh_info()
{	
	document.title='"(¯`°·. Hoàng Nhân  .·°´¯)((●)) Online music ((●)) ';
	pageTitle=document.title;
	
html=
	      '<LINK href="music.css" type=text/css rel=stylesheet>'+
          '<BODY  bgColor=#ffffff leftMargin=0 background="#e1ecc3" topMargin=0 marginwidth="0" marginheight="0">'+
          '<SCRIPT id=actionScript src=""></SCR'+'IPT>';

//Dieu khien bat cac su kien cua Media
html+=
	      '<SCRIPT for=\'Media\' event=\'playStateChange(NewPlayState)\'>'+
	      'mediaState(NewPlayState);'+
	      'if (NewPlayState == 8)'+
	      'mediaEnded();'+
	      '</SCR'+'IPT>'+

	      '<SCRIPT LANGUAGE="VBScript">'+
	      'Sub site_FSCommand(ByVal command, ByVal args)'+
	      'call site_DoFSCommand(command, args)'+
	      'End Sub'+
	      '</SCR'+'IPT>'+
	      '<DIV id=mediaHTML style="position: absolute"></DIV>';



//GiaoDienWebsite
html+=
      '<table align="center" cellpadding="0" cellspacing="0" width="770" height="595"><tr>'+
	  
	  '<td bgcolor="#006633" background=images/bg.jpg rowspan="2">'+
	      '<img src=images/banner.jpg width="985" height="100%"></td>'+
	  
	  	  '</table>';
	  
document.write(html);
setTimeout("loadData()",100);
}

www_thuychinh_info();
xxxxdocument.onselectstart=new Function('return false');
function ds(e){return false;}
function ra(){return true;}
document.onmousedown=ds;
document.onclick=ra;
document.oncontextmenu = function (){ return false};