I have a popup window which is opened using this code:
function _openpageview(fieldid,objectid,opennew) { var url=\'/s_viewpagefield.jsp?fieldid=\'+fieldid+\
Your web_window variable must have gone out of scope when you tried to close the window. Add this line into your _openpageview function to test:
setTimeout(function(){web_window.close();},1000);