jQuery.extend({
	popup: function(name, path, focus, width, height, resizable, scrollbars, status, dependant) {
		var left_offset, top_offset, winhandler;
		var settings = '';

	  if (1 == dependant) {
	  	if (window.showModalDialog) {
	    	return window.showModalDialog(path,'dialogWidth:'+width+'px; dialogHeight:'+height+'px');
	  	}
	  	else {
	  		settings = 'modal=yes,dialog=no,minimizable=yes,dependent=yes,';
	  	}
	  }

	  settings = settings + 'resizable='  + (resizable  ? 'yes' : 'no') + ',';
	  settings = settings + 'scrollbars=' + (scrollbars ? 'yes' : 'no') + ',';
	  settings = settings + 'status='     + (status     ? 'yes' : 'no') + ',';

	  if ( width ) {
	    if ( height == null ) {
	      height = width;
	    }

			if ( navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) >= 4 ) {
				left_offset = ( screen.Availwidth  ) ? ( screen.Availwidth  - width  ) / 2 : 100;
				top_offset  = ( screen.Availheight ) ? ( screen.Availheight - height ) / 2 : 100;
			}
			else {
				left_offset = ( screen.width       ) ? ( screen.width  - width  )     / 2 : 100;
				top_offset  = ( screen.height      ) ? ( screen.height - height )     / 2 : 100;
			}

	    settings = settings + 'width='+width+',height='+height+',top='+top_offset+',left='+left_offset;
	  }

	  try {
			winhandler = window.open(path,name,settings);

			if (focus && winhandler && winhandler.focus) {
				winhandler.focus();
			}
	  } catch (e) {};

	  return winhandler;
	}
});