home *** CD-ROM | disk | FTP | other *** search
- var moduleData = new ActiveXObject("Microsoft.XMLDOM");
- moduleData.load("data/steptest.xml");
- var moduleRoot = moduleData.documentElement;
-
- var minMax = new Array(125,175,0,0);
-
- var gewicht = parseFloat(parent.userRoot.selectSingleNode("gewicht").text);
- var geslacht = parent.userRoot.selectSingleNode("geslacht").text;
-
- function showPage() {
- buildPage();
- parent.goPage = 'steptest.html';
- AppScreen.style.visibility = "visible";
- }
-
- function buildPage() {
- style = new ActiveXObject("Microsoft.XMLDOM");
-
- styleRule = buildStyleRule(0);
- style.loadXML(styleRule);
- TextArea[0].innerHTML = moduleData.transformNode(style);
-
- styleRule = buildStyleRule(1);
- style.loadXML(styleRule);
- TextArea[1].innerHTML = moduleData.transformNode(style);
-
- styleRule = buildStyleRule(2);
- style.loadXML(styleRule);
- TextArea[2].innerHTML = moduleData.transformNode(style);
-
- waarde = new Array('onvoldoende','net niet voldoende','voldoende','ruim voldoende','goed');
-
- if (gewicht < 55) cgewicht = 50;
- else if ((gewicht >= 55) && (gewicht < 65)) cgewicht = 60;
- else if ((gewicht >= 65) && (gewicht < 75)) cgewicht = 70;
- else if ((gewicht >= 75) && (gewicht < 85)) cgewicht = 80;
- else if (gewicht >= 85) cgewicht = 90;
-
- textString = '<table>';
- textString += '<tr height="20" valign="top"><td style="color:#000000" width="70"></td><td style="color:#000000" width="60"><span style="position:relative; top:2px"></span></td><td> </td></tr>';
- for (var i=0; i<5; i++) {
- textString += '<tr><td>'+moduleRoot.selectNodes("vo[@gewicht = '"+cgewicht+"']")[i].getAttribute("hartslag")+'</td><td>'+moduleRoot.selectNodes("vo[@gewicht = '"+cgewicht+"']")[i].text+'</td><td>'+waarde[i]+'</td></tr>';
- }
- textString += '</table>'
-
- TextArea[4].innerHTML = textString;
- }
-
- function CountAction(c) {
- theNum = c;
- theValue = parseInt(CountBox[c].value);
- if ((theValue >= minMax[theNum*2]) && (theValue <= minMax[(theNum*2)+1])) {
- CountBox[c].value = parseInt(CountBox[c].value);
- }
- else CountBox[c].value = minMax[theNum*2];
-
- hartslag = parseFloat(CountBox[0].value);
-
- if (hartslag < 135) chartslag = 130;
- else if ((hartslag >= 135) && (hartslag < 145)) chartslag = 140;
- else if ((hartslag >= 145) && (hartslag < 155)) chartslag = 150;
- else if ((hartslag >= 155) && (hartslag < 165)) chartslag = 160;
- else if (hartslag >= 165) chartslag = 170;
-
- if (gewicht < 55) cgewicht = 50;
- else if ((gewicht >= 55) && (gewicht < 65)) cgewicht = 60;
- else if ((gewicht >= 65) && (gewicht < 75)) cgewicht = 70;
- else if ((gewicht >= 75) && (gewicht < 85)) cgewicht = 80;
- else if (gewicht >= 85) cgewicht = 90;
-
- Result.innerText = moduleRoot.selectSingleNode("vo[@gewicht = '"+cgewicht+"' $and$ @hartslag = '"+chartslag+"']").text
- }
-
- function buildStyleRule(t) {
- styleRule = '<?xml version="1.0"?>';
- styleRule += '<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">';
- styleRule += '<xsl:template match="/">';
- styleRule += '<xsl:apply-templates select="steptest/text['+t+']">';
- styleRule += '<xsl:template>';
- styleRule += '<xsl:copy>';
- styleRule += '<xsl:apply-templates select="@* | * | comment() | pi() | text()"/>';
- styleRule += '</xsl:copy>';
- styleRule += '</xsl:template>';
- styleRule += '</xsl:apply-templates>';
- styleRule += '</xsl:template>';
- styleRule += '</xsl:stylesheet>';
- return styleRule;
- }
-
- var countTimer;
- var counting = false;
- var countObj;
-
- function RealCount() {
- clearTimeout(countTimer);
-
- theNum = parseInt(countObj.num);
- theFactor = (countObj.factor)?parseInt(countObj.factor):1;
- theValue = parseInt(CountBox[theNum].value);
- if (((countObj.innerText == '-') || (countObj.dirtype == '-')) && ((theValue-theFactor) >= minMax[theNum*2])) {
- theValue -= theFactor;
- }
- else if (((countObj.innerText == '+') || (countObj.dirtype == '+')) && ((theValue-theFactor) <= minMax[(theNum*2)+1])) {
- theValue += theFactor;
- }
- CountBox[theNum].value = theValue;
- CountAction(theNum);
-
- if (counting) countTimer = window.setTimeout('RealCount()',100);
- }