


function popup(url, new_width, new_height, wname)
{
  if(wname == undefined)
  	  wname = 'popup';
	
  sw = screen.width;
  sh = screen.height;
  xpos =(sw - new_width) / 2;
  ypos = (sh - new_height) / 2;
  code = '';
  
  isNetscape = navigator.appName.indexOf('Netscape') >= 0;
  isExplorer = navigator.appName.indexOf('Explorer') >= 0;
  isOpera = navigator.appName.indexOf('Opera') >= 0;
  
  if(isOpera)
  	code = 'left=' + xpos + ',top=' + (ypos - 70) +',';
  else
  	code = 'left=' + xpos + ',top=' + ypos +',';
  
  if (isExplorer) {
  	new_height -= 4;
  	new_width -= 5;
  }
  
  if(wname != 'popup') 
	  newWindow = window.open(url, wname, 'width=' + new_width + ',height=' + new_height + ',' + code + ',toolbar=0,status=0,resizable=0');
  else
	  newWindow = window.open(url, wname, 'width=' + new_width + ',height=' + new_height + ',' + code + ',toolbar=0,status=0,resizable=1');
	
  newWindow.focus();

  if(wname != 'popup')
  	return false;
}
