home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Minami 79
/
MINAMI79.iso
/
Extra
/
MPSetup.exe
/
1033
/
RCDATA
/
CABINET
/
wmploc.DLL
/
HTML
/
RELATEDRADIO.HTC
< prev
next >
Wrap
Text File
|
2002-12-14
|
4KB
|
131 lines
<PUBLIC:COMPONENT lightWeight=true>
<PUBLIC:METHOD NAME="reload" />
<PUBLIC:METHOD NAME="updateMedia" />
<PUBLIC:ATTACH EVENT="onresize" ONEVENT="resize()" />
<PUBLIC:METHOD NAME="noData" />
<PUBLIC:METHOD NAME="playStation" />
<SCRIPT LANGUAGE="JScript">
function reload() { load(); }
function updateMedia(media) { load(); }
var oDL;
function load()
{
oDL = element.document.all('dataload');
oDL.getDataAsync('info_relatedradio', loadData);
var s = '<table width=368 class=pane border=0 cellpadding=0 cellspacing=0>';
s += '<tr><td class=artist>' + L_RelatedRadioTitle_Text + '</td></tr>';
s += '<tr><td>' + GetRelatedTOC(2) + '</td></tr>';
s += '<tr><td height=14 class=text id=relatedRadioHeader></td></tr>';
s += '<tr><td height=10></td></tr>';
s += '<tr><td valign=top height=40>' + GetButtons(12, L_RelatedArtistsTitle_Text, -1, '') + '</td></tr>';
s += '<tr><td width=368 height=100% id=relatedRadioData valign=top>' + GetLoading('black') + '</td></tr></table>';
element.innerHTML = s;
SetArtistAlbumHeader('relatedRadioHeader', true, true, false);
}
function resize()
{
var el = element.document.all(uniqueID + 'resize');
if (el)
el.style.height = Math.max(element.document.body.clientHeight - getElementTop('relatedRadioData'), 10);
}
function loadData(oXML)
{
oDL.saveIDs(oXML), sHTML;
var s;
if (oDL.getNodeText(oXML, 'msid_person').length)
{
var sHTML = GetRelatedRadio(oDL, oXML);
if (sHTML.length)
{
s = '<div class=text id="' + uniqueID + 'resize" style="overflow-y: scroll; width: 368; height: ' + (element.document.body.clientHeight - getElementTop('relatedRadioData')) + '">';
s += sHTML + '</div>';
}
else
{
oDL.setNoData(L_NoRelatedRadioError_Text, 'images\\artist.gif', true);
return;
}
}
else
{
oDL.setNoData(L_CantFindArtistError_Text, 'images\\artist.gif', true);
return;
}
try
{
element.document.all('relatedRadioData').innerHTML = s;
} catch(e)
{
}
}
function GetRelatedRadio(oDL, oXML)
{
var oStations = oXML.getElementsByTagName('RelatedRadio'), i;
var s = '<table border=0 cellpadding=0 cellspacing=0>';
if (oStations.length)
{
for (i = 0; i < oStations.length; i++)
s += '<tr><td valign=top>' + GetOneStation(oDL, oStations[i], i) + '</tr></td><tr><td height=10></td></tr>';
s += '</table>';
}
else
s = '';
return s;
}
function playStation(sStream, sWeb)
{
if (sWeb.length)
launchUrl(sWeb);
playMedia(sStream);
return false;
}
function GetOneStation(oDL, o, i)
{
var s = '<table border=0 cellpadding=0 cellspacing=0>', sPlayUrl, sWebUrl, oStream, oWeb;
s += '<tr><td valign=top width=30><img border=0 src="images\\radio.gif"></td><td width=10></td>';
s += '<td valign=top><table width=320 border=0 cellpadding=0 cellspacing=0>';
s += '<tr><td class=textBold>' + fixText(oDL.getNodeText(o, 'StationName')) + '</td></tr>';
s += '<tr><td class=textGray>' + fixText(oDL.getNodeText(o, 'Abstract')) + '</td></tr>';
oStream = o.getElementsByTagName('StreamLoc')
oWeb = o.getElementsByTagName('WebLoc')
sPlayUrl = oDL.getUrl(oStream[0]);
sWebUrl = oDL.getUrl(oWeb[0]);
if (sPlayUrl.length)
{
s += '<tr><td class=text><A href="X" onclick="trackIt(\'RLK' + getClickIndex(i) + '\'); return ' + uniqueID + '.playStation(\'' + quoteText(sPlayUrl) + '\', \'' + quoteText(sWebUrl) + '\');" class=text>' + L_PlayStationAudio_Text + '</a>';
if (sWebUrl.length)
s += ' | <A ' + getHrefText(sWebUrl, false, 'RLT' + getClickIndex(i)) + ' class=text>' + L_VisitStationWebsite_Text + '</a></td></tr>';
}
else
s += '<tr><td class=text><A ' + getHrefText(sWebUrl, false, 'RLT' + getClickIndex(i)) + ' class=text>' + L_VisitStationWebsiteToPlay_Text + '</a></td></tr>';
s += '</table></td></tr></table>';
return s;
}
function noData(sHTML)
{
element.document.all('relatedRadioData').innerHTML = sHTML;
}
</SCRIPT>
</PUBLIC:COMPONENT>