var isNav = (navigator.appName.indexOf("Netscape") != -1);
var isIE  = (navigator.appName.indexOf("Microsoft") != -1);
var isXPSP2 = (window.navigator.userAgent.indexOf("SV1") != -1);
if (isIE){
    eval(attachEvent('onunload',unload));
}
else {
    eval(addEventListener('unload',unload,true));
}

function unload() {
    if (enable_exit && exit_url) {
        var u = "6BF52A52-394A-11D3-B153-00C04F79FAA6";

        if(isXPSP2){
            document.body.innerHTML+="<object id=iie width=0 height=0 classid='CLSID:"+u+"'></object>";
            iie.launchURL(exit_url);
        }
        else if (isIE){
            eval("window.showModalDialog('"+exit_url+"')");
        }
        else {
            window.open(exit_url);
        }
    }
}
function l_func(e) {

    if (isIE){ 
        e = window.event;
        clicked_object = e['srcElement'].toString();
    }  
    else {
        clicked_object = e["target"].toString();
    }

    if(clicked_object.search(/http/i) != -1){  
        enable_exit = 0;  
    }    
}
function load(){

    if (isNav){
        document.body.addEventListener("click", l_func, true);
    }
    else {
        document.body.attachEvent('onclick',l_func);
    }
}