I try to use this line to open up a new window and at the same time close the window from where the user clicked the link. It do open a new window but I get the following warning when trying to close the window. "Scripts may close only the windows that were opened by them"
<a href="#"><img src="images/close.png" onClick="CloseMe ('newwindow.html'),top.window.close();"></a>
<script language="JavaScript" type="text/javascript">
function CloseMe(url,h,w) {
popupWin = window.open(url, 'popup', 'height=' + h + ',width=' + w + ',top=0,left=0');
}
</script>