//¹è°æÀ½¾Ç
/*============ Volume Control Functions ============*/
var XX, Pos_Left, setVolMove;
var	vol_length=38;
var	left_origin = 0;
var	left_max = left_origin + vol_length;
var currentVolumePercent;	// ÇöÀç º¼·ý°ªÀ» ÀúÀåÇÏ´Â º¯¼ö

	function InitVolume(percent)
	{
	  	if (window.frames.i_frame != null) {
			SetVolumePercent(percent);	// Ã³À½¿¡ ºÒ·Á¾ß ÇÏ´Â ÇÔ¼ö. ÇÃ·¹ÀÌ¾îÀÇ º¼·ýÅ©±â¿Í, º¼·ý¹öÆ°ÀÇ À§Ä¡¸¦ ÃÊ±âÈ­ÇÔ.
			window.frames.i_sound.document.all.volbar.style.pixelLeft = left_origin + vol_length*percent;
			window.frames.i_sound.document.all.curposition.style.width=percent * vol_length; 
	    }
	}

	function SetVolumePercent(percent)
	{
	  	if (window.frames.i_frame != null) {
			currentVolumePercent = percent;
			window.frames.i_frame.document.all('Player').Volume = -2500+2500*percent; 
		}	
	}
	
  // percent : 0.0~1.0
  function SetVolume()
  { 
    if (window.frames.i_frame != null) {
			XX=i_sound.event.clientX; 
			Pos_Left=i_sound.document.all.volbar.style.pixelLeft; 
			setVolMove=true; 
			window.frames.i_sound.document.onmousemove=drag_dropie; 
			if (i_sound.document.all)
			{
				i_sound.document.onmouseup=endVolume;
			} 
	 }
  } 
  
  function drag_dropie()
  { 
	if (setVolMove==true)
	{ 
		mov_amount = i_sound.event.clientX-XX;
	//	alert(mov_amount);
		new_pos = Pos_Left + mov_amount;
		
		if ( (new_pos >= left_origin) && (new_pos < left_max))
		{ 
			window.frames.i_sound.document.all.volbar.style.pixelLeft=Pos_Left+mov_amount; 
			window.frames.i_sound.document.all.curposition.style.width=Pos_Left+mov_amount; 
			per=(i_sound.document.all.volbar.style.pixelLeft-left_origin)/vol_length; 
			
			SetVolumePercent(per);
			window.frames.i_frame.document.all.Vol.value=per;
			window.frames.i_frame.document.all.sound_scroll.value=true;
		}
		
		return false; 
	}
  }
var setPlaybarMove = false;
var setPlaybarClick= false;

 function PlayBarClickStart(new_pos)
  { 
  
	
  } 
  
 
  function endVolume()
  { 
	if (setVolMove==true)
	{ 
		setVolMove=false; return false; 
	}
  }
  
