toolBar_mouseClick( objectID );
//alert('toolBar: '+objectID);
/**
 *  Funções do Usuário  ---------------------------------------------------  //
 */
if( objectID.indexOf('toolBar') != -1 )
{
  /*  barra de ferramentas 1
   *  -------------------------------------  //
   */
  toolBar1_mouseClick_button1( objectID );  /* Criar novo Projeto  */
  toolBar1_mouseClick_button2( objectID );  /*  Abrir um Projeto   */
  toolBar1_mouseClick_button3( objectID );  /* Salvar o Projeto    */

/**
 * paleta Auxiliar
 *  ------------------------------------------------------------------------  //
 */
  toolBar2_mouseClick_button4( objectID );

/**
 *  paleta Padrão
 *  ------------------------------------------------------------------------  //
 */
  toolBar3_mouseClick_button1( objectID );    /*                         */
  toolBar3_mouseClick_button3( objectID );    /*  Componente Label       */
  toolBar3_mouseClick_button4( objectID );    /*  Componente Edit        */
  toolBar3_mouseClick_button5( objectID );    /*  Componente ComboBox    */
  toolBar3_mouseClick_button6( objectID );    /*  Componente TextArea    */
//  toolBar3_mouseClick_button7( objectID );  /*  Componente MainMenu    */
  toolBar3_mouseClick_button8( objectID );    /*  Componente Button      */
  toolBar3_mouseClick_button9( objectID );    /*  Componente CheckBox    */
  toolBar3_mouseClick_button10( objectID );   /*  Componente RadioButton */

/**
 *  paleta Adicional
 *  ------------------------------------------------------------------------  //
 */
  toolBar4_mouseClick_button1( objectID );
  toolBar4_mouseClick_button2( objectID );  /*  Componente tabControl  */
  toolBar4_mouseClick_button3( objectID );  /*  Componente fieldSet    */
  toolBar4_mouseClick_button4( objectID );  /*  Componente panel       */
  toolBar4_mouseClick_button5( objectID );  /*  Componente image       */

  /* paleta Sistema */
  toolBar5_mouseClick_button1( objectID );

  /* paleta dataAccess */
  toolBar6_mouseClick_button1( objectID );   /*  */
  toolBar6_mouseClick_button2( objectID );
  toolBar6_mouseClick_button3( objectID );
  toolBar6_mouseClick_button4( objectID );   /*  Componente DBGrid  */
  toolBar6_mouseClick_button9( objectID );   /*  Componente Table   */
  toolBar6_mouseClick_button10( objectID );  /*  Componente Query   */


  /* outras */
  toolBar7_mouseClick_button1( objectID );

  toolBar8_mouseClick_button1( objectID );
  toolBar8_mouseClick_button2( objectID );
}



/*
 *  Criar um novo Projeto na área de trabalho do Usuário
 *  -----------------------------------------------------------------------  //
 */
function toolBar1_mouseClick_button1( objID )
{
  if( objID.indexOf( 'toolBar1' ) != -1 &&
      objID.indexOf( 'button1' )  != -1     )
  {
    if( toolBar_status[ 0 ][ 0 ] >= 1 )
    {
      Mensage.novoPrj( loginUSER );
    }// End if()
    //alert(objectID );
  }
}// End function

/*
 *  Abrir um novo Projeto.
 *  (copiar da área de projetos para a área de trabalho do usuário)
 *  -----------------------------------------------------------------------  //
 */
function toolBar1_mouseClick_button2( objID )
{
  if( objID.indexOf( 'toolBar1' ) != -1 &&
      objID.indexOf( 'button2' )  != -1     )
  {
    var nrToolBar = getToolBar( objID );
    var nrButton  = getButton(  objID );

    if( toolBar_status[ nrToolBar -1 ][ nrButton -1 ] >= 1 )
    {
      if ( flagEdit_ )
      {
        alert('projeto modificado...');
      }else
      {
        Mensage.getProjetos( 'desenv/projetos/' );
        setWinPage_selected( 4 );
      }//End if()
    }// End if()
  }
}// End toolBar1_mouseClick_button2( objID )


/*
 *  Salvar o projeto aberto.
 *  (atualizar os arquivos na área de projetos com os aquivos da
 *   área de trabalho do usuário).
 *  -----------------------------------------------------------------------  //
 */
