var expDays =1; 
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;
}
function SetCookie (name, value) {  
var argv = SetCookie.arguments;  
var argc = SetCookie.arguments.length;  
var expires = (argc > 2) ? argv[2] : null;  
var path = (argc > 3) ? argv[3] : null;  
var domain = (argc > 4) ? argv[4] : null;  
var secure = (argc > 5) ? argv[5] : false;  
document.cookie = name + "=" + escape (value) + 
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 
((path == null) ? "" : ("; path=" + path)) +  
((domain == null) ? "" : ("; domain=" + domain)) +    
((secure == true) ? "; secure" : "");
}
function DeleteCookie (name) {  
var exp = new Date();  
exp.setTime (exp.getTime() - 1);  
var cval = GetCookie (name);  
document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}
var exp = new Date(); 
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));
function amt(){
var count = GetCookie('count')
if(count == null) {
SetCookie('count','1')
return 1
}
else {
var newcount = parseInt(count) + 1;
DeleteCookie('count')
SetCookie('count',newcount,exp)
return count
   }
}
function getCookieVal(offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}

function checkCount() {
var count = GetCookie('count');
if (count == null) {
count=1;
SetCookie('count', count, exp);
var element = document.getElementById('mysound_wrapper');
element.innerHTML = embedSound("http://theultimatecaribbeanhomepage.com/mbuna/cr12.asx")
}
else {
count++;
SetCookie('count', count, exp);
switchSongs(0);
   }
}

var songs = new Array(
  "",
  "Skip Intro/Select Music or News",
  "http://theultimatecaribbeanhomepage.com/mbuna/blank.asx",
  "SKIP INTRO",
  "http://theultimatecaribbeanhomepage.com/mbuna/IslandFrank.asx",
  "IslandFrank",
  "http://theultimatecaribbeanhomepage.com/mbuna/bajan.asx",
  "BajanRadio",
  "http://theultimatecaribbeanhomepage.com/mbuna/XradioDC-Soca&Reggae.asx",
  "My Xradio - Soca & Reggae",
  "http://theultimatecaribbeanhomepage.com/mbuna/Scratch.ReggaeRocksteadySka.asx",
  "Scratch-ReggaeRocksteadySka",
  "http://theultimatecaribbeanhomepage.com/mbuna/WestIndianTimes.asx",
  "WestIndianTimes",
  "http://theultimatecaribbeanhomepage.com/mbuna/SKYfm-RootsReggae.asx",
  "SKYfm-RootsReggae",
  "http://theultimatecaribbeanhomepage.com/mbuna/reggae-vibes.asx",
  "ReggaeVibes",
  "http://www.highpark.pwp.blueyonder.co.uk/bexley/rrrstream.asx",
  "RootsRockReggae",
  "http://theultimatecaribbeanhomepage.com/mbuna/rootsreggaeradio.asx",
  "RootsReggaeRadio",
  "http://theultimatecaribbeanhomepage.com/mbuna/MasalaRadio.asx",
  "MasalaRadio",
  "http://www.whensteeltalks.com/spilc/dio/radioshow.wma",
  "PanRadio",
  "http://theultimatecaribbeanhomepage.com/mbuna/CaribbeanGospelJubilee.asx",
  "CaribbeanGospelJubilee",
  "http://theultimatecaribbeanhomepage.com/mbuna/BBCWorldService.asx",
  "BBCWorldService",
  "",
  "-------------------------------------------",
  "http://theultimatecaribbeanhomepage.com/mbuna/SocaFM.asx",
  "SocaFM",
  "http://theultimatecaribbeanhomepage.com/mbuna/vibezradio.asx",
  "VibezRadio",
  "http://theultimatecaribbeanhomepage.com/mbuna/BigupRadio-roots.asx",
  "BigupRadio-Roots",
  "http://theultimatecaribbeanhomepage.com/mbuna/caribplanet.asx",
  "CaribPlanet",
  "http://theultimatecaribbeanhomepage.com/mbuna/largeradio.asx",
  "LargeRadio",
  "http://theultimatecaribbeanhomepage.com/mbuna/spiceislander.asx",
  "SpiceIslander",
  "http://theultimatecaribbeanhomepage.com/mbuna/EliteWebRadio.asx",
  "EliteWebRadio",
  "http://theultimatecaribbeanhomepage.com/mbuna/junglistz.asx",
  "Junglistz-UK Flavor",
  "http://theultimatecaribbeanhomepage.com/mbuna/RadioReggaeton.asx",
  "RadioReggaeton",
  "http://theultimatecaribbeanhomepage.com/mbuna/WebadubFM-FrReggae.asx",
  "FrenchWestIndies-Webadub",
  "http://theultimatecaribbeanhomepage.com/mbuna/CocoRadio.asx",
  "CocoRadio-Reggae",
  "http://theultimatecaribbeanhomepage.com/mbuna/WorldFlavasRadio.asx",
  "WorldFlavasRadio",
  "http://theultimatecaribbeanhomepage.com/mbuna/MizikRADIO.asx",
  "MizikRADIO",
  "http://theultimatecaribbeanhomepage.com/mbuna/SmoothJazz-SkyFM.asx",
  "SmoothJazz-SkyFM",
  "http://theultimatecaribbeanhomepage.com/mbuna/PrayzFM-St.Lucia.asx",
  "PrayzFM-St.Lucia",
  "http://theultimatecaribbeanhomepage.com/mbuna/BBCCaribbeanReport.ram",
  "BBC-CaribbeanReport"
);

function switchSongs(i)
{
  var file = songs[i * 2];
  var title = songs[i * 2 + 1];
  var element = document.getElementById('mysound_wrapper');
  element.innerHTML = embedSound(file);
  var element = document.getElementById('songtitle');
  //element.innerHTML = title;
  var selector = document.getElementById('song_selector');  
  selector.selectedIndex = i;
  return;
}

function embedSound(sound)
{
  return '<embed src="' + sound + '" autostart="true" ' +
    'width="0" height="0">';
}