An extension to the native JavaScript Timeout function with more features