User:Fellrnr (User talk:Fellrnr | contribs) |
User:Fellrnr (User talk:Fellrnr | contribs) |
(50 intermediate revisions by 2 users not shown) |
Line 1: |
Line 1: |
− | <html>
| + | This is not the test page you're looking for. 2. Move along... |
− | <script type="text/javascript">
| |
− | var isArray = function (obj) {
| |
− | return Object.prototype.toString.call(obj) === "[object Array]";
| |
− | },
| |
− | getNumWithSetDec = function( num, numOfDec ){
| |
− | var pow10s = Math.pow( 10, numOfDec || 0 );
| |
− | return ( numOfDec ) ? Math.round( pow10s * num ) / pow10s : num;
| |
− | },
| |
− | getAverageFromNumArr = function( numArr, numOfDec ){
| |
− | if( !isArray( numArr ) ){ return false; }
| |
− | var i = numArr.length,
| |
− | sum = 0;
| |
− | while( i-- ){
| |
− | sum += numArr[ i ];
| |
− | }
| |
− | return getNumWithSetDec( (sum / numArr.length ), numOfDec );
| |
− | },
| |
− | getVariance = function( numArr, numOfDec ){
| |
− | if( !isArray(numArr) ){ return false; }
| |
− | var avg = getAverageFromNumArr( numArr, numOfDec ),
| |
− | i = numArr.length,
| |
− | v = 0;
| |
− |
| |
− | while( i-- ){
| |
− | v += Math.pow( (numArr[ i ] - avg), 2 );
| |
− | }
| |
− | v /= numArr.length;
| |
− | return getNumWithSetDec( v, numOfDec );
| |
− | },
| |
− | getStandardDeviation = function( numArr, numOfDec ){
| |
− | if( !isArray(numArr) ){ return false; }
| |
− | var stdDev = Math.sqrt( getVariance( numArr, numOfDec ) );
| |
− | return getNumWithSetDec( stdDev, numOfDec );
| |
− | };
| |
− | | |
− | function doCalc()
| |
− | {
| |
− | var d1 = document.getElementById('dur_1').innerHTML;
| |
− | alert(d1);
| |
− | //var c1 = document.getElementById('cr10_1').innerHTML;
| |
− | //alert(c1);
| |
− | //var t1 = d1 * c1;
| |
− | //alert(t1);
| |
− | //document.getElementById('trimp_1').innerHTML = t1;
| |
− | }
| |
− | </script>
| |
− | | |
− | <form style="font-family: Helvetica,Arial,sans-serif;" id="Monotony">
| |
− | <table style="text-align: left;" border="1" cellpadding="1" cellspacing="1">
| |
− | <tr>
| |
− | <th>Day</th>
| |
− | <th>Duration (min)</th>
| |
− | <th>CR10 Rating</th>
| |
− | <th>TRIMP(CR10)</th>
| |
− | </tr>
| |
− | <tr>
| |
− | <td>1</td>
| |
− | <td><input maxlength="3" size="3" id="Dur_1" value="0"></td>
| |
− | <td><input maxlength="3" size="3" id="cr10_1" value="0"></td>
| |
− | <td><label id="trimp_1"></label></td>
| |
− | </tr>
| |
− | <tr>
| |
− | <td>2</td>
| |
− | <td><input maxlength="3" size="3" id="Dur_2" value="0"></td>
| |
− | <td><input maxlength="3" size="3" id="cr10_2" value="0"></td>
| |
− | <td><input maxlength="3" size="3" id="trimp_2" value="0" readonly="readonly"></td>
| |
− | </tr>
| |
− | <tr>
| |
− | <td>3</td>
| |
− | <td><input maxlength="3" size="3" id="Dur_3" value="0"></td>
| |
− | <td><input maxlength="3" size="3" id="cr10_3" value="0"></td>
| |
− | <td><input maxlength="3" size="3" id="trimp_3" value="0" readonly="readonly"></td>
| |
− | </tr>
| |
− | <tr>
| |
− | <td>4</td>
| |
− | <td><input maxlength="3" size="3" id="Dur_4" value="0"></td>
| |
− | <td><input maxlength="3" size="3" id="cr10_4" value="0"></td>
| |
− | <td><input maxlength="3" size="3" id="trimp_4" value="0" readonly="readonly"></td>
| |
− | </tr>
| |
− | <tr>
| |
− | <td>5</td>
| |
− | <td><input maxlength="3" size="3" id="Dur_5" value="0"></td>
| |
− | <td><input maxlength="3" size="3" id="cr10_5" value="0"></td>
| |
− | <td><input maxlength="3" size="3" id="trimp_5" value="0" readonly="readonly"></td>
| |
− | </tr>
| |
− | <tr>
| |
− | <td>6</td>
| |
− | <td><input maxlength="3" size="3" id="Dur_6" value="0"></td>
| |
− | <td><input maxlength="3" size="3" id="cr10_6" value="0"></td>
| |
− | <td><input maxlength="3" size="3" id="trimp_6" value="0" readonly="readonly"></td>
| |
− | </tr>
| |
− | <tr>
| |
− | <td>7</td>
| |
− | <td><input maxlength="3" size="3" id="Dur_7" value="0"></td>
| |
− | <td><input maxlength="3" size="3" id="cr10_7" value="0"></td>
| |
− | <td><input maxlength="3" size="3" id="trimp_7" value="0" readonly="readonly"></td>
| |
− | </tr>
| |
− | </table>
| |
− | <label id="Monotony">Monotony:</label>
| |
− | <br>
| |
− | <input type="button" value="Calculate" onclick="doCalc()"/>
| |
− | </form>
| |
− | </html>
| |
This is not the test page you're looking for. 2. Move along...