// JavaScript Document
                        
function submitToAudioPlayer(trackNameStripped, swfName, albumName, clickTrack) { 
	var oIframe = document.getElementById("topFrame");
	var oDoc = oIframe.contentWindow || oIframe.contentDocument;
	if (oDoc.document) {
	    oDoc = oDoc.document;
	}
	oDoc.myFlash.SetVariable("variableListener", trackNameStripped);
	oDoc.myFlash.SetVariable("swfListener", swfName);
	oDoc.myFlash.SetVariable("albumListener", albumName);
	oDoc.myFlash.SetVariable("clickListener", clickTrack);
}
                        
function submitToAudioPlayerPause(pauseTrackCheck) { 
	var oIframe = document.getElementById("topFrame");
	var oDoc = oIframe.contentWindow || oIframe.contentDocument;
	if (oDoc.document) {
	    oDoc = oDoc.document;
	}

	oDoc.myFlash.SetVariable("pauseTrackCheckListener", pauseTrackCheck);

}

function initPopPlayer() {
	// Only open popup audio player if it's not already opened
	if (!window.windowHandle) {
		popPlayer();
	}
	
/*	b = document.getElementsByTagName("body");
	b = b[0];
	if (b.addEventListener){
  		b.addEventListener('click', popPlayer, false); 
	} else if (b.attachEvent) {
 		b.attachEvent('onclick', popPlayer);
	 }
*/
}

function popPlayer() {
	//window.open ("/aplayer_flash.php", "mywindow","status=0,toolbar=0,resizeable=0,height=350,width=375,scrollbars=0,location=0,resizeable=0");
	windowHandle = window.open ('/media_single.php?module=video_single&video_id=8&audiopop=1', 'single_video', 'menubar=no, resizable=yes, scrollbars=no, location=no, toolbar=no');
	return false;

/*	if (b.addEventListener){        
		b.removeEventListener('click', popPlayer, false);     
	} else if (b.attachEvent){       
		 b.detachEvent('onclick', function(){});    
	}
*/
}