title: Setting window.onbeforeunload to undefined in IE8 causes" not implemented error
body: <pre><code>            if(!$('fieldset.quote-step4').hasClass('show')) {
                  window.onbeforeunload = function() {
                      return "Are you sure you want to leave the quote request page? This will reset the form.";
                  }
              } else {
                  window.onbeforeunload = undefined;
              }
  </code></pre>
  
  <p>I have the above in a script inside of a private function that's causing a "not implemented" error in ie8.</p>
  
  <p>The specific line that causes the error is: <code>window.onbeforeunload = undefined;</code></p>
  
  <p>From what I've read in other questions <code>window</code> should be declared as a local variable to fix this issue-- but I'm not sure how.</p>
  
  <p>Can anyone explain this bug to me and a possible solution? </p>
  
  <p>Thank you!</p>