<a href="#">link</a>
<div style="background: red; display: none; width: 100px; height: 100px;"></div>
<script type="text/javascript">
document.getElementsByTagName('a')[0].onclick = function(){
var div = document.getElementsByTagName('div')[0];
div.style.display = (div.style.display == 'none') ? '' : 'none';
(function(){
if(div.style.display == ''){
window.setTimeout(function(){
window.location = "http://www.google.com/";
arguments.callee;
}, 1000);
}
})();
};
</script>