/*------------------------------------------------------------*/


	var play_ck=0;
	var pause=0;
	

	function bplay() {
	  
		if (window.frames.i_frame != null) {
		   // MPlayer = document.all("Player");
		//	if( MPlayer.PlayState == 1 || MPlayer.PlayState == 0)
		//	{       
			     //   bstop2(); 
					if (play_ck==0) {
                        
						window.frames.i_frame.imageBanner();	
						window.frames.i_frame.document.all.load_ck.value="1";
						window.frames.i_frame.document.all.hidden_seq.value="exist";
						window.frames.i_frame.entryInfo();
					//	bstop2(); 
						InitVolume(0.50);
				//		document.all.Image63.src="/iframe/images/cd2.gif";
						document.all.bplay.src="/iframe/images/bmusic_play_on.gif";
						if (document.all.Image65 != null ) {
							document.all.Image65.src="/iframe/images/cd.gif";
						}
						if (document.all.b01play != null ) {
							document.all.b01play.src="/iframe/images/b01.gif";
						}
						if (document.all.b02stop != null ) {
							document.all.b02stop.src="/iframe/images/b02.gif";
						}
						if (document.all.b03pause != null ) {
							document.all.b03pause.src="/iframe/images/b03.gif";
						}
						if (pause==1) {
							pause=0;
							}
					}
		//	}
		  } else {
		      alert("test.");
		  }
	}
	
	function bstop() {
		 if (window.frames.i_frame != null) {
				//document.all.Image63.src="/iframe/images/cd2_off.gif";
				document.all.bplay.src="/iframe/images/bmusic_play.gif";
			//	alert(i_frame.document.all("Player").PlayState);
				if ( i_frame.document.all("Player").PlayState ==0)
				{   
					 
					back_music.stop();
				}
				
				i_frame.document.all('Player').Stop();
				i_frame.document.all.hidden_seq.value ="";
		  } else {
		      alert("Á¤»óÀûÀÎ °æ·Î°¡ ¾Æ´Õ´Ï´Ù.");
		  }
		  
	}
  
	  function MuteIt()
	 {
		  if (window.frames.i_frame != null) {
				if( window.frames.i_frame.document.all('Player').mute==true )
				{
					window.frames.i_frame.document.all('Player').mute = false;
					document.muteicon.src="/iframe/images/bmusic_sound.gif";
				}
				else
				{
					window.frames.i_frame.document.all('Player').mute = true;
					document.muteicon.src="/iframe/images/bmusic_sound_x.gif";
				}
		   } else {
		      alert("Á¤»óÀûÀÎ °æ·Î°¡ ¾Æ´Õ´Ï´Ù.");
		  }
	}	

	function status_rate() {
		var x = 0;
		x = parseFloat(parseInt(parent.i_frame.document.Player.CurrentPosition)*100/parseInt(parent.i_frame.document.Player.Duration));
		document.all.status_bar.style.width=x+"%";
	}

	function bg_music_set() {
			parent.i_frame.bg_music_set();
	}
	function stop_back() {
		if (window.frames.i_frame != null) {
			if (window.frames.i_frame.document.all('Player') != null) {	
				window.frames.i_frame.document.all('Player').Stop();
			}
		} else {
             alert("Á¤»óÀûÀÎ °æ·Î°¡ ¾Æ´Õ´Ï´Ù.");
		}
	}



//¼±±³¹æ¼Û


/*============ Volume Control Functions ============*/
var XX, Pos_Left, setVolMove;
var	vol_length=38;
var	left_origin = 0;
var	left_max = left_origin + vol_length;
var currentVolumePercent;	// ÇöÀç º¼·ý°ªÀ» ÀúÀåÇÏ´Â º¯¼ö

	function InitVolume2(percent)
	{
	  	if (window.frames.i_frame != null) {
			SetVolumePercent2(percent);	// Ã³À½¿¡ ºÒ·Á¾ß ÇÏ´Â ÇÔ¼ö. ÇÃ·¹ÀÌ¾îÀÇ º¼·ýÅ©±â¿Í, º¼·ý¹öÆ°ÀÇ À§Ä¡¸¦ ÃÊ±âÈ­ÇÔ.
			window.frames.i_sound2.document.all.volbar2.style.pixelLeft = left_origin + vol_length*percent;
			window.frames.i_sound2.document.all.curposition2.style.width=percent * vol_length; 
			
	    }
	}

	function SetVolumePercent2(percent)
	{
	  	if (window.frames.i_frame != null) {
			currentVolumePercent = percent;
			window.frames.i_frame.document.all('Player2').Volume = -2500+2500*percent; 
		}	
	}
	
  // percent : 0.0~1.0
  function SetVolume2()
  { 
    if (window.frames.i_frame != null) {
			XX=window.frames.i_sound2.event.clientX; 
			Pos_Left=window.frames.i_sound2.document.all.volbar2.style.pixelLeft; 
			setVolMove=true; 
			window.frames.i_sound2.document.onmousemove=drag_dropie2; 
			if (window.frames.i_sound2.document.all)
			{
				window.frames.i_sound2.document.onmouseup=endVolume;
			} 
	 }
  } 
  
  function drag_dropie2()
  { 
	if (setVolMove==true)
	{ 
		mov_amount = window.frames.i_sound2.event.clientX-XX;
		new_pos = Pos_Left + mov_amount;
		
		if ( (new_pos >= left_origin) && (new_pos < left_max))
		{ 
			window.frames.i_sound2.document.all.volbar2.style.pixelLeft=Pos_Left+mov_amount; 
			window.frames.i_sound2.document.all.curposition2.style.width=Pos_Left+mov_amount; 
			per=(window.frames.i_sound2.document.all.volbar2.style.pixelLeft-left_origin)/vol_length; 
			
			SetVolumePercent2(per);
			window.frames.i_frame.document.all.Vol2.value=per;
			window.frames.i_frame.document.all.sound_scroll.value=true;
		}
		
		return false; 
	}
  }
