This code works for both IE 7 and the latest version of Mozilla although the default setting in mozilla doesnt allow to close a window through javascript.
Here is the code:
function F11() { window.open('','_parent',''); window.open("login.aspx", "", "channelmode"); window.close(); }
To change the default setting :
1.type"about:config " in your firefox address bar and enter;
2.make sure your "dom.allow_scripts_to_close_windows" is true