function toolBar1_mouseClick_button3( objID )
{
  if( objID.indexOf( 'toolBar1' ) != -1 &&
      objID.indexOf( 'button3' )  != -1     )
  {
    var nrToolBar = getToolBar( objID );
    var nrButton  = getButton(  objID );
    
    if( toolBar_status[ nrToolBar -1 ][ nrButton -1 ] >= 1 )
    {
      if ( nProjeto_ == 'novo' )
      {
        Mensage.salvarPrj( loginUSER + ':' + nProjeto_ );
      }else
      {
        Mensage.salvarPrj( loginUSER + ':' + nProjeto_ );
      }// End if()
      //alert(objectID );
    }// End if()
  }
}// End function


function toolBar2_mouseClick_button4( objID )
{
  if( objID.indexOf( 'toolBar2' ) != -1 &&
      objID.indexOf( 'button4' )  != -1     )
  {
    dataAccess.teste1('test1...');
    //dataAccess.teste2('testando2...');
    
    //alert('teste: ok');
  }
}// End function()


function toolBar3_mouseClick_button1( objID )
{
  if( objID.indexOf( 'toolBar3' ) != -1 &&
      objID.indexOf( 'button1' )  != -1     )
  {
    var nrToolBar = getToolBar( objID );
    var nrButton  = getButton(  objID );

    if( toolBar_status[ nrToolBar -1 ][ nrButton -1 ] >= 1 )
    {
      // alert(objectID );
    }// End if()
  }
}// End function


/**
 *  tooBar3_mouseClick_button3()
 *  ------------------------------------------------------------------------  //
 */
function toolBar3_mouseClick_button3( objID )
{
  if( objID.indexOf( 'toolBar3' ) != -1 &&
      objID.indexOf( 'button3' )  != -1     )
  {
  //alert('1');
    var nrToolBar = getToolBar( objID );
    var nrButton  = getButton(  objID );

    if( toolBar_status[ nrToolBar -1 ][ nrButton -1 ] >= 1 )
    {
      if ( objSELECTED == '' )
      {
        var nObjSelect = 'page1';
      }else
      {
        var nObjSelect = objSELECTED;
      }
      //cmd = "addObj:label:padrao:" + nObjSelect + ":" + nProjeto_ + ":" + loginUSER ;
      cmd = "addObj:label:padrao:" + objSELECTED + ":" + nProjeto_ + ":" + loginUSER ;

      //alert( cmd );
      Mensage.exeCMD( cmd );
    }// End if()
  }
}// End function  

function toolBar3_mouseClick_button4( objID )
{
  if( objID.indexOf( 'toolBar3' ) != -1 &&
      objID.indexOf( 'button4' )  != -1     )
  {
    var nrToolBar = getToolBar( objID );
    var nrButton  = getButton(  objID );

    if( toolBar_status[ nrToolBar -1 ][ nrButton -1 ] >= 1 )
    {
      if ( objSELECTED == '' )
      {
        var nObjSelect = 'page1';
      }else
      {
        var nObjSelect = objSELECTED;
      }
      cmd = "addObj:edit:padrao:" + nObjSelect + ":" + nProjeto_ + ":" + loginUSER ;

      Mensage.exeCMD( cmd );
    }// End if()
  }// End if()
}//End function()

function toolBar3_mouseClick_button5( objID )
{
  if( objID.indexOf( 'toolBar3' ) != -1 &&
      objID.indexOf( 'button5' )  != -1     )
  {
    var nrToolBar = getToolBar( objID );
    var nrButton  = getButton(  objID );

    if( toolBar_status[ nrToolBar -1 ][ nrButton -1 ] >= 1 )
    {
      if ( objSELECTED == '' )
      {
        var nObjSelect = 'page1';
      }else
      {
        var nObjSelect = objSELECTED;
      }
      cmd = "addObj:comboBox:padrao:" + nObjSelect + ":" + nProjeto_ + ":" + loginUSER ;

      Mensage.exeCMD( cmd );
    }// End if()

    //alert( 'comboBox' );
  }// End if()
}//End function()


/**
 *  Paleta Padrão
 *  Componente TextArea
 */
function toolBar3_mouseClick_button6( objID )
{
  if( objID.indexOf( 'toolBar3' ) != -1 &&
      objID.indexOf( 'button6' )  != -1     )
  {
    var nrToolBar = getToolBar( objID );
    var nrButton  = getButton(  objID );

    if( toolBar_status[ nrToolBar -1 ][ nrButton -1 ] >= 1 )
    {
      if ( objSELECTED == '' )
      {
        var nObjSelect = 'page1';
      }else
      {
        var nObjSelect = objSELECTED;
      }
      cmd = "addObj:textArea:padrao:" + nObjSelect + ":" + nProjeto_ + ":" + loginUSER ;

      Mensage.exeCMD( cmd );
    }// End if()

    //alert( 'comboBox' );
  }// End if()
}//End function()


