User:Killr833/simple.js

(function {

simple.unformat = function(num) { var unformatted = num.replace(/\,/g, ''); return unformatted; }

simple.wait = function(time, function) { var timeArray = time.split(' '); var timeNum = simple.unformat(timeArray[0]); var timeType = timeArray[1]; switch(timeType) {		case 'millisecond': var timeMsMod = 1; break; case 'milliseconds': var timeMsMod = 1; break; case 'centisecond': var timeMsMod = 10; break; case 'centiseconds': var timeMsMod = 10; break; case 'second': var timeMsMod = 1000; break; case 'seconds': var timeMsMod = 1000; break; case 'kilosecond': var timeMsMod = 1000000; break; case 'kiloseconds': var timeMsMod = 1000000; break; case 'hour': var timeMsMod = 3600000; break; case 'hours': var timeMsMod = 3600000; break; case 'day': var timeMsMod = 86400000; break; case 'days': var timeMsMod = 86400000; break; case 'week': var timeMsMod = 604800000; break; case 'weeks': var timeMsMod = 604800000; break; }	var timeMs = Number(timeNum) * timeMsMod; setTimeout(function, timeMs); }

});