(function(window, document, undefined) {

	// Create handlebars template
	var templates = {};
	templates.banner = Handlebars.compile(Templates.banner);
	templates.title = Handlebars.compile(Templates.title);
	templates.callToAction = Handlebars.compile(Templates.callToAction);
	templates.footer = Handlebars.compile(Templates.footer);

	var links = {};
	links.home = { name: "Home", link: "www.stanfordsportsanalytics.com" };
	links.twitter = { name: "Twitter", link: "www.twitter.com/stanfordsac" };
	links.facebook = { name: "Facebook", link: "www.facebook.com/stanfordsportsanalytics" };
	links.blog = { name: "Blog", link: "www.stanfordsportsanalytics.wordpress.com" };

	$('#banner').html(templates.banner());
	$('#title').html(templates.title());
	$('#call-to-action').html(templates.callToAction());
	$('#footer').html(templates.footer());

})(this, this.document);

@@ -1,40 +1,56 @@
-(function(window, document, undefine
+populatePage = function(pageTemplate, pageData, divI
 d) %7B
@@ -103,16 +103,76 @@
 s = %7B%7D;%0A
+%09templates.pageTemplate = Handlebars.compile(pageTemplate);%0A
 %09templat
@@ -749,20 +749,595 @@
 %7D;%0A%0A
+%09var buttons = %7B%7D;%0A%09buttons.banner = %5B%0A%09%09%7Btext: links.home.name, link: links.home.link, color: %22dark%22%7D,%0A%09%09%7Btext: %22Profiles%22, link: %22www.stanfordsportsanalytics.com/profiles%22, color: %22dark%22%7D,%0A%09%09%7Btext: %22Blog%22, link: %22http://stanfordsportsanalytics.wordpress.com%22, color: %22dark%22, target: %22new%22%7D%0A%09%5D;%0A%09buttons.mailList = %7Btext: %22Join our mailing list!%22, link: %22//mailman.stanford.edu/mailman/listinfo/sportsanalytics%22, color: %22light%22, target: %22new%22%7D;%0A%0A%09var data = %7B%7D;%0A%09data.links = links;%0A%09data.buttons = buttons;%0A%09data.year = new Date().getFullYear();%0A%09data.pageData = pageData%0A%0A
 %09$(
-'
+%22
 #banner
-'
+%22
 ).ht
@@ -1360,23 +1360,27 @@
 ner(
+data
 ));%0A%09$(
-'
+%22
 #title
-'
+%22
 ).ht
@@ -1398,24 +1398,28 @@
 s.title(
+data
 ));%0A%09$(
-'
+%22
 #call-to
@@ -1425,17 +1425,17 @@
 o-action
-'
+%22
 ).html(t
@@ -1460,24 +1460,28 @@
 ion(
+data
 ));%0A%09$(
-'
+%22
 #footer
-'
+%22
 ).ht
@@ -1504,34 +1504,62 @@
 ter(
-));%0A%0A%7D)(this, this.document)
+data));%0A%09$(divId).html(templates.pageTemplate(data));%0A%0A%7D
 ;%0A

Built out common elements