This is not working because you're calling a Javascript event to close the current window and after launching the "_blank" to acces to your link. You have to create a Js method to launch your link and after close the current window.
Use below instead.
<a href="#" onclick="window.open('login.php','_blank');window.close();return false">
<img src="images/loginto-apply-but.gif" border="0"/>
</a>