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