title: TypeError: kendoWindow is not a function
body: <p>I'm trying to resolve a client-side issue that has me scratching my head.  What happens is, on my form, I click a button to open a window, and I get the dreaded "TypeError: kendoWindow is not a function" error.</p>
  
  <p>There are a few things I should mention about this environment before I post my code:<ul>
  <li>The button in question is contained within a DIV that is initially hidden.  Therefore, the button does not exist as an object until it is visible.</li>
  <li>The client-side code that controls this is actually contained within an XSLT that contains the OnClick event.</li>
  <li>The XSLT is edited through a CMS, not directly in a file.  If I'm not mistaken, the XSLT code is actually stored in the database, not in a file.</li>
  <li>There are two different XSLTs: one for the parent window (for the sake of this post, I'll call this PARENT), and one for the hidden DIV code (I'll call this HIDDEN) that takes effect once it's visible.</li>
  </ul>So, here's the original code.  (Note: I did not write this; yes, I realize that "window" should NOT be used as a variable name.  Be that as it may, this did work previously, and I don't believe this is causing my issue.)</p>
  
  <p>PARENT XSLT:</p>
  
  <pre><code>//This is contained within $(document).ready(function()
  var window = $("#Sponsor").kendoWindow({
  height: "100px",
  modal: true,
  title: "Choose Sponsor",
  visible: false,
  width: "500px"
  }).data("kendoWindow");
  </code></pre>
  
  <p>HIDDEN XSLT (this is contained in an XSL:OnClick attribute):</p>
  
  <pre><code>var window = $('#Sponsor').data('kendoWindow');window.center();window.open();
  </code></pre>
  
  <p>Realizing that using "window" as a variable could potentially be an issue, I changed it to look like this:</p>
  
  <p>PARENT:</p>
  
  <pre><code>var kSponWin= $("#Sponsor");
  if (!kSponWin.data("kendoWindow")) {
  kSponWin.kendoWindow({
  height: "100px",
  modal: true,
  title: "Choose Sponsor",
  visible: false,
  width: "500px"
  }).data("kendoWindow");
  }
  </code></pre>
  
  <p>HIDDEN:</p>
  
  <pre><code>kSponWin.center().open();
  </code></pre>
  
  <p>Nothin' doin'.  The only difference is now my error says "kSponWin.kendoWindow" instead of "window.kendoWindow is not a function."</p>
  
  <p>So does anyone have any idea as to what I should do?  This problem is keeping me from testing.</p>
  
  <p>Thanks in advance . . .</p>