window.onbeforeunload error
<p>We currently have a JS that popups a window whenever the visitor wants to leave the site. It works fine, except when hitting the back button on the browser, it popups up the alert even if we are on the site.
we want to fix this.</p>

<p>Please note:
-we do not want to disable the back button
-we do not want to erase the historial</p>

<p>the JS function is onbeforeunload.
it is currently loading everytime the user wants to leave the site. When the user navigates the site, on every link that we DO NOT want to trigger the popup, we add this: onClick="changes=true;" to the href.</p>

<p>As I mentioned, problem is when user hits back button, FWD and sometimes refresh.</p>

<p>here is the website url <a href="http://64.118.65.18/" rel="nofollow">link text</a></p>
