function sbwin_closed(w){
  var ua = navigator.userAgent;
  if(!!w) {
    if(ua.indexOf('MSIE 4') != -1 && ua.indexOf('Win')!=-1) return w.closed;
    else return typeof w.document != 'object';
  } else return true;
}
function openWin(url,wid,hgt,opt,name){
  if(!name) name="subwindow";
  if(!wid) wid=560;
  if(!hgt) hgt=400;
  if(!opt) opt="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no";
//  if(!opt) opt="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,left=0,top=0";
  if(window.open){
    if(sbwin_closed(name)) var w = window.open(url,name,"width="+wid+",height="+hgt+","+opt);
    else name.location.href = url;
    w.focus();
  }
  else location.href = url;
}

