function getimg() { event.returnValue=false; show.window.location.href=event.srcElement.src; timer=setInterval(checkload,100) } function checkload(){ if(show.readyState!="complete") { show.document.execCommand("SaveAs"); clearInterval(timer)} }