home *** CD-ROM | disk | FTP | other *** search
- <PUBLIC:COMPONENT lightWeight=true>
- <PUBLIC:METHOD NAME="getDataAsync" />
- <PUBLIC:METHOD NAME="getDataAsync2" />
- <PUBLIC:METHOD NAME="getDataAsyncAlbum" />
- <PUBLIC:METHOD NAME="getNodeText" />
- <PUBLIC:METHOD NAME="getSubNode" />
- <PUBLIC:METHOD NAME="saveIDs" />
- <PUBLIC:METHOD NAME="Stop" />
-
- <PUBLIC:PROPERTY NAME="AID" />
- <PUBLIC:PROPERTY NAME="PID" />
- <PUBLIC:PROPERTY NAME="MSIDAlbum" />
- <PUBLIC:PROPERTY NAME="MSIDPerson" />
-
- <SCRIPT LANGUAGE="JScript">
- var sPID, sAID;
- function getDataAsync2(sPage, fnCallback, sParam)
- {
- var sTOC = element.document.all('toc').innerText, sContentID = element.document.all('contentid').innerText, oXML;
- oXML = getDataExAsync(sPage, '&toc=' + sTOC + '&content_id=' + sContentID + '&a_id=' + AID + '&p_id=' + PID + '&msid_person=' + MSIDPerson + '&msid_album=' + MSIDAlbum + sParam, fnCallback);
-
- return oXML;
- }
-
- function getDataAsyncAlbum(sPage, fnCallback, sParam)
- {
- var oXML;
- oXML = getDataExAsync(sPage, sParam, fnCallback);
- return oXML;
- }
-
- function getDataAsync(sPage, fnCallback)
- {
- return getDataAsync2(sPage, fnCallback, '');
- }
-
- function saveIDs(oXML)
- {
- var sTemp;
-
- sTemp = getNodeText(oXML, 'AID');
- if (sTemp.length > 0)
- AID = sTemp;
-
- sTemp = getNodeText(oXML, 'PID');
- if (sTemp.length > 0)
- PID = sTemp;
-
- sTemp = getNodeText(oXML, 'msid_person');
- if (sTemp.length > 0)
- MSIDPerson = sTemp;
-
- sTemp = getNodeText(oXML, 'msid_album');
- if (sTemp.length > 0)
- MSIDAlbum = sTemp;
-
- }
-
- var oXMLCurrent = null, pfnCurrent = null;
- function Callback()
- {
- if (pfnCurrent)
- pfnCurrent();
- }
-
- function Stop()
- {
- if (oXMLCurrent)
- oXMLCurrent.abort();
- oXMLCurrent = null;
- pfnCurrent = null;
- }
-
- function getDataExAsync(sPage, sParams, fnCallback)
- {
- var oXML = new ActiveXObject('Microsoft.XMLDOM'), p, ex, fGetData = false;
- Stop();
- p = element.document.all('player')
- if (p.isOnline)
- {
- ex = window.external;
- if (ex)
- {
- if (ex.appColorMedium)
- {
- if (ex.IsAutoMetadataDownloadAllowed())
- fGetData = true;
- }
- else
- fGetData = true;
- }
- }
-
- if (fGetData)
- {
- oXMLCurrent = oXML;
- pfnCurrent = fnCallback;
-
- // var sUrl = 'http://dwsdevserv/xmlinterface/servedocument.asp?doc=' + sPage + sParams;
- var sUrl = 'http://windowsmedia.com/redir/servedocument.asp?doc=' + sPage + sParams;
-
- element.innerText = sUrl;
- oXML.async = true;
- oXML.onreadystatechange = Callback;
- oXML.load(sUrl);
- }
- return oXML;
- }
-
- function getNodeText(oXML, sNode)
- {
- if (oXML)
- {
- var oObj = oXML.getElementsByTagName(sNode);
- if (oObj.length > 0)
- return oObj[0].text
- }
- return '';
- }
-
- function getSubNode(oXML, sNode)
- {
- var oObj = oXML.getElementsByTagName(sNode);
- return oObj;
- }
-
- </SCRIPT>
- </PUBLIC:COMPONENT>
-