title: Cannot read property 'length' of undefined magento
body: <p>i am trying to add a datepicker to a form in magento. when i click on the calendar image  i am getting the error in the console - </p>
  
  <blockquote>
    <p>Uncaught TypeError: Cannot read property 'length' of undefined</p>
  </blockquote>
  
  <p>i am getting this error in calendar.js  on first line of this code : </p>
  
  <pre><code>for (i = 0; i &lt; Calendar._MN.length; i++) {
          a = a.replace(Calendar._MN[i], enUS.m.wide[i]);
      }
  </code></pre>
  
  <p>Here is the code:</p>
  
  <pre><code>&lt;link type="text/css" rel="stylesheet" href="&lt;?php echo $this-&gt;getJsUrl('calendar/calendar-win2k-1.css') ?&gt;" /&gt; 
  &lt;script src="&lt;?php echo $this-&gt;getJsUrl('calendar/calendar.js')?&gt;" &gt;&lt;/script&gt;
  &lt;script src="&lt;?php echo $this-&gt;getJsUrl('calendar/calendar-setup.js')?&gt;" &gt;&lt;/script&gt;
  
  &lt;script type="text/javascript"&gt;
  
  jQuery(function(){
  //&lt;![CDATA[
      Calendar.setup({
      inputField : '_dob',
      ifFormat : '%m/%e/%y',
      button : '_dob_trig',
      align : 'Bl',
      singleClick : true
      });
  //]]&gt;
  
  });
  
  &lt;/script&gt;
  
  
  &lt;dl class="last"&gt;
              &lt;dt&gt;&lt;label&gt;&lt;?php echo $this-&gt;__('Date of birth') ?&gt;&lt;/label&gt;&lt;/dt&gt;
              &lt;dd&gt;
                  &lt;div class="input-box"&gt;
                  &lt;input style="width:40%;" name="dob[]" id="_dob" type="text"  class="input-text" /&gt;
                  &lt;img title="Select date" id="_dob_trig" src="&lt;?php echo $this-&gt;getSkinUrl('images/calendar.gif');?&gt;" class="v-middle"&gt;
                  &lt;/div&gt;
              &lt;/dd&gt;
          &lt;/dl&gt;
  </code></pre>
  
  <p>Thanks</p>