(function() {
	var originalUnderscoreTemplateFunction = _.template;
	var templateHelpers = {};

	_.mixin({
		addTemplateHelpers : function( newHelpers ) {
			_.extend( templateHelpers, newHelpers );
		},

		template : function(text, data, settings) {
			// replace the built in _.template function with one that supports the addTemplateHelpers
			// function above. Basically the combo of the addTemplateHelpers function and this new
			// template function allows us to mix in global "helpers" to the data objects passed
			// to all our templates when they render. This replacement template function just wraps
			// the original _.template function, so it sould be pretty break-resistent moving forward.

			if( data )
			{
				// if data is supplied, the original _.template function just returns the raw value of the
				// render function (the final rentered html/text). So in this case we just extend
				// the data param with our templateHelpers and return raw value as well.

				_.defaults( data, templateHelpers ); // extend data with our helper functions
				return originalUnderscoreTemplateFunction.apply( this, arguments ); // pass the buck to the original _.template function
			}
			
			var template = originalUnderscoreTemplateFunction.apply( this, arguments );

			var wrappedTemplate = function( data ) {
				if( data ) _.defaults( data, templateHelpers );
				return template.apply( this, arguments );
			};

			return wrappedTemplate;
		}
	} );
})();
@@ -220,16 +220,17 @@
 unction(
+ 
 text, da
@@ -241,16 +241,17 @@
 settings
+ 
 ) %7B%0A%09%09%09/
@@ -1325,26 +1325,22 @@
 ) %7B%0A%09%09%09%09
-if( 
 data 
-)
+=
  _.defau
@@ -1335,32 +1335,36 @@
 ta = _.defaults(
+ %7B%7D,
  data, templateH
@@ -1393,29 +1393,28 @@
 emplate.
-apply
+call
 ( this, 
 argument
@@ -1401,33 +1401,28 @@
 call( this, 
-arguments
+data
  );%0A%09%09%09%7D;%0A%0A%09

add helpers even if data is not supplied