function tooglepetitredac(type, num)
{
  eval( "jQuery('#petitredactionnel"+type+" .petitredactionnelcontent').hide();" );
  eval( "jQuery('#petitredactionnel"+type+num+"').show();" );
}

function scrollGrilleLoad()
{
  jQuery( '#progtvgrille #grille' ).animate( { scrollTop: '790px' } );
}

function scrollGrille()
{ 
  newposx = ( jQuery( '#grilleaffichage' ).offset() ).left - ( jQuery( '#grille' ).offset() ).left;
  if ( newposx != posx )
  {
    uploadchaine( -newposx );
    posx = newposx;
  }
  jQuery( '#chaineaffichage' ).css( 'marginLeft', posx + 'px');
}

function affichecategorie( categorie )
{
  chainemax = chaineaffichee + 7;
  var jdeb = chaineaffichee == 1 ? 0 : chaineaffichee - 1;

  if( categorie == 0 && affichecourant != 0 )
  {
    for ( ind = 1 ; ind <= max ; ind++ ) 
    {
      if( ind != affichecourant )
      {
        for ( j = jdeb ; j < chainemax ; j++ )
        {
          eval( "jQuery('#chaine_"+j+" .cat"+ind+"').css( 'display', '' );" );
        }
      }
      // eval( "$('//div[@id=\"chaine_1\"]//div[@class^=\"cat\"]').css( 'display', '' );" );
    }
  }
  else if ( categorie != 0 && categorie != affichecourant )
  {
    if ( affichecourant != 0 )
    {
      for ( j = jdeb ; j < chainemax  ; j++ )
      {
        eval( "jQuery('#chaine_" + j + " .cat" + affichecourant + "').css( 'display' , 'none');" );
        eval( "jQuery('#chaine_" + j + " .cat" + categorie + "').css( 'display', '' );" );
      }
    }
    else
    {
      for ( ind = 1 ; ind <= max ; ind++ )
      {
        if( categorie != ind )
        {
          for ( j = jdeb ; j < chainemax  ; j++ )
          {
            eval("jQuery('#chaine_"+j+" .cat"+ind+"').css( 'display', 'none');");
          }
        }
      }
    }
  }

  affichecourant = categorie;
}
