// detect if browser and operation system are Windows IE5+
// if so set pcie = true

var pcie = false;

if ((navigator.platform == "Win32") && (document.getElementById && document.createElement)) {
pcie = true;
}

function openPlayerWindow() {
var app = navigator.appName;
var ver = navigator.appVersion;
var mac = ver.indexOf("Macintosh") > 0; 

if (mac) {
if (app == 'Netscape') {
alert ('Sorry, it is currently not possible to listen to totallradio using Netscape for Mac.');
} else {
openMacPlayer();
}
} else {
var playerURL = "/player/pages/status.php";
window.open(playerURL,'totallyradio_player','height=168,width=303,directories=no,toolbar=no,menubar=no,location=no,status=no,scrollbars=no,resizable=no');
}
}

function openMacPlayer(show, file) {
var yes = 1;
var no = 0;

var menubar = no;      // The File, Edit, View Menus
var scrollbars = no;   // Horizontal and vertical scrollbars
var locationbar = no;  // The location box with the site URL
var directories = no;  // the "What's New", "What Cool" links
var resizable = no;    // Can the window be resized?
var statusbar = no;    // Status bar (with "Document: Done")
var toolbar = no;      // Back, Forward, Home, Stop toolbar

windowprops = "width=346" + ",height=250" + ",top=0,left=0";

windowprops += (menubar ? ",menubars" : "") +
(scrollbars ? ",scrollbars" : "") +
(locationbar ? ",location" : "") +
(directories ? ",directories" : "") +
(resizable ? ",resizable" : "") +
(statusbar ? ",status" : "") +
(toolbar ? ",toolbar" : "");

if (show) {
page = "/player/pages/macplayer.php?show=" + show; 
}

if (file) {
page = "/player/pages/macplayer.php?file=" + file;
}

if (!show && !file) {
page = "/player/pages/macplayer.php";
}

window.open(page, 'totallyradio_mac_player', windowprops);
}


function openPlayerWindow2() {
if (!pcie) {
openMacPlayer();
} else {
var playerURL = "/player/pages/status.php";
window.open(playerURL,'totallyradio_player','height=168,width=303,directories=no,toolbar=no,menubar=no,location=no,status=no,scrollbars=no,resizable=no');
}
}

if (window.defaultStatus) {
window.defaultStatus='t o t a l l y r a d i o';
}
