/* PopUp */

function Popup(page,width,height,scroll,location,statusbar,menubar,resizable) {
	var now = new Date();
	var hour        = now.getHours();
	var minute      = now.getMinutes();
	var second      = now.getSeconds();
	
	if (!scroll) { scroll = 'no'; }
	if (!location) { location = 'no'; }
	if (!statusbar) { statusbar = 'no'; }
	if (!menubar) { menubar = 'no'; }
	if (!resizable) { resizable = 'no'; }
	var name = "popup";
	window.open(''+ page +'',name,'toolbar=0,scrollbars='+ scroll +',location='+ location +',statusbar='+ statusbar +',menubar='+ menubar +',resizable='+ resizable +',width='+ width +',height='+ height);
}

function DisplayBlock(sID) { 
   var sElement = document.getElementById(sID);  
   if (sElement.className=="displayblock") { 
      sElement.className="displaynone"; 
   } 
   else { 
      sElement.className="displayblock"; 
   } 
}

// Pop-Up Embedder Script by David Battino, www.batmosphere.com
// Version 2006-05-31  
// OK to use if this notice is included
   
function BatmoAudioPop(filedesc,filepath,WindowNumber) 
{

// Get Operating System 
var isWin = navigator.userAgent.toLowerCase().indexOf("windows") != -1
if (isWin) {
    // Use MIME type = "application/x-mplayer2";
	visitorOS="Windows";
} else {
    // Use MIME type = "audio/mpeg"; // or audio/x-wav or audio/x-ms-wma, etc.
	visitorOS="Other";
}

// Get the MIME type of the audio file from its extension (for non-Windows browsers)
var mimeType = "audio/mpeg"; // assume MP3/M3U
var objTypeTag = "application/x-mplayer2"; // The Windows MIME type to load the WMP plug-in in Firefox, etc.

var theExtension = filepath.substr(filepath.lastIndexOf('.')+1, 3); // truncates .aiff to aif
if (theExtension.toLowerCase() == "wav") { mimeType = "audio/x-wav"};
if (theExtension.toLowerCase() == "aif") { mimeType = "audio/x-aiff"}; 
if (theExtension.toLowerCase() == "wma") { mimeType = "audio/x-ms-wma"};
if (theExtension.toLowerCase() == "mid") { mimeType = "audio/mid"};
// Add additional MIME types as desired

if (visitorOS != "Windows") { 
objTypeTag = mimeType; // audio/mpeg, audio/x-wav, audio/x-ms-wma, etc.
};

    PlayerWin = window.open('',WindowNumber,'width=300,height=178,top=0,left=0,screenX=0,screenY=0,resizable=0,scrollbars=0,titlebar=0,toolbar=0,menubar=0,status=0,directories=0');

    PlayerWin.focus();
    PlayerWin.document.writeln("<html><head><title>" + filedesc + "</title></head>");
    PlayerWin.document.writeln("<body style='background:#e5dac1'>"); // specify background img if desired
    PlayerWin.document.writeln("<div align='center'>");
    PlayerWin.document.writeln("<h2 style='padding:0 0 10px 0; margin:0; font:bold 18px/22px Times New Roman,Serif; color:#01515d; text-transform:capitalize; text-align:left;'>Radio</h2>");
    PlayerWin.document.writeln("<object width='280' height='69'>");
    PlayerWin.document.writeln("<param name='src' value='" +  filepath + "'>");
    PlayerWin.document.writeln("<param name='type' value='" + objTypeTag + "'>");
    PlayerWin.document.writeln("<param name='autostart' value='1'>");
    PlayerWin.document.writeln("<param name='showcontrols' value='1'>"); 
    PlayerWin.document.writeln("<param name='showstatusbar' value='1'>");
    PlayerWin.document.writeln("<embed src ='" + filepath + "' type='" + objTypeTag + "' autoplay='true' width='280' height='69' controller='1' showstatusbar='1' bgcolor='#e5dac1' kioskmode='true'>");
    PlayerWin.document.writeln("</embed></object></div>");
    PlayerWin.document.writeln("<p style='padding:0; margin:10px 0; font:normal 12px/16px Arial,Verdana,Sans-Serif; color:#5c503a;'><a href='" + filepath +"' style='color:#06515b;'>Download this file</a> (right-click or Control-click).</p>");
    PlayerWin.document.writeln("<p style='padding:0; margin:0; font:normal 12px/16px Arial,Verdana,Sans-Serif; color:#293859; text-align:center;'><a href='javascript:window.close();' style='color:#06515b;'>Close This Window</a></p>");
    PlayerWin.document.writeln("</body></html>");

    PlayerWin.document.close(); // "Finalizes" new window
}