Index: trunk/kernel/admin_templates/incs/script.js =================================================================== diff -u -r5248 -r5494 --- trunk/kernel/admin_templates/incs/script.js (.../script.js) (revision 5248) +++ trunk/kernel/admin_templates/incs/script.js (.../script.js) (revision 5494) @@ -1019,3 +1019,17 @@ $dst_element.appendChild($new_element); return $new_element; } + + Math.sum = function($array) { + var $i = 0; + var $total = 0; + while ($i < $array.length) { + $total += $array[$i]; + $i++; + } + return $total; + } + + Math.average = function($array) { + return Math.sum($array) / $array.length; + }