home *** CD-ROM | disk | FTP | other *** search
/ Beweegwijzer / beweegwijzer.iso / setup / _SETUP.1 / tips.js < prev    next >
Encoding:
Text File  |  2000-04-21  |  2.4 KB  |  59 lines

  1. var chosenAlt = -1;
  2.  
  3. var moduleData = new ActiveXObject("Microsoft.XMLDOM");
  4. moduleData.load("data/tips.xml");
  5. var moduleRoot = moduleData.documentElement;
  6.  
  7. function showPage() {
  8.   buildPage();
  9.   parent.goPage = 'tips.html';  
  10.   AppScreen.style.visibility = "visible";
  11.   }
  12.  
  13. function buildPage() {
  14.   styleRule = '<?xml version="1.0"?>';
  15.   styleRule += '<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">';
  16.   styleRule += '<xsl:template match="/">';
  17.   styleRule += '<xsl:apply-templates select="tips/text">';
  18.   styleRule += '<xsl:template>';
  19.   styleRule += '<xsl:copy>';
  20.   styleRule += '<xsl:apply-templates select="@* | * | comment() | pi() | text()"/>';
  21.   styleRule += '</xsl:copy>';
  22.   styleRule += '</xsl:template>';
  23.   styleRule += '</xsl:apply-templates>';
  24.   styleRule += '</xsl:template>';
  25.   styleRule += '</xsl:stylesheet>';
  26.  
  27.   style = new ActiveXObject("Microsoft.XMLDOM");
  28.   style.loadXML(styleRule);
  29.   
  30.   TextArea.innerHTML =  moduleData.transformNode(style);
  31.   
  32.   optieWriteString = '';
  33.   for (var i=0; i<moduleRoot.selectNodes("optie").length; i++) {
  34.     optieWriteString += '<div id="AltBtn" title="' + moduleRoot.selectNodes("optie")[i].selectSingleNode("text").text + '" url="' + moduleRoot.selectNodes("optie")[i].getAttribute("url") + '" num="' + i + '" style="top:'+ (i*21) +'px">';
  35.     optieWriteString += '<div id="AltText">' + moduleRoot.selectNodes("optie")[i].selectSingleNode("text").text + '</div>';    
  36.     optieWriteString += '</div>';
  37.     }
  38.   OptieArea.innerHTML = optieWriteString;  
  39.   }
  40.  
  41. function buildContents() {
  42.   styleRule = '<?xml version="1.0"?>';
  43.   styleRule += '<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">';
  44.   styleRule += '<xsl:template match="/">';
  45.   styleRule += '<xsl:apply-templates select="//optie['+chosenAlt+']/layout">';
  46.   styleRule += '<xsl:template>';
  47.   styleRule += '<xsl:copy>';
  48.   styleRule += '<xsl:apply-templates select="@* | * | comment() | pi() | text()"/>';
  49.   styleRule += '</xsl:copy>';
  50.   styleRule += '</xsl:template>';
  51.   styleRule += '</xsl:apply-templates>';
  52.   styleRule += '</xsl:template>';
  53.   styleRule += '</xsl:stylesheet>';    
  54.  
  55.   style = new ActiveXObject("Microsoft.XMLDOM");
  56.   style.loadXML(styleRule);
  57.   
  58.   FbkArea.innerHTML = '<p style="color:#ffffff; text-decoration:underline">' + moduleRoot.selectSingleNode("//optie[" + chosenAlt + "]/text").text + '</p>' + moduleData.transformNode(style);  
  59.   }