Why does taking out the snippet of code '.prototype' cause my javascript to not work here?
<p>In the following function, if I take out the '.prototype' part the function ceases to work.</p>

<pre><code>imageClock.display.prototype.update = function() {
 var dateObj = new Date();
 var currentTime = dateObj.getHours() + ":" + dateObj.getMinutes() + ":" + dateObj.getSeconds();
 var currentTimeHTML = imageClock.imageHTML(currentTime) + '&lt;img src="' + ((dateObj.getHours() &gt;=12) ? imageClock.digits[11] : imageClock.digits[10]) + '" /&gt;';
 document.getElementById(this.spanId).innerHTML = currentTimeHTML;
}
</code></pre>

<p>What I don't understand is that I'm not using the prototype framework as part of my code. The only file my html file is linking to is the javascript file containing this code. (full code below; name of the file is clock3.js inside a folder called 'javascript', which is the only javascript file my html file points/links to.)</p>

<pre><code>var imageClock = new Object();

imageClock.digits = ["images/clock/0.gif", "images/clock/1.gif", "images/clock/2.gif", "images/clock/3.gif", "images/clock/4.gif", "images/clock/5.gif", "images/clock/6.gif", "images/clock/7.gif", "images/clock/8.gif", "images/clock/9.gif", "images/clock/am.gif", "images/clock/pm.gif", "images/clock/colon.gif"];

imageClock.instances = 0;

var preLoadImages = [];

// preloads javascript images
for (var i = 0; i &lt; imageClock.digits.length; i++) {
 preLoadImages[i] = new Image();
 preLoadImages[i].src = imageClock.digits[i];
}

imageClock.imageHTML = function(timeString) {
 var sections = timeString.split(":");

 // makes the hour digit either 12pm or 1pm depending on what time it is so that 0am or 13pm doesn't appear
 if (sections[0] == "0") {
  sections[0] = "12";
 } else if (sections[0] &gt;= 13) {
  sections[0] = sections[0] - 12 + "";
 }
 for (var i = 0; i &lt; sections.length; i++) {
  if (sections[i].length == 1) {
   sections[i] = '&lt;img src="' + imageClock.digits[0] + '" /&gt;' + '&lt;img src="' + imageClock.digits[parseInt(sections[i])] + '" /&gt;';
  } else {
   sections[i] = '&lt;img src="' + imageClock.digits[parseInt(sections[i].charAt(0))] + '" /&gt;' + '&lt;img src="' + imageClock.digits[parseInt(sections[i].charAt(1))] + '" /&gt;';
  } 
 }

 // section[0] indicates hours, the image tag is the colons, sections[1] indicates the second part which is the minutes, and sections[2] indicates seconds. delete sections[2] and the seconds part of the clock will disappear.
 return sections[0] + '&lt;img src="' + imageClock.digits[12] + '" /&gt;' + sections[1] + '&lt;img src="' + imageClock.digits[12] + '" /&gt;' + sections[2];
}

imageClock.display = function() {
 var clockInstance = this;
 this.spanid = "clockSpan" + (imageClock.instances++);
 document.write('&lt;span id = "' + this.spanId + '"&gt;&lt;/span&gt;');
 this.update();
 setInterval(function() {clockInstance.update()}, 1000);
}

imageClock.display.prototype.update = function() {
 var dateObj = new Date();
 var currentTime = dateObj.getHours() + ":" + dateObj.getMinutes() + ":" + dateObj.getSeconds();
 var currentTimeHTML = imageClock.imageHTML(currentTime) + '&lt;img src="' + ((dateObj.getHours() &gt;=12) ? imageClock.digits[11] : imageClock.digits[10]) + '" /&gt;';
 document.getElementById(this.spanId).innerHTML = currentTimeHTML;
}
</code></pre>

<p>and the html file using this javascript code to display a simple clock is as follows</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;script type="text/javascript" src="javascript/clock3.js"&gt;&lt;/script&gt;
&lt;title&gt;Javascript Clock&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;The Current Time:&lt;/h1&gt;
&lt;p&gt;&lt;script type="text/javascript"&gt;new imageClock.display();&lt;/script&gt;&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>As you can see I have not included the prototype framework, and I don't understand why the code stops working when I take out the '.prototype' part</p>
