I'd probably use a separate function to set exit; that way, it'll be less code in your aI() definitions and you can more easily modify the system later. Here's what I would suggest:
(1) Define exit at the top of menu_data.js, along with the other globals, and add a function to menu_data.js, like so:
Code: Select all
var exit = true;
function setExit(state)
{
exit = state;
}
(2) On menu items where you want to set the exit value, use the new
clickfunction property to call setExit() and set exit's value. Like so:
The following menu item sould set exit=false, then go to page1.html:
Code: Select all
aI("text=sub1;url=page1.html;clickfunction=setExit(false);")
This one would set exit=true and go to
http://www.yahoo.com:
Code: Select all
aI("text=sub2;url=http://www.yahoo.com/;clickfunction=setExit(true);")
This one would go to page3.html but not change the state of exit:
Just an aside: It seems to me that there must be an easier way to do what you want to do. Instead of setting exit to true by default and always having to set it to false as a user navigates your site, why not set it to false by default, and only change it to true when you have to? Just a thought.
Hope that helps,
Kevin