function newWindow(url,sw,sh) {
	var v=parseInt(navigator.appVersion);
	isNetscape=navigator.appName.indexOf('Netscape')>=0;
	isExplorer=navigator.appName.indexOf('Explorer')>=0;
	positionCode='';

	         w  = screen.availWidth/2-sw/2;
	         h  = screen.availHeight/2-sh/2;

	 if(isExplorer) {
	        positionCode=',left='+w+',top='+h;
	    }
	 if(isNetscape) {
	        positionCode=',screenX='+w+',screenY='+h;
	    }
		   positionCode+=',scrollbars=yes, resizable=yes'

	   newWin=window.open('','a','width='+sw+',height='+sh+','+positionCode);
	   newWin.document.location=url;
	   newWin.focus();
	return newWin;
}

//************** Выбор кноки для сабмита контролов ASP.NET *************

var eventKey;

  function registerSubmitHandlers() {
    if ( typeof(autoSubmitNames)!="undefined" ) {
      for( i = 0; i<autoSubmitNames.length; i++ ) {
        var ob = document.getElementById(autoSubmitNames[i]);
        if ( ob!=null )
          ob.onkeydown = doSubmit;
      }
      if ( !document.all ) {
        eventKey = "e.keyCode";
        document.captureEvents(Event.KeyDown);
      }
      else
        eventKey = "event.keyCode";
    }
  }

  function doLinkSubmit(linkID) {
    if ( document.all )
      document.getElementById(linkID).click();
    else
      document.location.href = document.getElementById(linkID).href;
  }

  function doSubmit(e) {
    if ( eval(eventKey)==13 ) {
      for( i=0; i<autoSubmitNames.length; i++ ) {
        if ( autoSubmitNames[i]==this.id ) {
          eval(autoSubmit[i]);
          return false;
        }
      }
    }
  }

