function popup(mylink, width, height)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
  href=mylink;
else
  href=mylink.href;
  try { 
    if(!popupwin.closed) { 
      throw "Error 1"; }
		 else
		 { throw "no error"; }
    } 
  catch(er) {
    if(er == "Error 1") 
      popupwin.close();
      popupwin = window.open(href, 'popup','width='+width+',height='+height+',scrollbars=yes');
  	  popupwin.focus();
      return false;
      alert("Error 1");
 	  if(er == "no error")
      popupwin = window.open(href, 'popup','width='+width+',height='+height+',scrollbars=yes');
  	  popupwin.focus();
      return false;
      alert ("no error");
  } 
}