I have this code working in ie6

test.htm code is as follows

<script type="text/javascript" language="javascript">
<!--
function checkWindow(){
if (window.name != "example") {
var windowClose = window.close;
// Re-implement window.open
window.close = function ()
{
window.opener = '';
window.open("","_self");
window.close();
}

window.opener = '';
window.close();
window.open ("http://www.google.com/",
"Test","toolbar=no,scrollbars=1,resizable=yes");
}
}
//--></script>
<body topmargin="0" bottommargin="0" onload="checkWindow();" >

With ie8, I am getting ActiveX error. so to overcome that, I added the following line on top

<!-- saved from url=(0014)about:internet -->

Now I am getting access denied and other error on window.close()

Any thoughts?
Thanks.