function abrePopupASP(page,width,height) {
features = 'width='+width+',height='+height+',scrollbars=yes,statusbar=no,resizable=yes';
//page = page+'?agente=%{COD_CONEXAO}'
win = window.open(page,'id',features);
 try {
  //win.window.focus();
  win.focus();
 }
 catch(err) {
  //Permissao negada (dominios diferentes).
 }
}
function abrePopupNoScroll(page,width,height) {
	features = 'width='+width+',height='+height+',scrollbars=no,statusbar=no';
	win = window.open(page,'id',features);	
	win.window.focus();
}
function abrePopup(page,width,height) {
	features = 'width='+width+',height='+height+',scrollbars=yes,statusbar=no';
	win = window.open(page,'id',features);	
	win.window.focus();
}
function abreResizablePopup(page,width,height) {
	features = 'width='+width+',height='+height+',scrollbars=yes,statusbar=no,resizable=yes';
	win = window.open(page,'id',features);	
	win.window.focus();
}
function newWindow(mypage,myname,w,h,features) {
  var win = null;
  var winl = (screen.width-w)/2;
  var wint = (screen.height-h)/2;
  if (winl < 0) winl = 0;
  if (wint < 0) wint = 0;
  var settings = 'height=' + h + ',';
  settings += 'width=' + w + ',';
  settings += 'top=' + wint + ',';
  settings += 'left=' + winl + ',';
  settings += features;
  win = window.open(mypage,myname,settings);
  win.window.focus();
}