home *** CD-ROM | disk | FTP | other *** search
/ Beweegwijzer / beweegwijzer.iso / setup / _SETUP.1 / beweegplan.js < prev    next >
Encoding:
Text File  |  2001-10-30  |  19.2 KB  |  451 lines

  1. var moduleData = new ActiveXObject("Microsoft.XMLDOM");
  2. moduleData.load("data/beweegplan.xml");
  3. var moduleRoot = moduleData.documentElement;
  4.  
  5. var styleData = new ActiveXObject("Microsoft.XMLDOM");
  6.  
  7. var activeDd = -1;
  8. var cancelCount = 0;
  9. var ddOpen = false;
  10. var ddFirst = 0;
  11. var ddLast = 8;
  12. var ddScrollMode = false;
  13. var scrollTimer;
  14. var scrollDirection = '';
  15.  
  16. var actName = '';
  17. var actFact = 0;
  18.  
  19. var activiteit = new Array('werk','huishouden','lopen','klussen','sport');
  20.  
  21. var chosenDag = '';
  22. var chosenDagNum = -1;
  23. var weekNum = 1;
  24. var minMax = new Array(1,52,0,1440);
  25. var chosenTab = -1;
  26. var stepDotStep = 0;
  27. var stepTexts = new Array('U kunt hier een gezonde week plannen. Zorg ervoor dat de week minimaal 5 groene dagen heeft. Blader naar de gewenste week. Kies vervolgens een dag. Via [groene weken] kunt u ook een standaard beweegprofiel inladen.',
  28. 'Kies een bewegingsvorm door ΘΘn van tabbladen aan te klikken. Wilt u de gegevens overnemen van een reeds ingevulde dag, gebruik dan de knoppen <img src="images/btn_copy_0.bmp" width="29" height="10" alt="" border="0" style="position:relative; top:2px"/> en <img src="images/btn_paste_0.bmp" width="29" height="10" alt="" border="0" style="position:relative; top:2px"/> .',
  29. 'Kies een activiteit die u wilt uitoefenen of kies er een die erop lijkt. Geef aan hoeveel minuten u dit wilt doen. Ga hiermee door tot uw dagplanning compleet is. Kies dan de volgende dag.',
  30. 'U heeft alle dagen van de week ingevuld, kies rechts voor <img src="images/help_ok.gif" width="16" height="16" alt="" border="0" style="position:relative; top:3px"/> om uw weekresultaat te berekenen.');
  31. var stepDotTimer;
  32. var gewicht = parseFloat(parent.userRoot.selectSingleNode("gewicht").text);
  33. var factor1 = 3;
  34. var factor2 = 5.25;
  35. var factor3 = 8;
  36. var cpweek = -1;
  37. var cpdag = '';
  38. var weekResult = false;
  39. var groeneWeken = false;
  40.  
  41. var groeneWeek = new Array();
  42. groeneWeek[0] = new Array('2','wandelen: 7 km/u (6)','60');
  43. groeneWeek[1] = new Array('2','fietsen: vrije tijd, matige inspanning (8)','80');
  44. groeneWeek[2] = new Array('3','grasmaaien met handmaaier (6)','60');
  45. groeneWeek[3] = new Array('4','zwemmen - baantjes trekken (6)','60');
  46. groeneWeek[4] = new Array('2','wandelen: 7 km/u (6)','60',
  47.                               '2','fietsen: vrije tijd, matige inspanning (8)','80',
  48.                               '3','grasmaaien met handmaaier (6)','60',
  49.                               '4','zwemmen - baantjes trekken (6)','60',
  50.                               '0','laden en lossen (6.5)','65');
  51.  
  52. function showPage() {
  53.   buildPage();
  54.   parent.goPage = 'beweegplan.html';
  55.   AppScreen.style.visibility = "visible";
  56.   CountBox[0].style.visibility = "inherit";
  57.   }
  58.  
  59. function buildPage() {
  60.   stepIt();
  61.   getWeek();
  62.   }
  63.   
  64. function document.onclick() {
  65.   var eSrc = window.event.srcElement;
  66.   if (ddOpen) {
  67.     if (eSrc != dd[activeDd]) {
  68.       cancelCount++;
  69.       if (cancelCount>1) {
  70.         for (var i=0; i<dd[activeDd].childNodes.length; i++) {
  71.           if ((dd[activeDd].childNodes[i].innerText != actName) && (dd[activeDd].childNodes[i].id == 'ddItem')) {
  72.             dd[activeDd].childNodes[i].className = 'ddActHidden';
  73.             }
  74.           else if (dd[activeDd].childNodes[i].id == 'ddItem') dd[activeDd].childNodes[i].className = 'ddActShown';
  75.           }
  76.         ddScroll[0].style.display = 'none';
  77.         ddScroll[1].style.display = 'none';
  78.         ddScroll[0].style.visibility = 'hidden';
  79.         ddScroll[1].style.visibility = 'hidden';
  80.  
  81.         ddOpen = false;
  82.         cancelCount = 0;
  83.         }
  84.       }
  85.     }
  86.   }  
  87.  
  88. function ScrollDd() {
  89.   if (scrollTimer) clearTimeout(scrollTimer);
  90.   if ((scrollDirection == '-') && (ddFirst>0)) {
  91.     ddFirst --;
  92.     ddLast --;
  93.     }
  94.   else if ((scrollDirection == '+') && (ddLast<moduleRoot.selectNodes("item[@name='"+activiteit[chosenTab]+"']").length)) {
  95.     ddFirst ++;
  96.     ddLast ++;
  97.     }
  98.   else {
  99.     ddScroll[0].style.display = 'none';
  100.     ddScroll[1].style.display = 'none';  
  101.     ddScroll[0].style.visibility = 'hidden';
  102.     ddScroll[1].style.visibility = 'hidden';  
  103.     if (ddFirst>0) {
  104.       ddScroll[0].style.display = 'inline';
  105.       ddScroll[0].style.visibility = 'inherit';
  106.       }
  107.     if (ddLast<moduleRoot.selectNodes("item[@name='"+activiteit[chosenTab]+"']").length) {
  108.       ddScroll[1].style.display = 'inline';
  109.       ddScroll[1].style.visibility = 'inherit';  
  110.       }
  111.     }
  112.   updateDdList();
  113.   if (ddScrollMode) scrollTimer = window.setTimeout("ScrollDd()",50);
  114.   }
  115.  
  116. function stepIt() {
  117.   for (var i=0; i<StepDot.length; i++) {
  118.     StepDot[i].src = "images/dot_0.gif";
  119.     }
  120.   StepDot[stepDotStep].src = "images/dot_1.gif";
  121.   StepArea.innerHTML = stepTexts[stepDotStep];
  122.   stepDotTimer = window.setTimeout("stopStep()",10000);
  123.   }
  124.  
  125. function stopStep() {
  126.   clearTimeout(stepDotTimer)
  127.   for (var i=0; i<StepDot.length; i++) {
  128.     StepDot[i].src = "images/dot_0.gif";
  129.     }
  130.   }
  131.  
  132. function doGroeneWeek(num) {
  133.   dagCount = 0;
  134.   itmCount = 0;
  135.   dagen = new Array('ma','di','wo','do','vr','za','zo');
  136.   
  137.   if (!parent.userRoot.selectSingleNode("data/planweek[@num = '"+weekNum+"']")) { // week?
  138.     newWeek = parent.xmlUserData.createElement("planweek");
  139.     newWeek.setAttribute("num",weekNum);
  140.     parent.userRoot.selectSingleNode("data").appendChild(newWeek);
  141.     }
  142.   while (parent.userRoot.selectSingleNode("data/planweek[@num = '"+weekNum+"']/dag")) { // alle dagen wissen
  143.     parent.userRoot.selectSingleNode("data/planweek[@num = '"+weekNum+"']").removeChild(parent.userRoot.selectSingleNode("data/planweek[@num = '"+weekNum+"']/dag"));
  144.     }
  145.   while (dagCount < 5) {
  146.     actFact = parseInt(groeneWeek[num][itmCount+2]);
  147.     subtot = Math.round(((actFact/10) * 30) * (gewicht/60));
  148.     norm = Math.round(30/60*factor2*gewicht);
  149.     result = (subtot<norm)?'r':'g';
  150.     
  151.     newDag = parent.xmlUserData.createElement("dag");
  152.     newDag.setAttribute("naam",dagen[dagCount]);
  153.     newDag.setAttribute("totaal",subtot);
  154.     newDag.setAttribute("result",result);
  155.     newDag.setAttribute("gewicht",gewicht);
  156.     
  157.     newAct = parent.xmlUserData.createElement("act");
  158.     newAct.setAttribute("num",groeneWeek[num][itmCount]);
  159.     newAct.setAttribute("acttot",subtot);
  160.     newDag.appendChild(newAct);
  161.  
  162.     newItem = parent.xmlUserData.createElement("item");
  163.     newItem.setAttribute("factor",groeneWeek[num][itmCount+2]);
  164.     newItem.setAttribute("kcal",subtot);
  165.     newItem.setAttribute("tijd","30");
  166.     newItem.text = groeneWeek[num][itmCount+1];
  167.     newAct.appendChild(newItem);
  168.  
  169.     parent.userRoot.selectSingleNode("data/planweek[@num = '"+weekNum+"']").appendChild(newDag);
  170.     if (groeneWeek[num].length>itmCount+3) itmCount += 3;
  171.     dagCount++;
  172.     }
  173.   parent.xmlUserData.save(parent.userDataFileName);
  174.   getWeek();
  175.   GroenewekenArea.style.visibility = 'hidden';
  176.   groeneWeken = false;
  177.   }
  178.   
  179. function CountAction(c) {
  180.   theNum = c;
  181.   theValue = parseInt(CountBox[c].value);
  182.   if ((theValue >= minMax[theNum*2]) && (theValue <= minMax[(theNum*2)+1])) {
  183.     CountBox[c].value = parseInt(CountBox[c].value);
  184.     }
  185.   else CountBox[c].value = minMax[theNum*2];
  186.   
  187.   if (theNum == 0) { // week
  188.     weekNum = parseInt(CountBox[0].value);
  189.     
  190.     chosenDag = '';
  191.     chosenDagNum = -1;
  192.     for (var i=0; i<DagBtn.length; i++) {
  193.       DagBtn[i].style.backgroundImage = "url('images/bt_dag_"+DagBtn[i].dag+((DagBtn[i].dag == chosenDag)?"_2":"_0")+".gif')";
  194.       }
  195.     TabArea.style.backgroundImage = "url('images/tab_default.bmp')";
  196.     TabImg.filters.blendTrans.Apply();
  197.     TabImg.src = "images/bck_"+((parent.goPage == 'beweegplan.html')?"plan":"meet")+"tab_default.bmp";
  198.     TabImg.filters.blendTrans.Play();
  199.     chosenTab = -1;
  200.     
  201.     CopyPaste.style.visibility = 'hidden';
  202.     
  203.     getWeek();
  204.     
  205.     stepDotStep = 0;
  206.     stepIt();
  207.     }
  208.   else calculateDag();
  209.   }
  210.  
  211. function calculateDag() {
  212.   if (chosenTab == -1) {
  213.     CountBox[1].value = 0;
  214.     return;
  215.     }
  216.  
  217.   gewicht = parseInt(parent.userRoot.selectSingleNode("data/planweek[@num = '"+weekNum+"']/dag[@naam = '"+chosenDag+"']").getAttribute("gewicht"));
  218.     
  219.   if ((actFact == 0) || (actName == '')) return;
  220.     
  221.   subtot = Math.round(((actFact/10) * parseInt(CountBox[1].value)) * (gewicht/60));
  222.   norm = Math.round(30/60*factor2*gewicht);
  223.  
  224.   putItem(actName,actFact,parseInt(CountBox[1].value),subtot);
  225.   
  226.   tot = makeBlad();
  227.   ResultBox[chosenTab].innerText = tot;
  228.   t = parseFloat(ResultBox[0].innerText)+parseFloat(ResultBox[1].innerText)+parseFloat(ResultBox[2].innerText)+parseFloat(ResultBox[3].innerText)+parseFloat(ResultBox[4].innerText);
  229.   DagBox[chosenDagNum].innerText = Math.round(t);
  230.  
  231.   if (t<norm) {
  232.     DagBox[chosenDagNum].className = 'dagBoxRed';
  233.     result = 'r';
  234.     }
  235.   else if (t>=norm) {
  236.     DagBox[chosenDagNum].className = 'dagBoxGreen';
  237.     result = 'g';
  238.     }
  239.     
  240.   if (DagBox[chosenDagNum].innerText != '0') {
  241.     CopyPasteBtn[0].style.visibility = 'inherit';
  242.     CopyPaste.style.visibility = 'inherit';
  243.     }
  244.   else CopyPaste.style.visibility = 'hidden';
  245.   
  246.   if (cpweek != -1) {
  247.     CopyPasteBtn[1].style.visibility = 'inherit';
  248.     CopyPaste.style.visibility = 'inherit';  
  249.     } 
  250.     
  251.   putResultInDag(tot,t,result);
  252.   
  253. //  checkWeekComplete();  
  254.   }
  255.   
  256. function makeBlad() {
  257.   bladItems = parent.userRoot.selectNodes("data/planweek[@num = '"+weekNum+"']/dag[@naam = '"+chosenDag+"']/act[@num = '"+chosenTab+"']/item");
  258.   tot = 0;
  259.   blString = '<table border="0" cellpadding="0" cellspacing="0">';
  260.   for (var i=bladItems.length-1; i>-1; i--) {
  261.     blString += '<tr><td width="8"><img id="ActDelete" ref="'+bladItems[i].text+'" src="images/delete.gif" width="8" height="8" alt="activiteit verwijderen" border="0"/></td><td width="330" class="bladText">'+bladItems[i].text+'</td><td width="50" class="bladText">'+bladItems[i].getAttribute("tijd")+'</td><td width="40" class="bladText">'+bladItems[i].getAttribute("kcal")+'</td></tr>';
  262.     tot += parseInt(bladItems[i].getAttribute("kcal"));
  263.     }
  264.   blString += '</table>';
  265.   BladArea.innerHTML = blString;
  266.   return tot;
  267.   }
  268.   
  269. function checkWeekComplete() {
  270.   complete = true;
  271.   for (var i=0; i<7; i++) {
  272.     if (!parent.userRoot.selectSingleNode("data/week[@num = '"+weekNum+"']/dag[@naam = '"+DagBtn[i].dag+"']")) {
  273.       complete = false;
  274.       break;
  275.       }
  276.     }
  277.   if (complete) {
  278.     WeekBtn.style.visibility = 'inherit';
  279.     stepDotStep = 3;
  280.     stepIt();    
  281.     }
  282.   else WeekBtn.style.visibility = 'hidden';
  283.   }
  284.   
  285. function getWeek() {
  286.   CountBox[1].value = 0;
  287.   
  288.   ResultBox[0].innerText = '0';
  289.   ResultBox[1].innerText = '0';
  290.   ResultBox[2].innerText = '0';
  291.   ResultBox[3].innerText = '0';
  292.   ResultBox[4].innerText = '0';
  293.   
  294.   BladArea.innerHTML = '';
  295.   
  296.   for (var i=0; i<7; i++) {
  297.     if (parent.userRoot.selectSingleNode("data/planweek[@num = '"+weekNum+"']/dag[@naam = '"+DagBox[i].parentElement.dag+"']")) {
  298.       DagBox[i].innerText = Math.round(parseFloat(parent.userRoot.selectSingleNode("data/planweek[@num = '"+weekNum+"']/dag[@naam = '"+DagBox[i].parentElement.dag+"']").getAttribute("totaal")));
  299.       DagBox[i].className = (parent.userRoot.selectSingleNode("data/planweek[@num = '"+weekNum+"']/dag[@naam = '"+DagBox[i].parentElement.dag+"']").getAttribute("result")=='g')?'dagBoxGreen':'dagBoxRed';
  300.       }
  301.     else {
  302.       DagBox[i].innerText = '0';
  303.       DagBox[i].className = 'dagBoxNeutral';
  304.       }
  305.     }
  306. //  VoorbeeldButtons('hide');
  307.  
  308. //  WeekArea.style.visibility = 'hidden';
  309. //  WeekResultImg.src = "images/weekresult_oranje.bmp";
  310. //  weekResult = false;   
  311.  
  312. //  checkWeekComplete();
  313.   }
  314.  
  315. function getDag() {
  316.   if (!parent.userRoot.selectSingleNode("data/planweek[@num = '"+weekNum+"']")) { // week?
  317.     newWeek = parent.xmlUserData.createElement("planweek");
  318.     newWeek.setAttribute("num",weekNum);
  319.     parent.userRoot.selectSingleNode("data").appendChild(newWeek);
  320.     }
  321.   if (!parent.userRoot.selectSingleNode("data/planweek[@num = '"+weekNum+"']/dag[@naam = '"+chosenDag+"']")) { // dag?
  322.     newDag = parent.xmlUserData.createElement("dag");
  323.     newDag.setAttribute("naam",chosenDag);
  324.     newDag.setAttribute("totaal","0");
  325.     newDag.setAttribute("result","");
  326.     newDag.setAttribute("gewicht",gewicht);
  327.     parent.userRoot.selectSingleNode("data/planweek[@num = '"+weekNum+"']").appendChild(newDag);    
  328.     }
  329.     
  330.   BladArea.innerHTML = '';    
  331.     
  332.   CountBox[1].value = '0';
  333.   ResultBox[0].innerText = (parent.userRoot.selectSingleNode("data/planweek[@num = '"+weekNum+"']/dag[@naam = '"+chosenDag+"']/act[@num = '0']"))?parent.userRoot.selectSingleNode("data/planweek[@num = '"+weekNum+"']/dag[@naam = '"+chosenDag+"']/act[@num = '0']").getAttribute("acttot"):'0';  
  334.   ResultBox[1].innerText = (parent.userRoot.selectSingleNode("data/planweek[@num = '"+weekNum+"']/dag[@naam = '"+chosenDag+"']/act[@num = '1']"))?parent.userRoot.selectSingleNode("data/planweek[@num = '"+weekNum+"']/dag[@naam = '"+chosenDag+"']/act[@num = '1']").getAttribute("acttot"):'0';  
  335.   ResultBox[2].innerText = (parent.userRoot.selectSingleNode("data/planweek[@num = '"+weekNum+"']/dag[@naam = '"+chosenDag+"']/act[@num = '2']"))?parent.userRoot.selectSingleNode("data/planweek[@num = '"+weekNum+"']/dag[@naam = '"+chosenDag+"']/act[@num = '2']").getAttribute("acttot"):'0';  
  336.   ResultBox[3].innerText = (parent.userRoot.selectSingleNode("data/planweek[@num = '"+weekNum+"']/dag[@naam = '"+chosenDag+"']/act[@num = '3']"))?parent.userRoot.selectSingleNode("data/planweek[@num = '"+weekNum+"']/dag[@naam = '"+chosenDag+"']/act[@num = '3']").getAttribute("acttot"):'0';  
  337.   ResultBox[4].innerText = (parent.userRoot.selectSingleNode("data/planweek[@num = '"+weekNum+"']/dag[@naam = '"+chosenDag+"']/act[@num = '4']"))?parent.userRoot.selectSingleNode("data/planweek[@num = '"+weekNum+"']/dag[@naam = '"+chosenDag+"']/act[@num = '4']").getAttribute("acttot"):'0';  
  338.  
  339.   parent.xmlUserData.save(parent.userDataFileName);
  340.   }
  341.   
  342. function putItem(n,f,tijd,kcal,t) {
  343.   if (!parent.userRoot.selectSingleNode("data/planweek[@num = '"+weekNum+"']/dag[@naam = '"+chosenDag+"']/act[@num = '"+chosenTab+"']")) {
  344.     newAct = parent.xmlUserData.createElement("act");
  345.     newAct.setAttribute("num",chosenTab);
  346.     parent.userRoot.selectSingleNode("data/planweek[@num = '"+weekNum+"']/dag[@naam = '"+chosenDag+"']").appendChild(newAct);
  347.     }
  348.   if (!parent.userRoot.selectSingleNode("data/planweek[@num = '"+weekNum+"']/dag[@naam = '"+chosenDag+"']/act[@num = '"+chosenTab+"']/item[. = '"+n+"']")) {
  349.     newItem = parent.xmlUserData.createElement("item");
  350.     newItem.setAttribute("factor",f);
  351.     newItem.text = n;
  352.     parent.userRoot.selectSingleNode("data/planweek[@num = '"+weekNum+"']/dag[@naam = '"+chosenDag+"']/act[@num = '"+chosenTab+"']").appendChild(newItem);
  353.     }
  354.   parent.userRoot.selectSingleNode("data/planweek[@num = '"+weekNum+"']/dag[@naam = '"+chosenDag+"']/act[@num = '"+chosenTab+"']/item[. = '"+n+"']").setAttribute("tijd",tijd);
  355.   parent.userRoot.selectSingleNode("data/planweek[@num = '"+weekNum+"']/dag[@naam = '"+chosenDag+"']/act[@num = '"+chosenTab+"']/item[. = '"+n+"']").setAttribute("kcal",kcal);
  356.  
  357.   parent.xmlUserData.save(parent.userDataFileName);
  358.   }
  359.   
  360. function putResultInDag(acttot,dagtot,result) {
  361.   parent.userRoot.selectSingleNode("data/planweek[@num = '"+weekNum+"']/dag[@naam = '"+chosenDag+"']/act[@num = '"+chosenTab+"']").setAttribute("acttot",acttot);  
  362.   parent.userRoot.selectSingleNode("data/planweek[@num = '"+weekNum+"']/dag[@naam = '"+chosenDag+"']").setAttribute("totaal",dagtot);
  363.   parent.userRoot.selectSingleNode("data/planweek[@num = '"+weekNum+"']/dag[@naam = '"+chosenDag+"']").setAttribute("result",result);  
  364.   parent.xmlUserData.save(parent.userDataFileName);
  365.   }
  366.   
  367. function getTab() {
  368.   ddFirst = 0;
  369.   ddLast = 8;
  370.   
  371.   actName = moduleRoot.selectNodes("item[@name='"+activiteit[chosenTab]+"']")[0].text;
  372.   actFact = parseInt(moduleRoot.selectNodes("item[@name='"+activiteit[chosenTab]+"']")[0].getAttribute("factor"));
  373.   
  374.   ddWriteString = '<div id="ddScroll" dirtype="-" onselectstart="return false;" style="visibility:hidden; display:none"><img src="images/pijl_up.gif" width="6" height="4" alt="" border="0"></div>';
  375.   for (var i=ddFirst; i<ddLast; i++) {
  376.     ddWriteString += '<div id="ddItem" factor="' + moduleRoot.selectNodes("item[@name='"+activiteit[chosenTab]+"']")[i].getAttribute("factor") +'"num="' + (i+1) + '" class="' + ((i==0)?'ddActShown':'ddActHidden')+'">' + moduleRoot.selectNodes("item[@name='"+activiteit[chosenTab]+"']")[i].text + '</div>';
  377.     }
  378.   ddWriteString += '<div id="ddScroll" dirtype="+" onselectstart="return false;" style="visibility:hidden; display:none"><img src="images/pijl_down.gif" width="6" height="4" alt="" border="0"></div>';    
  379.   dd[0].innerHTML = ddWriteString;
  380.   
  381.   ControlActiviteit.style.visibility = 'inherit';
  382.   ControlGezond.style.visibility = 'inherit';
  383.   CountBox[1].style.visibility = 'inherit';
  384.   
  385.   makeBlad();
  386.   }
  387.  
  388. function updateDdList() {
  389.   for (var i=0; i<8; i++) {  
  390.     ddItem[i].factor = moduleRoot.selectNodes("item[@name='"+activiteit[chosenTab]+"']")[ddFirst+i].getAttribute("factor");
  391.     ddItem[i].innerText = moduleRoot.selectNodes("item[@name='"+activiteit[chosenTab]+"']")[ddFirst+i].text;
  392.     }
  393.   }
  394.   
  395. function VoorbeeldButtons(t) {
  396.   VoorbeeldBtn[0].style.visibility = (t=='hide')?"hidden":"visible";
  397.   VoorbeeldBtn[1].style.visibility = (t=='hide')?"hidden":"visible";
  398.   VoorbeeldBtn[2].style.visibility = (t=='hide')?"hidden":"visible";
  399.   }
  400.   
  401. function buildWeek(t) {
  402.   WeekArea.style.visibility = 'inherit';
  403.   WeekResultImg.filters.blendTrans.Apply();
  404.   if (t<3) theSrc = "images/weekresult_groen.bmp";
  405.   else if (t>3) theSrc = "images/weekresult_rood.bmp";
  406.   else theSrc = "images/weekresult_oranje.bmp";
  407.   WeekResultImg.src = theSrc;
  408.   WeekResultImg.filters.blendTrans.Play();
  409.   
  410.   WeekTitle.innerText = moduleRoot.selectNodes("//result")[t].selectSingleNode("titel").text;
  411.   
  412.   styleRule = '<?xml version="1.0"?>';
  413.   styleRule += '<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">';
  414.   styleRule += '<xsl:template match="/">';
  415.   styleRule += '<xsl:apply-templates select="//result['+t+']/tekst">';
  416.   styleRule += '<xsl:template>';
  417.   styleRule += '<xsl:copy>';
  418.   styleRule += '<xsl:apply-templates select="@* | * | comment() | pi() | text()"/>';
  419.   styleRule += '</xsl:copy>';
  420.   styleRule += '</xsl:template>';
  421.   styleRule += '</xsl:apply-templates>';
  422.   styleRule += '</xsl:template>';
  423.   styleRule += '</xsl:stylesheet>';    
  424.  
  425.   style = new ActiveXObject("Microsoft.XMLDOM");
  426.   style.loadXML(styleRule);  
  427.   
  428.   WeekTekst.innerHTML = moduleData.transformNode(style);  
  429.   }
  430.  
  431. var countTimer;
  432. var counting = false;
  433. var countObj;
  434.   
  435. function RealCount() {
  436.   clearTimeout(countTimer);
  437.   
  438.   theNum = parseInt(countObj.num);
  439.   theFactor = (countObj.factor)?parseInt(countObj.factor):1;
  440.   theValue = parseInt(CountBox[theNum].value);
  441.   if (((countObj.innerText == '-') || (countObj.dirtype == '-')) && ((theValue-theFactor) >= minMax[theNum*2])) {
  442.     theValue -= theFactor;
  443.     }
  444.   else if (((countObj.innerText == '+') || (countObj.dirtype == '+')) && ((theValue-theFactor) <= minMax[(theNum*2)+1])) {
  445.     theValue += theFactor;
  446.     }
  447.   CountBox[theNum].value = theValue;
  448.   CountAction(theNum);
  449.     
  450.   if (counting) countTimer = window.setTimeout('RealCount()',100);
  451.   }