/**
 *  Paleta Padrão
 *  Componente Button
 */
function toolBar3_mouseClick_button8( objID )
{
  if( objID.indexOf( 'toolBar3' ) != -1 &&
      objID.indexOf( 'button8' )  != -1     )
  {
    var nrToolBar = getToolBar( objID );
    var nrButton  = getButton(  objID );

    if( toolBar_status[ nrToolBar -1 ][ nrButton -1 ] >= 1 )
    {
      if ( objSELECTED == '' )
      {
        var nObjSelect = 'page1';
      }else
      {
        var nObjSelect = objSELECTED;
      }
      cmd = "addObj:button:padrao:" + nObjSelect + ":" + nProjeto_ + ":" + loginUSER ;

      Mensage.exeCMD( cmd );
    }// End if()

    //alert( 'comboBox' );
  }// End if()
}//End function()


/**
 *  Paleta Padrão
 *  Componente CheckBox
 */
function toolBar3_mouseClick_button9( objID )
{
  if( objID.indexOf( 'toolBar3' ) != -1 &&
      objID.indexOf( 'button9' )  != -1     )
  {
    var nrToolBar = getToolBar( objID );
    var nrButton  = getButton(  objID );

    if( toolBar_status[ nrToolBar -1 ][ nrButton -1 ] >= 1 )
    {
      if ( objSELECTED == '' )
      {
        var nObjSelect = 'page1';
      }else
      {
        var nObjSelect = objSELECTED;
      }
      cmd = "addObj:checkBox:padrao:" + nObjSelect + ":" + nProjeto_ + ":" + loginUSER ;

      Mensage.exeCMD( cmd );
    }// End if()

    //alert( 'comboBox' );
  }// End if()
}//End function()




/**
 *  Paleta Padrão
 *  Componente RadioButton
 */
function toolBar3_mouseClick_button10( objID )
{
  if( objID.indexOf( 'toolBar3' ) != -1 &&
      objID.indexOf( 'button10' )  != -1     )
  {
    var nrToolBar = getToolBar( objID );
    var nrButton  = getButton(  objID );

    if( toolBar_status[ nrToolBar -1 ][ nrButton -1 ] >= 1 )
    {
      if ( objSELECTED == '' )
      {
        var nObjSelect = 'page1';
      }else
      {
        var nObjSelect = objSELECTED;
      }
      cmd = "addObj:radioButton:padrao:" + nObjSelect + ":" + nProjeto_ + ":" + loginUSER ;

      Mensage.exeCMD( cmd );
    }// End if()

    //alert( 'comboBox' );
  }// End if()
}//End function()



/**
 *  Paleta Adicional
 *  ------------------------------------------------------------------------- //
 */

/**
 *  Select
 */
function toolBar4_mouseClick_button1( objID )
{
  if( objID.indexOf( 'toolBar4' ) != -1 &&
      objID.indexOf( 'button1' )  != -1     )
  {
    var nrToolBar = getToolBar( objID );
    var nrButton  = getButton(  objID );

    if( toolBar_status[ nrToolBar -1 ][ nrButton -1 ] >= 1 )
    {
      //alert( '4: '+objectID );
    }// End if()
  }
}// End function

/**
 *  Componente TabControl  -------------------------------------------------  //
 */
function toolBar4_mouseClick_button2( objID )
{
  if( objID.indexOf( 'toolBar4' ) != -1 &&
      objID.indexOf( 'button2' )  != -1     )
  {
    var nrToolBar = getToolBar( objID );
    var nrButton  = getButton(  objID );

    if( toolBar_status[ nrToolBar -1 ][ nrButton -1 ] >= 1 )
    {
      if ( objSELECTED == '' )
      {
        var nObjSelect = 'page1';
      }else
      {
        var nObjSelect = objSELECTED;
      }// End if ( objSELECTED == '' )

      cmd = "addObj:tabControl:adicional:" + nObjSelect + ":" + nProjeto_ + ":" + loginUSER ;

      Mensage.exeCMD( cmd );
    }// End if()
  }
}// End function


/**
 *  Componente fieldSet  ---------------------------------------------------  //
 */
