diff --git a/mercurial/templates/static/mercurial.js b/mercurial/templates/static/mercurial.js
index c2e2437f2b2e1140e00802cbb80d0e287bb375db_bWVyY3VyaWFsL3RlbXBsYXRlcy9zdGF0aWMvbWVyY3VyaWFsLmpz..9c99541e3d56d275bd89e9d2c80645a9385d5f60_bWVyY3VyaWFsL3RlbXBsYXRlcy9zdGF0aWMvbWVyY3VyaWFsLmpz 100644
--- a/mercurial/templates/static/mercurial.js
+++ b/mercurial/templates/static/mercurial.js
@@ -33,9 +33,12 @@
 	this.cell = [2, 0];
 	this.columns = 0;
 
-	this.reset = function() {
+}
+
+Graph.prototype = {
+	reset: function() {
 		this.bg = [0, 4];
 		this.cell = [2, 0];
 		this.columns = 0;
 		document.getElementById('nodebgs').innerHTML = '';
 		document.getElementById('graphnodes').innerHTML = '';
@@ -37,7 +40,7 @@
 		this.bg = [0, 4];
 		this.cell = [2, 0];
 		this.columns = 0;
 		document.getElementById('nodebgs').innerHTML = '';
 		document.getElementById('graphnodes').innerHTML = '';
-	};
+	},
 
@@ -43,5 +46,5 @@
 
-	this.scale = function(height) {
+	scale: function(height) {
 		this.bg_height = height;
 		this.box_size = Math.floor(this.bg_height / 1.2);
 		this.cell_height = this.box_size;
@@ -45,5 +48,5 @@
 		this.bg_height = height;
 		this.box_size = Math.floor(this.bg_height / 1.2);
 		this.cell_height = this.box_size;
-	};
+	},
 
@@ -49,5 +52,5 @@
 
-	this.setColor = function(color, bg, fg) {
+	setColor: function(color, bg, fg) {
 
 		// Set the colour.
 		//
@@ -75,5 +78,5 @@
 		this.ctx.fillStyle = s;
 		return s;
 
-	};
+	},
 
@@ -79,5 +82,5 @@
 
-	this.edge = function(x0, y0, x1, y1, color, width) {
+	edge: function(x0, y0, x1, y1, color, width) {
 
 		this.setColor(color, 0.0, 0.65);
 		if(width >= 0)
@@ -87,5 +90,5 @@
 		this.ctx.lineTo(x1, y1);
 		this.ctx.stroke();
 
-	};
+	},
 
@@ -91,5 +94,5 @@
 
-	this.render = function(data) {
+	render: function(data) {
 
 		var backgrounds = '';
 		var nodedata = '';
@@ -155,5 +158,5 @@
 		document.getElementById('nodebgs').innerHTML += backgrounds;
 		document.getElementById('graphnodes').innerHTML += nodedata;
 
-	};
+	}
 
@@ -159,5 +162,5 @@
 
-}
+};
 
 
 function process_dates(parentSelector){