$(function(){

  $('.topMenuItem').mouseover( function() {
    $(this).children('p').css('color' , '#e50000');
    $(this).children('ul').show();
  });
  $('.topMenuItem').mouseout( function() {
    $(this).children('p').css('color','black');
    $(this).children('ul').hide();
  });
  
  $('.itemHeader').click( function() {
    
    if ( $( this ).next().css( 'display' ) == 'none' ) {  
      $('.itemContent').fadeOut();
      $('.itemHeader').css( 'borderBottom', '0');
      $('.itemHeader').css( 'color', 'rgb(0, 0, 0)');
      
      $(this).css('color', 'rgb(229, 0, 0)');
      
      $(this).next().fadeIn( function() {
        $( this ).prev().css( 'borderBottom', '1px #000 solid');
      });
    } else {
      $( this ).next().fadeOut();
      $( this ).css( 'borderBottom', '0');
      $( this ).css( 'color', 'rgb(0, 0, 0)');
    }
    
  });
  
  $('.sectionLink').click( function() {
    $('.section').hide();
    sectionId = $( this ).attr('rel');
    $('.section' + sectionId ).show();
    return false;
  })
  
  $('.modalLink').click( function() {
    modalId = $( this ).attr('rel');
    $('#full' + modalId ).show();
    return false;
  });
  
  $('.close').click( function() {
    $( this ).parents().find('.press_modal').fadeOut();
    return false;
  })
  
  $("a[rel='gallery']").colorbox();
});
