window.onload = FocusWin; 
var counter = 0; 
function CloseWin(URL) { 
counter++; 
self.opener.location = URL; 
self.close(); 
} 
function FocusWin() { 
if (counter == 0) { 
window.focus(); 
} 
}
