home *** CD-ROM | disk | FTP | other *** search
/ Beweegwijzer / beweegwijzer.iso / setup / _SETUP.1 / faq.js < prev    next >
Encoding:
Text File  |  2000-09-01  |  2.8 KB  |  63 lines

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