function linkblur(){  
if (event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") 
document.body.focus();
}
document.onfocusin=linkblur;