<!--
var win1Open = null
var win2Open = null
var win3Open = null
var win4Open = null
function openPopUp(windowURL, windowName, windowWidth, windowHeight){
  var winHandle = window.open(windowURL,windowName,"toolbar=no,scrollbars=yes,resizable=yes,width=" + windowWidth + ",height=" + windowHeight)
  return winHandle
  }
function winClose(){    // close all open pop-up windows
  if(win1Open != null) win1Open.close()
  if(win2Open != null) win2Open.close()
  if(win3Open != null) win3Open.close()
  if(win4Open != null) win4Open.close()

  }
function openPopUpWindow(){}  // does nothing but required by JavaScript & shows in status bar

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 startMusic(mem_num, music, voice, tou_musicfile, tou_musicvol, tou_rtmp, tou_mp3, tou_musicloop, lib_filename) {
	var file1 = ''
	var file2 = ''
	var volume1= 0
	var volume2= 0
	var loop = 0
	if (music==1) {
		file1 = '../audio/library/' + lib_filename
	} else if (music==2) {
		file1 = '../audio/music/' + mem_num + '/' + tou_musicfile
	}
	
	if(file1!='') {
		flowplayer("player1", {src:"../voice/flowplayer-3.1.5.swf",wmode: 'transparent'},{
			plugins: {
				controls: {
					fullscreen: false, 
					volume: false, 
					mute: false,
					height: 20
				},
				audio: {
					url: 'flowplayer.audio-3.1.2.swf'
				}
			},
			clip: {
				url: file1
			},
			onLoad: function() {
				this.setVolume(tou_musicvol*10);
			},
			onFinish: function() {
				if(tou_musicloop) this.play()
				else this.stop()
			}
		});
	}
	if (voice==1) {
		//RTMP
		flowplayer("player2", {src:"../voice/flowplayer-3.1.5.swf",wmode: 'transparent'},{
			plugins: {
				controls: {
					fullscreen: false, 
					volume: false, 
					mute: false,
					height: 20 
				},
				rtmp: { 
					url: 'flowplayer.rtmp-3.1.3.swf', 
					netConnectionUrl: 'rtmp://bcg22rpp.rtmphost.com/irecord',
					durationFunc: 'getStreamLength' 
				}
			}, 
			clip: {
				provider:'rtmp',
				url:tou_rtmp
			}
		});
	
	} else if (voice==2) {
		//TTS	
		flowplayer("player2", {src:"../voice/flowplayer-3.1.5.swf",wmode: 'transparent'},{
			plugins: {
				controls: {
					fullscreen: false, 
					volume: false, 
					mute: false,
					height: 20 
				},
				audio: {
					url: 'flowplayer.audio-3.1.2.swf'
				}
			},
			clip: {
				url: '../audio/tts/' + tou_mp3
			},
			onLoad: function() {
				this.setVolume(100);
			}
		});
	}
}