function toolBar4_mouseClick_button3( objID )
{
  if( objID.indexOf( 'toolBar4' ) != -1 &&
      objID.indexOf( 'button3' )  != -1     )
  {
    var nrToolBar = getToolBar( objID );
    var nrButton  = getButton(  objID );

    if( toolBar_status[ nrToolBar -1 ][ nrButton -1 ] >= 1 )
    {
      if ( objSELECTED == '' )
      {
        var nObjSelect = 'page1';
      }else
      {
        var nObjSelect = objSELECTED;
      }// End if ( objSELECTED == '' )
      
//      cmd = "addObj:fieldSet:adicional:" + nObjSelect + ":" + nProjeto_ + ":" + loginUSER ;
//      Mensage.exeCMD( cmd );
    }// End if()
  }
}// End function

/**
 * Componente Panel  -------------------------------------------------------  //
 */
function toolBar4_mouseClick_button4( objID )
{
  if( objID.indexOf( 'toolBar4' ) != -1 &&
      objID.indexOf( 'button4' )  != -1     )
  {
    var nrToolBar = getToolBar( objID );
    var nrButton  = getButton(  objID );

    if( toolBar_status[ nrToolBar -1 ][ nrButton -1 ] >= 1 )
    {
      if ( objSELECTED == '' )
      {
        var nObjSelect = 'page1';
      }else
      {
        var nObjSelect = objSELECTED;
      }// End if ( objSELECTED == '' )

      cmd = "addObj:panel:adicional:" + nObjSelect + ":" + nProjeto_ + ":" + loginUSER ;

      Mensage.exeCMD( cmd );
    }// End if( toolBar_status[ nrToolBar -1 ][ nrButton -1 ] >= 1 )
  }// End if()
}// End function

/**
 * Componente Image  -------------------------------------------------------  //
 */
function toolBar4_mouseClick_button5( objID )
{
  if( objID.indexOf( 'toolBar4' ) != -1 &&
      objID.indexOf( 'button5' )  != -1     )
  {
    var nrToolBar = getToolBar( objID );
    var nrButton  = getButton(  objID );

    if( toolBar_status[ nrToolBar -1 ][ nrButton -1 ] >= 1 )
    {
      if ( objSELECTED == '' )
      {
        var nObjSelect = 'page1';
      }else
      {
        var nObjSelect = objSELECTED;
      }// End if ( objSELECTED == '' )

      cmd = "addObj:image:adicional:" + nObjSelect + ":" + nProjeto_ + ":" + loginUSER ;

      Mensage.exeCMD( cmd );
    }// End if( toolBar_status[ nrToolBar -1 ][ nrButton -1 ] >= 1 )
  }// End if()
}// End function


/**
 *  Paleta Sistema
 *  ------------------------------------------------------------------------- //
 */
function toolBar5_mouseClick_button1( objID )
{
  if( objID.indexOf( 'toolBar5' ) != -1 &&
      objID.indexOf( 'button1' )  != -1     )
  {
    var nrToolBar = getToolBar( objID );
    var nrButton  = getButton(  objID );

    if( toolBar_status[ nrToolBar -1 ][ nrButton -1 ] >= 1 )
    {
      //alert( '5: '+objectID );
    }// End if()
  }
}// End function

function toolBar6_mouseClick_button1( objID )
{
  if( objID.indexOf( 'toolBar6' ) != -1 &&
      objID.indexOf( 'button1' )  != -1     )
  {
    var nrToolBar = getToolBar( objID );
    var nrButton  = getButton(  objID );

    if( toolBar_status[ nrToolBar -1 ][ nrButton -1 ] >= 1 )
    {
      //alert( '6: '+objectID );
    }// End if()
  }
}// End function

function toolBar6_mouseClick_button2( objID )
{
  if( objID.indexOf( 'toolBar6' ) != -1 &&
      objID.indexOf( 'button2' )  != -1     )
  {
    var nrToolBar = getToolBar( objID );
    var nrButton  = getButton(  objID );

    if( toolBar_status[ nrToolBar -1 ][ nrButton -1 ] >= 1 )
    {
      if ( objSELECTED == '' )
      {
        var nObjSelect = 'page1';
      }else
      {
        var nObjSelect = objSELECTED;
      }
      cmd = "addObj:dataSource:dataAccess:" + nObjSelect + ":" + nProjeto_ + ":" + loginUSER ;

      Mensage.exeCMD( cmd );
    }// End if()
  }
}// End function toolBar6_mouseClick_button2( objID )

