function win_focus () {
	if (typeof(w_name.document)=="object") {
		if (!w_name.closed) {
			w_name.focus(); 
			return false;
		}
	}
}

function win_open (file, name, win_width, win_height, strig_param, win_type, evnt, offsetx, offsety) {
   if (typeof(evnt) == 'object') {
      xx = evnt.screenX - win_width / 2;
      if (typeof(offsetx) == 'number') xx = xx + offsetx;
      yy = evnt.screenY - win_height + 25;
      if (typeof(offsety) == 'number') yy = yy + offsety;
   }
   else {
      xx = (screen.width - win_width -10) / 2;
      yy = (screen.height - win_height - 32) / 2;
   }
   if ( xx+ win_width  > screen.width) xx = screen.width-win_width-10;
   if ( xx < 0 ) xx = 3; 
   if ( yy + win_height +55 > screen.height) yy = screen.height-win_height-55;
   if ( yy < 0 ) yy = 3;     
   w_name =  window.open(file, name, strig_param+',width='+win_width+',height='+win_height+',left='+xx+',top='+yy);
      if (win_type)  window.onfocus=win_focus;
   return w_name;
}



function enlarge (url) {
win_open('popup.html', '_blank', 635, 475,'resizable=no,scrollbars=no,toolbar=no,status=no', true);
}