function lf_open_popup( as_url, ai_width, ai_height, as_ComplWindowFeatures )
{

IE = (document.all) ? true : false;

li_tilt_up =( IE ? 40 : 20 ) 

/* para ai_width=0 ou nulo e ai_height=0 ou nulo "seta" o tamanho 
para o maior possível da resolução */

ai_width =  ( (ai_width  == null)||(ai_width  == 0) ? screen.width - screen.width * 0.1 : ai_width )
ai_height = ( (ai_height == null)||(ai_height == 0) ? screen.height - screen.height * 0.2 : ai_height )

/* FIM - para ai_width=0 ou nulo e ai_height=0 ou nulo seta o tamanho 
para o maior possível da resolução */

var li_LeftPos = (screen.availWidth) ? (screen.availWidth-ai_width)/2 : 0;  
var li_TopPos  = (screen.availHeight) ? (screen.availHeight-ai_height)/2-li_tilt_up : 0;

var as_DefaultWindowFeatures = 'width='+ai_width+',height='+ai_height+',top='+li_TopPos+',left='+li_LeftPos+',scrollbars=no,resizable=yes,dependent=no'

// assume defaults de "Window Features"

as_ComplWindowFeatures = ( ( as_ComplWindowFeatures == null ) ? '' : as_ComplWindowFeatures.toLowerCase() )

if ( (','+as_ComplWindowFeatures+',').search( ',status='  ) == -1 ) { as_DefaultWindowFeatures += ',status=yes'  }
if ( (','+as_ComplWindowFeatures+',').search( ',toolbar=' ) == -1 ) { as_DefaultWindowFeatures += ',toolbar=no'  }
if ( (','+as_ComplWindowFeatures+',').search( ',menubar=' ) == -1 ) { as_DefaultWindowFeatures += ',menubar=yes' }

as_DefaultWindowFeatures += ','+as_ComplWindowFeatures

var lw_handle_popup = open( as_url, 'Popup', as_DefaultWindowFeatures )

lw_handle_popup.focus()

}



