// solutie buna pt inchis fereastra tot timpul;
        setTimeout(function() {
            win.close();
        },2000);

// solutie buna pt inchis fereastra tot timpul;
setTimeout(function() {
win.close();
},2000);