// totallyradio player launch functions version 2.0
// written by Simon West
// copyright Festival Productions 2001

// playShow(show)
// playFile(file)
// autoPlay(show)

var play='Y';


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

if (mac) {
if (app == 'Netscape') {
var siteURL = "http://www.totallyradio.com";
window.open(siteURL,'totallyradio_main','height=300,width=612,toolbar=yes,menubar=yes,location=no,status=yes,scrollbars=yes,resizable=yes');
} else {
var siteURL = "http://www.totallyradio.com/index.php?playmac=Y&show=" + show;
window.open(siteURL,'totallyradio_main','height=300,width=612,toolbar=yes,menubar=yes,location=no,status=yes,scrollbars=yes,resizable=yes');
}
} else {
var siteURL = "http://www.totallyradio.com/index.php?playing=N";
window.open(siteURL,'totallyradio_main','height=300,width=612,toolbar=yes,menubar=yes,location=no,status=yes,scrollbars=yes,resizable=yes');

var playerURL = "http://www.totallyradio.com/player/pages/status.php?show=" + show;
window.open(playerURL,'totallyradio_player','height=168,width=303,directories=no,toolbar=no,menubar=no,location=no,status=no,scrollbars=no,resizable=no');
}
}

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

if (mac) {
if (app == 'Netscape') {
var siteURL = "http://www.totallyradio.com";
window.open(siteURL,'totallyradio_main','height=300,width=612,toolbar=yes,menubar=yes,location=no,status=yes,scrollbars=yes,resizable=yes');
} else {
var siteURL = "http://www.totallyradio.com/index.php?playmac=Y&file=" + file;
window.open(siteURL,'totallyradio_main','height=300,width=612,toolbar=yes,menubar=yes,location=no,status=yes,scrollbars=yes,resizable=yes');
}
} else {
var siteURL = "http://www.totallyradio.com/index.php?playing=N";
window.open(siteURL,'totallyradio_main','height=300,width=612,toolbar=yes,menubar=yes,location=no,status=yes,scrollbars=yes,resizable=yes');

var playerURL = "http://www.totallyradio.com/player/pages/status.php?file=" + file;
window.open(playerURL,'totallyradio_player','height=168,width=303,directories=no,toolbar=no,menubar=no,location=no,status=no,scrollbars=no,resizable=no');
}
}

function autoPlay(show) {

if (play != "N") {

var playerset = GetCookie('playerset');

var app = navigator.appName;
var ver = navigator.appVersion;
var mac = ver.indexOf("Macintosh") > 0;
if (playerset != 'yes') {
if (mac) {
// mac not launched
} else {
var playerURL = "http://www.totallyradio.com/player/pages/status.php?show=" + show;
window.open(playerURL,'totallyradio_player','height=168,width=303,directories=no,toolbar=no,menubar=no,location=no,status=no,scrollbars=no,resizable=no');
}
}
document.cookie = "playerset=yes";
}
}

function getCookieVal (offset) { 
var endstr = document.cookie.indexOf (";", offset); 
if (endstr == -1) 
endstr = document.cookie.length; 
return unescape(document.cookie.substring(offset, endstr)); 
} 

function GetCookie (name) { 
var arg = name + "="; 
var alen = arg.length; 
var clen = document.cookie.length; 
var i = 0; 
while (i < clen) { 
var j = i + alen; 
if (document.cookie.substring(i, j) == arg) 
return getCookieVal (j); 
i = document.cookie.indexOf(" ", i) + 1; 
if (i == 0) 
break; 
} 
return null; 
} 