title: Something wrong in my onbeforeunload function but i couldn't find it
body: <p>Here is my working example on jsfiddle, its working on almost every browser (i tested it on IE9, Firefox, Chrome) except IE8 its acting weird: class change buttons (mavis or test1) only works if you click twice on it.</p>
  
  <p><a href="http://jsfiddle.net/Qq2tk/" rel="nofollow">http://jsfiddle.net/Qq2tk/</a></p>
  
  <p>If you put the setConfirmUnload function top of the jscript like in my example, before this function:</p>
  
  <pre><code>    $(".temasec").live("click", function()
  </code></pre>
  
  <p>and click the class change buttons "mavis" or "test1" its not doing anything on first click but its works on second click. This is only happening in IE8 (maybe in IE7 and IE6, didn't tested)</p>
  
  <p>So if you move the setConfirmUnload function after the class change function its working normal.</p>
  
  <p>What is wrong about this code? Specially for IE8 since its acting weird on IE8 only.</p>
  
  <p>Thank you for your help.</p>
  
  <p>Abides</p>