JavaScript string formatting function highly compatible with the String.Format method from .NET