<?php 
function create_timmer( $timmer,
                       $timmer_Conf)
{
  global $modo_RAD, $_desenv_;

  if( $timmer_Conf['tab_index'] == 'auto' )
  {
    $tab_index = '';
  }else
  {
    $tab_index = $timmer_Conf['tab_index'];
  }//End if( $timmer_Conf['tab_index'] == 'auto' )
  
if ($modo_RAD)
{
  writeTO( '  <img id="' . $timmer . '_Icone" src="imagens/timer.gif" />' );
} else 
{
  echo('timmer');
	writeTO( "<script language='javascript'> </script>" ) ; 
}  

  
  create_afterLoad_timmer( $timmer );
 
}// End create_timmer()
   

/**
 *
 */
function create_timmer_css( $timmer,
                           $timmer_Global,
                           $timmer_Style,
			     	       $timmer_Conf)
{
  global $projeto, 
  		 $esquema;
  
 
  
    
  writeTO('  #' . $timmer . '{'                                       );
  writeTO('    position:absolute;'                                      );
  writeTO('    top:' . $timmer_Global['top'] . 'px;'                  );
  writeTO('    left:' . $timmer_Global['left'] .'px;'                 );
  writeTO('    '                                                        );    
  writeTO('    z-index:10;'                                             );
  writeTO('    '                                                        );    
  writeTO('    width:'.$timmer_Global['width'].'px;' );
  writeTO('    height:'.$timmer_Global['height'].'px;' );
  writeTO('    visibility: inherit ;'                                   );
  writeTO('  }'                                                         );
  writeTO('  '                                                          );

  writeTO( '  }'                                                         );
  
  writeTO('  #' . $timmer . '_Icone{'                                 );
  writeTO('    position:absolute;'                                      );
  writeTO('    top: 0px;'                               );
  writeTO('    left: 0px;'                 );
  writeTO('    '                                                          );    
  writeTO('    z-index:10;'                                             );
   writeTO('    width:24px;' );
  writeTO('    height:22px;' );
  writeTO('    visibility: inherit ;'                                   );
  writeTO('  }'                                                         );
  writeTO('  '                                                          );

  
}// End create_timmer() 


function create_timmer_control( $modo_RAD )
{
  global $componentes_no_Prj,
  		 $projeto,
		 $esquema;

  
  $path  = ( $modo_RAD )? _CFG_ : _CFG_;
  
  $nDest = $path . "timmer.control.js.php";
  $comp  = $componentes_no_Prj;

  $fp = @fopen( $nDest, 'wb' );
  foreach( $comp as $comp_ => $obj_ )
  {
    if( $comp_ == 'timmer' )
    {
      $nrObj  = 0;
      $arrObj = array();
      $arrConf= array();
      foreach( $obj_ as $i_ => $v_ )
      {
        $arrObj[ $nrObj ] = $i_;
        include($path . $i_ . ".config.def.php");
        $nConf = $i_ ."_Conf";
        $arrConf[$i_] = $$nConf;
		$nrObj ++;
      }// end foreach()
      writeTO( "timmer_obj      = ". $nrObj .";", $fp );
      $idx = 0;
      foreach($arrConf as $key => $value){
	  	writeTO('timmer_interval['.$idx.'] = '.$value['interval'].';', $fp);  
	  }
      

    }// End if()
  }// End foreach()
  fclose( $fp );
  
  return( $nDest );    
}// End function()

function create_afterLoad_timmer( $nObj )
{
  $nFile = _INC_  . $nObj . "_afterLoad.js.php";

  if( !file_exists( $nFile ) )
  {
    $_fp_ = @fopen( $nFile, 'wb');
    @fwrite($_fp_, '<script language="javascript">' . NEWLINE );
    @fwrite($_fp_, '  '                             . NEWLINE );
    @fwrite($_fp_, '</script>'                      . NEWLINE );
    @fclose( $_fp_ );
  }// End if( !file_exists( $nFile ) )
}// End function create_timmer_control( $modo_RAD )

?> 