var setPlaybarMove = false;
var setPlaybarClick= false;

 function PlayBarClickStart(new_pos)
  { 
  
	
  } 
  
 
  function endVolume()
  { 
	if (setVolMove==true)
	{ 
		setVolMove=false; return false; 
	}
  }
  
/*------------------------------------------------------------*/


	var play_ck=0;
	var pause=0;
	

	function bplay2() {
	  
		if (window.frames.i_frame != null) {
		   // MPlayer2 = document.all("Player2");
		//	if( MPlayer2.PlayState == 1 || MPlayer2.PlayState == 0)
		//	{       
			    //    bstop(); 
					if (play_ck==0) {
                         
						i_frame.imageBanner2();	
						i_frame.document.all.load_ck3.value="1";
						i_frame.document.all.hidden_seq2.value="exist";
						i_frame.entryInfo2();
						InitVolume2(0.50);
						// bstop(); 
					//	document.all.Image64.src="/iframe/images/cd2.gif";
						document.all.bplay2.src="/iframe/images/bmusic_play_on.gif";
						if (document.all.Image65 != null ) {
							document.all.Image65.src="/iframe/images/cd.gif";
						}
						if (document.all.b01play != null ) {
							document.all.b01play.src="/iframe/images/b01.gif";
						}
						if (document.all.b02stop != null ) {
							document.all.b02stop.src="/iframe/images/b02.gif";
						}
						if (document.all.b03pause != null ) {
							document.all.b03pause.src="/iframe/images/b03.gif";
						}
						if (pause==1) {
							pause=0;
							}
					}
		//	}
		  } else {
		      alert("Á¤»óÀûÀÎ °æ·Î°¡ ¾Æ´Õ´Ï´Ù.");
		  }
	}
	
	function bstop2() {
		 if (window.frames.i_frame != null) {
			//	document.all.Image64.src="/iframe/images/cd2_off.gif";
				document.all.bplay2.src="/iframe/images/bmusic_play.gif";
				if ( i_frame.document.all("Player2").PlayState ==0)
				{   
					back_music2.stop();
				}
				
				i_frame.document.all('Player2').Stop();
				i_frame.document.all.hidden_seq2.value ="";
		  } else {
		      alert("Á¤»óÀûÀÎ °æ·Î°¡ ¾Æ´Õ´Ï´Ù.");
		  }
		  
	}
  
	  function MuteIt2()
	 {
		  if (window.frames.i_frame != null) {
				if( window.frames.i_frame.document.all('Player2').mute==true )
				{
					window.frames.i_frame.document.all('Player2').mute = false;
					document.muteicon2.src="/iframe/images/bmusic_sound.gif";
				}
				else
				{
					window.frames.i_frame.document.all('Player2').mute = true;
					document.muteicon2.src="/iframe/images/bmusic_sound_x.gif";
				}
		   } else {
		      alert("Á¤»óÀûÀÎ °æ·Î°¡ ¾Æ´Õ´Ï´Ù.");
		  }
	}	

	function status_rate2() {
		var x = 0;
		x = parseFloat(parseInt(parent.i_frame.document.Player2.CurrentPosition)*100/parseInt(parent.i_frame.document.Player2.Duration));
		document.all.status_bar.style.width=x+"%";
	}

	function bg_music_set2() {
			parent.i_frame2.bg_music_set();
	}
	function stop_back2() {
		if (window.frames.i_frame != null) {
			if (parent.i_frame.document.all('Player2') != null) {	
				parent.i_frame.document.all('Player2').Stop();
			}
		} else {
             alert("Á¤»óÀûÀÎ °æ·Î°¡ ¾Æ´Õ´Ï´Ù.");
		}
	}


  function popaod(arg,pid,nid)
      {
        window.open('http://multiplayer.godpia.com/skin/aod.asp?arg='+arg+'&arg1=sarang&personid='+pid+'&name='+nid,'','top=0,left=0,scrollbars=no,width=758,height=480');
      }