function CloseWin()
{
window.open('','_self','');
window.top.opener=null;
window.close();
}
window.onbeforeunload = onbeforeunload_handler;
window.onunload = onunload_handler;
function onbeforeunload_handler()
{
return "如果需要!";
}
function onunload_handler(){
//这里写你的退出之后的事件
//比如调用dwr方法;
//清空session;
//在线统计等功能
}