// Source code Copyright © vanAnnies.  All Rights Reserved.
// Contact GetTheGhost.com for Licensing
function vanGhostTimer() { } vanGhostTimer.anims = new Array; vanGhostTimer.speed = 100; vanGhostTimer.running = false; vanGhostTimer.getStepsPerSecond = function() { if(vanGhostTimer.speed <= 0) return 0; return Math.round(1000 / vanGhostTimer.speed); }; vanGhostTimer.add = function(a) { vanGhostTimer.anims[vanGhostTimer.anims.length] = a; }; vanGhostTimer.run = function() { vanGhostTimer.running = true; var keepgoing = false; var a = vanGhostTimer.anims; for(i = 0; i < a.length; i++) { /* debug for(var z in a[i]) { alert(z + ' => ' + a[i][z]); } */ if(a[i].step()) keepgoing = true; } if(keepgoing) setTimeout("vanGhostTimer.run()", vanGhostTimer.speed); else vanGhostTimer.running = false; }; 
