home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 175 / DPCS0902.ISO / demos / LiquidPlayer / data1.cab / Program_Executable_Files / LiquidPlayer.exe / player6 / jametadisplay.js < prev    next >
Encoding:
JavaScript  |  2001-11-14  |  22.3 KB  |  585 lines

  1. // Show album art
  2. var lyricsAvailable = 0;
  3. var notesAvailable = 0;
  4. var creditsAvailable = 0;
  5. var xmldoc;
  6. var curSelection = 0;
  7.  
  8. function setScrollerVisible(container, scrollObj, controlUp, controlDown)
  9. {
  10.     if(container.clipHeight - scrollObj.scrollHeight < 0) { 
  11.         document.all(controlUp).style.visibility = "visible";
  12.         document.all(controlDown).style.visibility = "visible";        
  13.     } else {
  14.         document.all(controlUp).style.visibility = "hidden";
  15.         document.all(controlDown).style.visibility = "hidden";
  16.     }
  17. }
  18.  
  19. function displayBranding()
  20. {
  21.     window.external.LaunchCurrentBranding();
  22. }
  23.  
  24. // Launch web link indicated by the id.
  25. // For id==0 url is passed in textLink
  26. function launchLink(id, textLink)
  27. {
  28.     var targetName;
  29.     if (id == 0)
  30.     {
  31.         targetName = "findMusic";
  32.     }
  33.     else
  34.     {
  35.         targetName = "buyWindow";
  36.         imageNode = xmldoc.documentElement.selectSingleNode("links");
  37.  
  38.         if (imageNode != null) 
  39.         {
  40.             var curNode = null;
  41.             nodeAttr = imageNode.attributes;
  42.             switch(id) 
  43.             {
  44.             case 1:
  45.                 curNode = nodeAttr.getNamedItem("buyDownload");    
  46.                 break;
  47.             case 2:
  48.                 curNode = nodeAttr.getNamedItem("purchase");    
  49.                 break;
  50.             case 3:
  51.                 targetName = "promoWindow";
  52.                 curNode = nodeAttr.getNamedItem("promoURL");    
  53.                 break;
  54.             }
  55.  
  56.             if (curNode != null) 
  57.             {
  58.                 textLink = curNode.text;                
  59.             }
  60.         }
  61.     }
  62.  
  63.     // Ptd valign=top: Bug Fix: prepend http prefix if it's not present.
  64.     if (textLink.substr(0,4) == "www.")
  65.     {
  66.         window.open("http://"+textLink,targetName);
  67.     }
  68.     else
  69.     {
  70.         window.open(textLink,targetName);
  71.     }                
  72.  
  73. }
  74.  
  75. function viewMouseOut(id, imageName, imageFile) 
  76. {
  77.     if (curSelection != id) {
  78.         document.images(imageName).src = imageFile;
  79.     }
  80. }
  81.  
  82.  
  83.  
  84. function showItem( targetId, show )
  85. {
  86.     document.all("ALBUMART").style.display = "none";
  87.     document.all("PROMOART").style.display = "none";
  88.     target = document.all( targetId );
  89.       if (show == 1){
  90.           target.style.display = "";
  91.       } else {
  92.           target.style.display = "none";
  93.       }
  94. }
  95.  
  96. function showLyrics (show)
  97. {
  98.     if (show == 1) {
  99.         curSelection = 2;
  100.         showItem("ALBUMART",1);
  101.         showPromo(0);
  102.         showMetaData(0);
  103.         showNotes(0);
  104.         showCredits(0);
  105.         document.all("Lyrics").style.display = "";
  106.         if (lyricsAvailable) {
  107.             setScrollerVisible(objContainerLyrics, objScrollerLyrics, "divUpControlLyrics", "divDownControlLyrics");
  108.         }
  109.     } else {
  110.         
  111.         document.all("Lyrics").style.display = "none";
  112.         document.all("divDownControlLyrics").style.visibility = "hidden";
  113.         document.all("divUpControlLyrics").style.visibility = "hidden";
  114.     }
  115. }
  116.  
  117. function showNotes (show)
  118. {
  119.     if (show == 1) {
  120.         curSelection = 3;
  121.         showItem("ALBUMART",1);
  122.         showPromo(0);
  123.         showMetaData(0);
  124.         showLyrics(0);
  125.         showCredits(0);
  126.         document.all("Notes").style.display = "";
  127.         if (notesAvailable) {
  128.             setScrollerVisible(objContainerNotes, objScrollerNotes, "divUpControlNotes", "divDownControlNotes");
  129.         }
  130.     } else {
  131.         
  132.         document.all("Notes").style.display = "none";
  133.         document.all("divDownControlNotes").style.visibility = "hidden";
  134.         document.all("divUpControlNotes").style.visibility = "hidden";
  135.     }
  136. }
  137.  
  138. function showCredits (show)
  139. {
  140.     if (show == 1) {
  141.         curSelection = 4;
  142.         showItem("ALBUMART",1);
  143.         showPromo(0);
  144.         showMetaData(0);
  145.         showNotes(0);
  146.         showLyrics(0);
  147.         document.all("Credits").style.display = "";
  148.         if (creditsAvailable) {
  149.             setScrollerVisible(objContainerCredits, objScrollerCredits, "divUpControlCredits", "divDownControlCredits");
  150.         }
  151.     } else {
  152.         
  153.         document.all("Credits").style.display = "none";
  154.         document.all("divDownControlCredits").style.visibility = "hidden";
  155.         document.all("divUpControlCredits").style.visibility = "hidden";
  156.     }
  157. }
  158.  
  159. function showMetaData(show)
  160. {
  161.     if (show == 1) {
  162.         curSelection = 0;
  163.         showPromo(0);
  164.         showItem("ALBUMART",1);
  165.         showNotes(0);
  166.         showLyrics(0);
  167.         showCredits(0);
  168.         
  169.         document.all("metadata").style.display = "";
  170.     } else {
  171.         
  172.         document.all("metadata").style.display = "none";
  173.     }
  174. }
  175.  
  176. function showPromo(show)
  177. {
  178.     if (show == 1) {
  179.         curSelection = 1;
  180.         showMetaData(0);
  181.         showItem("PROMOART",1);
  182.         showNotes(0);
  183.         showLyrics(0);
  184.         showCredits(0);
  185.         document.all("metadata").style.display = "";
  186.     } else {
  187.         
  188.         document.all("metadata").style.display = "none";
  189.     }
  190. }
  191.  
  192.  
  193.  
  194. function parseCredits(doc)
  195. {
  196.     var rootNode = doc.documentElement;
  197.     
  198.     if (rootNode != null) {
  199.     
  200.         // Credits display
  201.         imageNode = doc.documentElement.selectSingleNode("credits");
  202.         if (imageNode != null) {
  203.             var nodeAttr = imageNode.attributes;
  204.             
  205.             var itemsHTML = "<table width='100%' border='0' cellspacing='0' cellpadding='2'>";
  206.             var columnWidth = 164;
  207.  
  208.             var curNode = nodeAttr.getNamedItem("artistLabel");
  209.             if (curNode != null) {
  210.                 itemsHTML += "<tr><td valign=top><font class='textlightaqua'>" + curNode.text + "</font></td valign=top>";
  211.                 curNode = nodeAttr.getNamedItem("artist");
  212.                 if (curNode != null) 
  213.                     itemsHTML += "<td valign=top width='" + columnWidth + "'><font class='textwhite'>" + curNode.text + "</font></td valign=top></tr>";
  214.             }
  215.             var curNode = nodeAttr.getNamedItem("composerLabel");
  216.             if (curNode != null) {
  217.                 itemsHTML += "<tr><td valign=top><font class='textlightaqua'>" + curNode.text + "</font></td valign=top>";
  218.                 curNode = nodeAttr.getNamedItem("composer");
  219.                 if (curNode != null) 
  220.                     itemsHTML += "<td valign=top width='" + columnWidth + "'><font class='textwhite'>" + curNode.text + "</font></td valign=top></tr>";
  221.             }
  222.             var curNode = nodeAttr.getNamedItem("albumLabel");
  223.             if (curNode != null) {
  224.                 itemsHTML += "<tr><td valign=top><font class='textlightaqua'>" + curNode.text + "</font></td valign=top>";
  225.                 curNode = nodeAttr.getNamedItem("album");
  226.                 if (curNode != null) 
  227.                     itemsHTML += "<td valign=top width='" + columnWidth + "'><font class='textwhite'>" + curNode.text + "</font></td valign=top></tr>";
  228.             }
  229.             var curNode = nodeAttr.getNamedItem("labelLabel");
  230.             if (curNode != null) {
  231.                 itemsHTML += "<tr><td valign=top><font class='textlightaqua'>" + curNode.text + "</font></td valign=top>";
  232.                 curNode = nodeAttr.getNamedItem("label");
  233.                 if (curNode != null) 
  234.                     itemsHTML += "<td valign=top width='" + columnWidth + "'><font class='textwhite'>" + curNode.text + "</font></td valign=top></tr>";
  235.             }
  236.             var curNode = nodeAttr.getNamedItem("copyrightLabel");
  237.             if (curNode != null) {
  238.                 itemsHTML += "<tr><td valign=top><font class='textlightaqua'>" + curNode.text + "</font></td valign=top>";
  239.                 curNode = nodeAttr.getNamedItem("copyright");
  240.                 if (curNode != null) 
  241.                     itemsHTML += "<td valign=top width='" + columnWidth + "'><font class='textwhite'>" + curNode.text + "</font></td valign=top></tr>";
  242.             }
  243.             var curNode = nodeAttr.getNamedItem("copySrcLabel");
  244.             if (curNode != null) {
  245.                 itemsHTML += "<tr><td valign=top><font class='textlightaqua'>" + curNode.text + "</font></td valign=top>";
  246.                 curNode = nodeAttr.getNamedItem("copySrc");
  247.                 if (curNode != null) 
  248.                     itemsHTML += "<td valign=top width='" + columnWidth + "'><font class='textwhite'>" + curNode.text + "</font></td valign=top></tr>";
  249.             }
  250.             var curNode = nodeAttr.getNamedItem("featuredLabel");
  251.             if (curNode != null) {
  252.                 itemsHTML += "<tr><td valign=top><font class='textlightaqua'>" + curNode.text + "</font></td valign=top>";
  253.                 curNode = nodeAttr.getNamedItem("featured");
  254.                 if (curNode != null) 
  255.                     itemsHTML += "<td valign=top width='" + columnWidth + "'><font class='textwhite'>" + curNode.text + "</font></td valign=top></tr>";
  256.             }
  257.             var curNode = nodeAttr.getNamedItem("sessionLabel");
  258.             if (curNode != null) {
  259.                 itemsHTML += "<tr><td valign=top><font class='textlightaqua'>" + curNode.text + "</font></td valign=top>";
  260.                 curNode = nodeAttr.getNamedItem("session");
  261.                 if (curNode != null) 
  262.                     itemsHTML += "<td valign=top width='" + columnWidth + "'><font class='textwhite'>" + curNode.text + "</font></td valign=top></tr>";
  263.             }
  264.             var curNode = nodeAttr.getNamedItem("producerLabel");
  265.             if (curNode != null) {
  266.                 itemsHTML += "<tr><td valign=top><font class='textlightaqua'>" + curNode.text + "</font></td valign=top>";
  267.                 curNode = nodeAttr.getNamedItem("producer");
  268.                 if (curNode != null) 
  269.                     itemsHTML += "<td valign=top width='" + columnWidth + "'><font class='textwhite'>" + curNode.text + "</font></td valign=top></tr>";
  270.             }
  271.             var curNode = nodeAttr.getNamedItem("engLabel");
  272.             if (curNode != null) {
  273.                 itemsHTML += "<tr><td valign=top><font class='textlightaqua'>" + curNode.text + "</font></td valign=top>";
  274.                 curNode = nodeAttr.getNamedItem("engineers");
  275.                 if (curNode != null) 
  276.                     itemsHTML += "<td valign=top width='" + columnWidth + "'><font class='textwhite'>" + curNode.text + "</font></td valign=top></tr>";
  277.             }
  278.             var curNode = nodeAttr.getNamedItem("conductorLabel");
  279.             if (curNode != null) {
  280.                 itemsHTML += "<tr><td valign=top><font class='textlightaqua'>" + curNode.text + "</font></td valign=top>";
  281.                 curNode = nodeAttr.getNamedItem("conductor");
  282.                 itemsHTML += "<td valign=top width='" + columnWidth + "'><font class='textwhite'>" + curNode.text + "</font></td valign=top></tr>";
  283.             }
  284.             var curNode = nodeAttr.getNamedItem("chorusLabel");
  285.             if (curNode != null) {
  286.                 itemsHTML += "<tr><td valign=top><font class='textlightaqua'>" + curNode.text + "</font></td valign=top>";
  287.                 curNode = nodeAttr.getNamedItem("chorus");
  288.                 itemsHTML += "<td valign=top width='" + columnWidth + "'><font class='textwhite'>" + curNode.text + "</font></td valign=top></tr>";
  289.             }
  290.             var curNode = nodeAttr.getNamedItem("chorusConLabel");
  291.             if (curNode != null) {
  292.                 itemsHTML += "<tr><td valign=top><font class='textlightaqua'>" + curNode.text + "</font></td valign=top>";
  293.                 curNode = nodeAttr.getNamedItem("chorusConductor");
  294.                 itemsHTML += "<td valign=top width='" + columnWidth + "'><font class='textwhite'>" + curNode.text + "</font></td valign=top></tr>";
  295.             }
  296.             var curNode = nodeAttr.getNamedItem("studioLabel");
  297.             if (curNode != null) {
  298.                 itemsHTML += "<tr><td valign=top><font class='textlightaqua'>" + curNode.text + "</font></td valign=top>";
  299.                 curNode = nodeAttr.getNamedItem("studio");
  300.                 itemsHTML += "<td valign=top width='" + columnWidth + "'><font class='textwhite'>" + curNode.text + "</font></td valign=top></tr>";
  301.             }
  302.             var curNode = nodeAttr.getNamedItem("studioMixdownLabel");
  303.             if (curNode != null) {
  304.                 itemsHTML += "<tr><td valign=top><font class='textlightaqua'>" + curNode.text + "</font></td valign=top>";
  305.                 curNode = nodeAttr.getNamedItem("studioMixdown");
  306.                 itemsHTML += "<td valign=top width='" + columnWidth + "'><font class='textwhite'>" + curNode.text + "</font></td valign=top></tr>";
  307.             }
  308.             var curNode = nodeAttr.getNamedItem("studioMasteringLabel");
  309.             if (curNode != null) {
  310.                 itemsHTML += "<tr><td valign=top><font class='textlightaqua'>" + curNode.text + "</font></td valign=top>";
  311.                 curNode = nodeAttr.getNamedItem("studioMastering");
  312.                 itemsHTML += "<td valign=top width='" + columnWidth + "'><font class='textwhite'>" + curNode.text + "</font></td valign=top></tr>";
  313.             }
  314.             var curNode = nodeAttr.getNamedItem("studioMixdownLabel");
  315.             if (curNode != null) {
  316.                 itemsHTML += "<tr><td valign=top><font class='textlightaqua'>" + curNode.text + "</font></td valign=top>";
  317.                 curNode = nodeAttr.getNamedItem("studioMixdown");
  318.                 itemsHTML += "<td valign=top width='" + columnWidth + "'><font class='textwhite'>" + curNode.text + "</font></td valign=top></tr>";
  319.             }
  320.             var curNode = nodeAttr.getNamedItem("remixersLabel");
  321.             if (curNode != null) {
  322.                 itemsHTML += "<tr><td valign=top><font class='textlightaqua'>" + curNode.text + "</font></td valign=top>";
  323.                 curNode = nodeAttr.getNamedItem("remixers");
  324.                 itemsHTML += "<td valign=top width='" + columnWidth + "'><font class='textwhite'>" + curNode.text + "</font></td valign=top></tr>";
  325.             }
  326.             var curNode = nodeAttr.getNamedItem("masterEngLabel");
  327.             if (curNode != null) {
  328.                 itemsHTML += "<tr><td valign=top><font class='textlightaqua'>" + curNode.text + "</font></td valign=top>";
  329.                 curNode = nodeAttr.getNamedItem("masterEng");
  330.                 itemsHTML += "<td valign=top width='" + columnWidth + "'><font class='textwhite'>" + curNode.text + "</font></td valign=top></tr>";
  331.             }
  332.             var curNode = nodeAttr.getNamedItem("orchestraLabel");
  333.             if (curNode != null) {
  334.                 itemsHTML += "<tr><td valign=top><font class='textlightaqua'>" + curNode.text + "</font></td valign=top>";
  335.                 curNode = nodeAttr.getNamedItem("orchestra");
  336.                 itemsHTML += "<td valign=top width='" + columnWidth + "'><font class='textwhite'>" + curNode.text + "</font></td valign=top></tr>";
  337.             }
  338.             itemsHTML += "</table>";            
  339.  
  340.             document.all("creditsText").innerHTML = itemsHTML;
  341.             creditsAvailable = true;
  342.         } else {
  343.             var itemsHTML = "<table width='100%' border='0' cellspacing='0' cellpadding='2'>";
  344.             itemsHTML += "<tr><td valign=top><font class='textwhite'><center>Ägùpë┬ö\é╚âNâîâWâbâgé═éáéΦé▄é╣é±</center></font></td valign=top></tr></table>";
  345.             document.all("creditsText").innerHTML = itemsHTML;
  346.         }
  347.     } else {
  348.         var itemsHTML = "<table width='100%' border='0' cellspacing='0' cellpadding='2'>";
  349.         itemsHTML += "<tr><td valign=top><font class='textwhite'><center>Ägùpë┬ö\é╚âNâîâWâbâgé═éáéΦé▄é╣é±</center></font></td valign=top></tr></table>";
  350.         document.all("creditsText").innerHTML = itemsHTML;
  351.     }
  352.  
  353. function parseMetadata(doc)
  354. {
  355.     var rootNode = doc.documentElement;
  356.     
  357.     if (rootNode != null) {
  358.         var imageText = "";
  359.         
  360. var brandingNode = doc.documentElement.selectSingleNode("Branding");
  361.         if (brandingNode != null) {
  362.             var nodeAttr = brandingNode.attributes;
  363.             var imageNode = nodeAttr.getNamedItem("Image");
  364.             itemsHTML = "<a href='javascript:displayBranding()'><img border='0' src='" + imageNode.text + "'  width='120' height='29'></a>";
  365.             document.all("branding").innerHTML = itemsHTML;
  366.         } else {
  367.             itemsHTML = "<a href='javascript:displayBranding()'><img border='0' src='images/retail.gif'  width='120' height='29'></a>";
  368.             document.all("branding").innerHTML = itemsHTML;
  369.         }
  370.     
  371.         // parse the individual items
  372.         var trackNode = doc.documentElement.selectSingleNode("track");
  373.         var itemsHTML = "";
  374.         var nodeAttr = trackNode.attributes;
  375.         var curNode = nodeAttr.getNamedItem("songtitle");
  376.         //if (curNode != null) {
  377.         //    itemsHTML += "<table width='100%' border='0' cellspacing='0' cellpadding='5'>";
  378.         //    itemsHTML += "<tr><td valign=top width='100%'><font class='textlightaqua'><img scr='/i/clear.gif' height='1' width='100%' height='1'><br>";
  379.         //    itemsHTML += "NOW PLAYING:</font> <font class='textwhite'>" + curNode.text + "</font> </td valign=top></tr></table>";
  380.         //    document.all("songTitle").innerHTML = itemsHTML;
  381.         //}
  382.         curNode = nodeAttr.getNamedItem("artist");
  383.         if (curNode != null) {
  384.             itemsHTML = "<table width='100%' border='0' cellspacing='0' cellpadding='1'>";
  385.             itemsHTML += "<tr><td valign=top><font class='textwhite'>";
  386.             itemsHTML += curNode.text + "</font></td valign=top></tr></table>";
  387.             document.all("artist").innerHTML = itemsHTML;
  388.         }
  389.         curNode = nodeAttr.getNamedItem("albumtitle");
  390.         if (curNode != null) {
  391.             itemsHTML = "<table width='100%' border='0' cellspacing='0' cellpadding='1'>";
  392.             itemsHTML += "<tr><td valign=top><font class='textwhite'>";
  393.             itemsHTML += curNode.text + "</font></td valign=top></tr></table>";
  394.             document.all("album").innerHTML = itemsHTML;
  395.         }
  396.          curNode = nodeAttr.getNamedItem("songtitle");
  397.         if (curNode != null) {
  398.             itemsHTML = "<table width='100%' border='0' cellspacing='0' cellpadding='1'>";
  399.             itemsHTML += "<tr><td valign=top><font class='textwhite'>";
  400.             itemsHTML += curNode.text + "</font></td valign=top></tr></table>";
  401.             document.all("songtitle2").innerHTML = itemsHTML;
  402.         }
  403.  
  404.         curNode = nodeAttr.getNamedItem("label");
  405.         if (curNode != null) {
  406.             itemsHTML = "<table width='100%' border='0' cellspacing='0' cellpadding='1'>";
  407.             itemsHTML += "<tr><td valign=top><font class='textwhite'>";
  408.             itemsHTML += curNode.text + "</font></td valign=top></tr></table>";
  409.             document.all("label").innerHTML = itemsHTML;
  410.         }
  411.  
  412.         curNode = nodeAttr.getNamedItem("price");
  413.         curLicenseNode = nodeAttr.getNamedItem("licensed");
  414.         itemsHTML = "<table width='100%' border='0' cellspacing='0' cellpadding='1'>";
  415.         itemsHTML += "<tr><td valign=top><font class='textwhite'>";
  416.         if (curNode != null && curLicenseNode == null) {
  417.             itemsHTML += curNode.text;
  418.         } else if (curLicenseNode != null) {
  419.             itemsHTML += curLicenseNode.text;
  420.         }
  421.         itemsHTML += " </font></td valign=top></tr></table>";
  422.         document.all("price").innerHTML = itemsHTML;
  423.  
  424.          curNode = nodeAttr.getNamedItem("copyright");
  425.         if (curNode != null) {
  426.             itemsHTML = "<table width='100%' border='0' cellspacing='0' cellpadding='1'>";
  427.             itemsHTML += "<tr><td valign=top><font class='textwhite'>";
  428.             itemsHTML += curNode.text + "</font></td valign=top></tr></table>";
  429.             document.all("copyright").innerHTML = itemsHTML;
  430.         }
  431.  
  432.         // Lyrics
  433.         curNode = nodeAttr.getNamedItem("lyrics");
  434.         if (curNode != null) {
  435.             lyricsAvailable = 1; // We gots lyrics
  436.             itemsHTML = "<table width='100%' border='0' cellspacing='0' cellpadding='2'>";
  437.             itemsHTML += "<tr><td valign=top><font class='textwhite'>";
  438.             itemsHTML += curNode.text + "</font></td valign=top></tr></table>";
  439.             document.all("lyricsText").innerHTML = itemsHTML;
  440.         } else {
  441.             itemsHTML = "<table width='100%' border='0' cellspacing='0' cellpadding='2'>";
  442.             itemsHTML += "<tr><td valign=top><font class='textwhite'><center>ë╠Äîé═éáéΦé▄é╣é±</center></font></td valign=top></tr></table>";
  443.             document.all("lyricsText").innerHTML = itemsHTML;
  444.         }
  445.  
  446.         // Notes
  447.         curNode = nodeAttr.getNamedItem("notes");
  448.         if (curNode != null) {
  449.             notesAvailable = 1; // We gots notes
  450.             itemsHTML = "<table width='100%' border='0' cellspacing='0' cellpadding='2'>";
  451.             itemsHTML += "<tr><td valign=top><font class='textwhite'>";
  452.             itemsHTML += curNode.text + "</font></td valign=top></tr></table>";
  453.             document.all("notesText").innerHTML = itemsHTML;
  454.         } else {
  455.             itemsHTML = "<table width='100%' border='0' cellspacing='0' cellpadding='2'>";
  456.             itemsHTML += "<tr><td valign=top><font class='textwhite'><center>âmü[âcé═éáéΦé▄é╣é±</center></font></td valign=top></tr></table>";
  457.             document.all("notesText").innerHTML = itemsHTML;
  458.         }
  459.  
  460.         // Image handling
  461.         var imageNode = doc.documentElement.selectSingleNode("image");
  462.         if (imageNode != null) {
  463.             nodeAttr = imageNode.attributes;
  464.             curNode = nodeAttr.getNamedItem("cover");
  465.             if (curNode != null) {
  466.                 itemsHTML = "<img border='0' src='../../../data/temp/cover.gif' vspace=0 hspace=12>";
  467.                 document.all("ALBUMART").innerHTML = itemsHTML;
  468.                 document.all("ALBUMART").style.display = "";
  469.             }
  470.             curNode = nodeAttr.getNamedItem("promo");
  471.             if (curNode != null) {
  472.                 var linkText = "";
  473.                 var linkNode = doc.documentElement.selectSingleNode("links");
  474.                 if (linkNode != null) {
  475.                     nodeAttr = linkNode.attributes;
  476.                     curNode = nodeAttr.getNamedItem("promoURL");
  477.                     if (curNode != null) {
  478.                         itemsHTML = "<a href='" + curNode.text + "' target='_blank'><img border='0' src='../../../data/temp/promo.gif' ></a>";
  479.                     }
  480.                 } else {
  481.                     itemsHTML = "<img border='0' src='../../../data/temp/promo.gif' vspace=3 hspace=12>";
  482.                 }
  483.                 document.all("PROMOART").innerHTML = itemsHTML;
  484.                 document.all("PROMOART").style.display = "none";
  485.             }
  486.         } else {
  487.             document.all("ALBUMART").innerHTML = "<font class='textlightaqua'>No album art available</font>";
  488.             document.all("ALBUMART").style.display = "";
  489.             document.all("PROMOART").innerHTML = "<font class='textlightaqua'>No promo art available</font>";
  490.             document.all("PROMOART").style.display = "none";
  491.         }
  492.         
  493.         // Links to buy tracks, free download etc
  494.         itemsHTML = "";
  495.         imageNode = doc.documentElement.selectSingleNode("links");
  496.         if (imageNode != null) {
  497.             nodeAttr = imageNode.attributes;
  498.             curNode = nodeAttr.getNamedItem("freeDownload");
  499.             if (curNode != null) {
  500.                 itemsHTML += "<a href='" + curNode.text + "'  onFocus='if(this.blur)this.blur()' class=textwhite>û│ù┐âgâëâbâNé╠<BR>â_âEâôâìü[âh</a><br>";
  501.             } else {
  502.                 itemsHTML +="<a class=textgrey>û│ù┐âgâëâbâNé╠<BR>â_âEâôâìü[âh</a><br>";
  503.             }
  504.         itemsHTML +="</td><td>     </td><td>";
  505.             curNode = nodeAttr .getNamedItem("buyDownload");    
  506.             if (curNode != null) {
  507.                 itemsHTML += "<a href='" + curNode.text + "'  onFocus='if(this.blur)this.blur()' class=textwhite target='LABuyDownload'>èyï╚é╠ìwôⁿ</a><br>";
  508.             } else {
  509.                 itemsHTML +="<a class=textgrey>èyï╚é╠ìwôⁿ</a><br>";
  510.             }
  511.             itemsHTML +="</td><td>      </td><td>";
  512.             curNode = nodeAttr.getNamedItem("purchase");
  513.             if (curNode != null) {
  514.                 itemsHTML += "<a href='" + curNode.text + "'  onFocus='if(this.blur)this.blur()' class=textwhite target='LABuyAlbum'>âAâïâoâÇé╠ìwôⁿ</a><br>";
  515.             } else {
  516.                 itemsHTML +="<a class=textgrey>âAâïâoâÇé╠ìwôⁿ</a><br>";
  517.             }
  518.         } else {
  519.             itemsHTML +="";
  520.             
  521.         }
  522.         document.all("linkslist").innerHTML = itemsHTML;
  523.         
  524.  
  525.         parseCredits(doc);
  526.         trackLoaded = 1;
  527.     } else {
  528.         trackLoaded = 0;
  529.         var itemsHTML = "<a href='javascript:displayBranding()'><img border='0' src='jaimages/retail.gif' width='120' height='29'></a>";
  530.         document.all("branding").innerHTML = itemsHTML;
  531.     }
  532.     
  533. }
  534.  
  535.  
  536.  
  537. //////////////////////////////////////////////////////
  538. // Initialize the XML object for the metadata
  539. //
  540. function initializeXML()
  541. {
  542.     var strLength = window.location.hash.length;
  543.     var text = window.location.hash;
  544.     var pos = 1;
  545.     var bDone = 0;
  546.     while (pos < strLength && !bDone) {
  547.         if (text.substr(pos,1) == '+') {
  548.             bDone = 1;
  549.         } else {
  550.             pos ++;
  551.         }
  552.     }
  553.     var stringTrack = text.substr(1, pos - 1);
  554.     var tmpPath = text.substr(pos+1, (strLength - (pos + 1)));
  555.     pos = 0;
  556.     strLength = tmpPath.length;
  557.     dataPath = new String;
  558.     while (pos < strLength) {
  559.         if (tmpPath.substr(pos, 1) == '|') {
  560.             dataPath += "/";
  561.         } else if (tmpPath.substr(pos, 1) == '*'){
  562.             dataPath += " ";
  563.         } else {
  564.             dataPath += tmpPath.substr(pos,1);
  565.         }
  566.         pos ++;
  567.     }
  568.     if (stringTrack.length > 0) {
  569.         selectedTrack = parseInt(stringTrack);
  570.     } else {
  571.         selectedTrack = 0;
  572.     }
  573.     xmldoc= new ActiveXObject("Microsoft.XMLDOM");
  574.     trackLoaded = 0;
  575.     var trackDataPath = dataPath + "/md.xml";
  576.     xmldoc.load(trackDataPath);
  577.     parseMetadata(xmldoc);
  578. }
  579.  
  580. function Initialize()
  581. {
  582.     initializeXML();
  583. }
  584.