function toolBar6_mouseClick_button3( objID )
{
  if( objID.indexOf( 'toolBar6' ) != -1 &&
      objID.indexOf( 'button3' )  != -1     )
  {
    var nrToolBar = getToolBar( objID );
    var nrButton  = getButton(  objID );
//alert('Button3');

    if( toolBar_status[ nrToolBar -1 ][ nrButton -1 ] >= 1 )
    {
      if ( objSELECTED == '' )
      {
        var nObjSelect = 'page1';
      }else
      {
        var nObjSelect = objSELECTED;
      }
      cmd = "addObj:dbEdit:dataAccess:" + nObjSelect + ":" + nProjeto_ + ":" + loginUSER ;
      Mensage.exeCMD( cmd );
    }// End if()
  }
}// End function toolBar6_mouseClick_button2( objID )

/**
 *  toolBar6_mouseClick_button4( objID )
 */
function toolBar6_mouseClick_button4( objID )
{
  if( objID.indexOf( 'toolBar6' ) != -1 &&
      objID.indexOf( 'button4' )  != -1     )
  {
    var nrToolBar = getToolBar( objID );
    var nrButton  = getButton(  objID );
//alert('Button4');

    if( toolBar_status[ nrToolBar -1 ][ nrButton -1 ] >= 1 )
    {
      if ( objSELECTED == '' )
      {
        var nObjSelect = 'page1';
      }else
      {
        var nObjSelect = objSELECTED;
      }
      cmd = "addObj:dbgrid:dataAccess:" + nObjSelect + ":" + nProjeto_ + ":" + loginUSER ;
      Mensage.exeCMD( cmd );
    }// End if()
  }
}// End function toolBar6_mouseClick_button4( objID )

/**
 *  toolBar6_mouseClick_button9( objID )
 */
function toolBar6_mouseClick_button9( objID )
{
  if( objID.indexOf( 'toolBar6' ) != -1 &&
      objID.indexOf( 'button9' )  != -1     )
  {
    var nrToolBar = getToolBar( objID );
    var nrButton  = getButton(  objID );
//alert('Button9');

    if( toolBar_status[ nrToolBar -1 ][ nrButton -1 ] >= 1 )
    {
      if ( objSELECTED == '' )
      {
        var nObjSelect = 'page1';
      }else
      {
        var nObjSelect = objSELECTED;
      }
      cmd = "addObj:table:dataAccess:" + nObjSelect + ":" + nProjeto_ + ":" + loginUSER ;
      Mensage.exeCMD( cmd );
    }// End if()
  }
}// End function toolBar6_mouseClick_button2( objID )

/**
 *  toolBar6_mouseClick_button10( objID )
 */
function toolBar6_mouseClick_button10( objID )
{
  if( objID.indexOf( 'toolBar6' ) != -1 &&
      objID.indexOf( 'button10' )  != -1     )
  {
    var nrToolBar = getToolBar( objID );
    var nrButton  = getButton(  objID );
alert('Button10');

    if( toolBar_status[ nrToolBar -1 ][ nrButton -1 ] >= 1 )
    {
      if ( objSELECTED == '' )
      {
        var nObjSelect = 'page1';
      }else
      {
        var nObjSelect = objSELECTED;
      }
      cmd = "addObj:query:dataAccess:" + nObjSelect + ":" + nProjeto_ + ":" + loginUSER ;
      //Mensage.exeCMD( cmd );
    }// End if()
  }
}// End function toolBar6_mouseClick_button2( objID )



function toolBar7_mouseClick_button1( objID )
{
  if( objID.indexOf( 'toolBar7' ) != -1 &&
      objID.indexOf( 'button1' )  != -1     )
  {
    if( toolBar_status[ 6 ][ 0 ] >= 1 )
    {
      setWinPage_selected( 3 );
      Mensage.get_ajuda( objSELECTED );
    }// End if()
  }
}// End function

function toolBar8_mouseClick_button1( objID )
{
  if( objID.indexOf( 'toolBar8' ) != -1 &&
      objID.indexOf( 'button1' )  != -1     )
  {
    if( toolBar_status[ 7 ][ 0 ] >= 1 )
    {
      //alert('gerar');
      Mensage.gerar( loginUSER + ':' +nProjeto_ );
    }// End if()
  }// End if()
}// End function()

function toolBar8_mouseClick_button2( objID )
{
  if( objID.indexOf( 'toolBar8' ) != -1 &&
      objID.indexOf( 'button2' )  != -1     )
  {
    if( toolBar_status[ 7 ][ 1 ] >= 1 )
    {
      var _path_ = 'desenv/usuarios/' + loginUSER + '/' + nProjeto_ + '.php';
      //alert('rodar: ' + _path_ );
      opener.top_location( _path_ );
      //parent.mainPage.test_parent( txt );
    }// End if()
  }// End if()
}// End function()

