// abrir popup
function MM_openBrWindow(theURL,winName,features)
{	//v2.0
	win = window.open(theURL,winName,features);
	win.focus();
}

// popup com submit
function fSubmitPopup(theURL,winName,features)
{	
	window.open(theURL,winName,features);			
	document.frm_popup.submit();	
}

// popup centralizado
function fCenterPopup(theURL,winName,width,height,features)
{
	// resolucao da tela (x X y)
	var x  = screen.availWidth;
	var y  = screen.availHeight;
	
	// calcula posicao da janela para que fique centralizada
	var top = (y - height)/2;
	var left = (x - width)/2;	
	
	window.open(theURL,winName,"top=" + top + ",left=" + left + ",width=" + width + ",height=" + height + "," + features);
}
     