// функция для открытия нового окна
IE = navigator.appName=="Microsoft Internet Explorer";
NS = navigator.appName=="Netscape";
bVer = parseInt(navigator.appVersion);
var newWin=null;

function popup(loc_ie, loc_ns, name, width, height) {
	var _params = "width="+width+",height="+height+",resizable=no,status=no,scrollbars=yes";

//	var _params = "width=480,height=535,resizable=no,status=no,scrollbars=no";

	if( bVer >= 4 ) {
		_left = ( (screen.width-width) >>1 );
		_top = ( (screen.height-height) >>1 );
	} else {
		_left = ( (800-width) >>1 );
		_top = ( (600-height) >>1 );
	}
	if( IE ) _params+=",top="+_top+",left="+_left;
		else if( NS ) _params+=",screenX="+_left+",screenY="+_top;

	if( IE ) newWin = window.open(loc_ie, name, _params);
		else if( NS ) newWin = window.open(loc_ns, name, _params);

//	if( newWin!=null && !(IE && bVer<5) ) newWin.focus(); // MSIE4 
	newWin.focus();
}