<!--

function WishlistGetTracks() 
{
  var Wlist = WishlistGet();
  var Tracklist = "";
  if (Wlist == "empty" || Wlist == "")
  {
    Tracklist = "Your wishlist is currently empty";
  }
  else
  {
    var Tracks = Wlist.split("|");
    var i = 1;
    while(i < Tracks.length)
    {
      Tracklist = Tracklist + "Track"+i+": "+Tracks[i]+"\n";
      i++;
    }
  }
  return Tracklist;
}


function WishlistGet() 
{
 var Wlist = "";
 if(document.cookie) {
  var Wstart = document.cookie.indexOf("=") + 1;
  var Wend = document.cookie.indexOf(";");
  if (Wend == -1)
   Wend = document.cookie.length;
  Wlist = document.cookie.substring(Wstart,Wend);
 }
 return Wlist;
}

function WishlistSet(_id, _value, _exp) 
{
 document.cookie = _id + "=" + _value + "; expires=" + _exp + ";";
}

function WishlistClear( ) 
{
 document.cookie = "Tracks=empty;";
 return ("");
}

function WishlistAdd(newTrack) 
{
  if(navigator.cookieEnabled == true)
  {
    var _expAddOn = 1000*60*60*24*60;
    var _now = new Date();
    var _endTime = new Date(_now.getTime() + _expAddOn);
    var expTime = _endTime.toGMTString();
    var Wishlist = WishlistGet();
    if(document.cookie) 
    {
      Wishlist = Wishlist + "|" + newTrack;
      WishlistSet("Tracks",Wishlist,expTime);
    }
    else 
    {
      Wishlist = "empty" + "|" + newTrack;
      WishlistSet("Tracks",Wishlist,expTime);
    }
    return(expTime);
  }
  else
  {
    alert('Cookies are NOT enabled on your computer.\nIn order to use this service you need to enable cookies in your browser settings.\nthe radio42 cookie is only used to store the wishlist tracks.');
    return("NO TRACK ADDED!!!");
  }
}

function popAmazon(URL,NAME) 
{
amznwin=window.open(URL,NAME,'location=yes,scrollbars=yes,status=no,toolbar=yes,resizable=yes,width=800,height=500,screenX=10,screenY=10,top=10,left=10');
amznwin.focus();
}


//-->

