function f_AbreJanela( cURL, cNomeJanela )
{
  if ( window.screen.width == 800 )
  {
    var windowW = 778;
    var windowH = 537;
    var windowX = Math.ceil( (window.screen.width  - windowW) / 2 );
    var windowY = Math.ceil( (window.screen.height - windowH) / 2 );
  }
  else if (window.screen.width == 1024)
  {
    var windowW = 1002;
    var windowH = 746;
    var windowX = Math.ceil( (window.screen.width  - windowW) / 2 );
    var windowY = Math.ceil( (window.screen.height - windowH) / 2 );
  }
  else
  {
    var windowW = 618;
    var windowH = 700;
    var windowX = Math.ceil( (window.screen.width  - windowW) / 2 );
    var windowY = Math.ceil( (window.screen.height - windowH) / 2 );
  }  

  if ( navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion)>=4 )
  { isie=true; }
  else      
  { isie=false;}
  
  if (isie) 
  { 
  	H=windowH+22+10+2; 
    W=windowW+10+10+2; 
  }

  s = ",width="+W+",height="+H;

  if (isie && (navigator.userAgent.toLowerCase().indexOf("win")!=-1) )
  {

    var dowin = cURL != "" ? true : false;
    var splashWin = window.open( "", cNomeJanela, "width=0 height=0 fullscreen=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1"+s);

    var nWidth=screen.availWidth; 
    nHeight=screen.availHeight;
    splashWin.document.open();
    splashWin.document.location.href=cURL;
    splashWin.document.close();
    splashWin.resizeTo( nWidth, nHeight );
    splashWin.moveTo  ( 0,0);

  }
  splashWin.focus();
}

/* ---------------------------------------------------------------------------------
   Nome da Função      : Abre SubJanelas 
   Analista            : Ed Carlos F Santos
   Data                : 06-05-2005   Utilidade           : 
   Exemplo             : f_AbreJanela(600,450,cCaminho,'154_preferencias','no'); ou 
                         f_AbreJanela(600,450,cCaminho,'154_preferencias'); // omitindo o ultimo
                                                                            // parametro
   Data Ult. Alteração : 
   Alterações          :
   ---------------------------------------------------------------------------------- */
function f_AbreSubJanela(nWidth,nHeight,cCaminho,cNome,cRolagem,cResizable,cMenu,cStatus)
{ 
 // padrao para scroll
 var cScroll = "yes";
 var cResize = "no";
 var cMenuBar = "no";
 
 if( typeof cRolagem != "undefined" )
 { var cScroll=cRolagem; }
  
 if( typeof cResizable != "undefined" )
 { var cResize=cResizable; } 
 
 if( typeof cMenu != "undefined" )
 { var cMenuBar=cMenu; }
 
 if( typeof cStatus != "undefined" )
 { var cStatusBar=cStatus; } 
 
 if((window.screen.width == '800'))
 {
	 nPosH = ( 800 - nWidth )/2;
	 nPosV = ( 600 - nHeight )/2;	  
 }
 else if((window.screen.width == '640'))
 {
	 nPosH = ( 640 - nWidth )/2;
   nPosV = ( 480 - nHeight )/2;	
 }
 else if((window.screen.width == '1024'))
 {
	 nPosH = ( 1024 - nWidth )/2;
   nPosV = ( 768 - nHeight )/2;	
 }
 else 
 {
	 nPosH = ( 1280 - nWidth )/2;
   nPosV = ( 1024 - nHeight )/2;	
 }

 oJan = window.open(cCaminho,cNome,'width='+nWidth+',height='+nHeight+',menubar='+cMenuBar+',toolbar=no,location=no,status='+cStatusBar+',resizable='+cResize+',scrollbars='+cScroll+' ' );
 
 if( (oJan == null)||(oJan == "") )  
 { 
   alert(cMsg); 
   return;
 }
 
 oJan.moveTo( nPosH,nPosV-20 );
 oJan.focus();
 

}
