<!-- 
// (c) 2002 Live365.  All rights reserved.
// Requires ads.js and popup.js.

function DrawPlayIcon(image_dir, image_size, server_mode, station_status, link)
{
	CalcPlayIcon('', image_dir, image_size, server_mode, link, station_status, 1);
}


function DrawNamedPlayIcon(image_dir, image_size, server_mode, station_status, link)
{
	CalcPlayIcon("PlayIconImage", image_dir, image_size, server_mode, link, station_status, 1);
}


function ResetPlayIcon(image_dir, image_size, server_mode, station_status, link)
{
	var vals = CalcPlayIcon("PlayIconImage", image_dir, image_size, server_mode, link, station_status, 0);

	if (document.images.PlayIconImage) {
		document.images.PlayIconImage.src = vals[0];
		document.images.PlayIconImage.alt = vals[1];
	}
}


function CalcPlayIcon(name, image_dir, image_size, server_mode, link, station_status, drawIt)
{
	var width, height;
	var hspace = 0;
	var endLink = '</A>';
	var alt = "Click to listen";
	var oda_suffix = "";
	var image_type = "-reg";
	var image_mode = "-rad";

	if (image_size == 'sm') {
		width = 15;
		height = 15;
	}
	else if (image_size == 'me') {
		width = 21;
		height = 21;
	}

	if (image_size == 'la') {
		if (server_mode == 'OR') {
			width = 45;
			height = 62;
			//hspace = 10; 
		}
		else {
			width = 45;
			height = 62;
		}
	}

	if (server_mode == 'OD') {
		image_mode = "-oda";
	}

	if (link == '' || station_status == 'OFF' || station_status == 'PRO_SOLD_OUT' || station_status == 'TOO_FAST' || station_status == 'NA') {
		image_type = "-dim";
		link = '';
		endLink = '';
		alt = "Station not broadcasting at this time.";

		if (station_status == 'PRO_SOLD_OUT')
			alt = "Station sold out at this time.";
		else if (station_status == 'TOO_FAST') {
			var speed = '';
			
			try {
				speed = ' of ' + GetCookieEx('box_mc', 'bitrate') + 'kbps';
				link = "<a href='/cgi-bin/personalize.cgi?redirectUrl=" + encodeURIComponent(pageLocation) + "'>";
			}
			catch(e) {
			}
			
			alt = "You cannot listen to this station with your connection speed" + speed + ".  Click to go to Listen Settings.";
		}
		else if (station_status == 'NA'){
			alt = "Station not available at this time.";		
		}
	}
	else if (station_status == 'PM_ONLY' || station_status == 'SOLD_OUT') {
		image_type = "-afl";
		alt = "Preferred Members Only";
	}
	else if (station_status == 'SUBSCRIPTION') {
		image_type = "-sub";
		alt = "Access restricted to this station's subscribers only; click to find out more.";
	}

	var img = image_dir + "/listen-" + image_size + image_mode + image_type + ".gif";

	if (drawIt) {
		if (name)
			name = 'NAME="' + name + '" ';

		document.write(link + '<IMG ' + name + 'SRC="' + img + '" ALIGN="absmiddle" BORDER=0 HSPACE="' + hspace + '" VSPACE=0 WIDTH="' + width + '" HEIGHT="' + height + '" ALT="' +  alt + '">' + endLink);
	}

	return new Array(img, alt, width, height, hspace, link, endLink);
}


// -->