
$(document).ready(function(){
  var opened = false;
  $('#contact').click(function(){
    if($('#contactzone').is(":visible")){
      opened = false;
        
      $('#contactzone').removeClass('shadow');
      $('.drop_shadow_layer').remove();
      $('.shadow').dropshadow({
        shadowColor: '#000',
        shadowLayer: -1,
        shadowAlpha: 0.2,
        distanceX:'0px',
        distanceY:'5px',
        blur:'20'
      });
      
      $('#contactfleche').removeClass('contactopened');
      $('#contactzone').slideUp('normal', function() {
      });
    }else{
      opened = true;
      $('#contactfleche').addClass('contactopened');
      $('#contactzone').slideDown('normal', function() {
        if(opened){
        
          $('#contactzone').dropshadow({
            shadowColor: '#000',
            shadowLayer: -1,
            shadowAlpha: 0.2,
            distanceX:'0px',
            distanceY:'5px',
            blur:'20'
          });
          
        }
      });
    }
    return false;
  })

  $('.brandlistbutton').click(function(){
    $('#ourbrandsfleche').addClass('brandlistopened');
    if($('#brandlist ul').is(":visible")){
      $('#ourbrandsfleche').removeClass('brandlistopened');
    }
    $('#brandlist').slideToggle('normal', function() { });
    return false;
  })

  $('a .brandlogo').hover( function(){
    $(this).css('background-position', '0px 0px');
    var $clone = $(this).clone();
    $clone.css({'display':'none',
    'background-position':'0px 106px',
    'position':'absolute'}).appendTo(this);
    $clone.fadeIn('normal', function() {})
  }, function(){
    $('.brandlogo',this).fadeOut('normal', function() {
      $(this).parent().empty();
    })
  })

  $('#menu li,#brandlist li').hover(function(){

    if(!($(this).hasClass('selected')||$(this).hasClass('current'))){
      $(this).css('background-color', '#a9915d');
      $(this).stop(true,true);
      $(this).animate({'background-color':'#000'}, 250);
    }
  }, function(){
    if(!($(this).hasClass('selected')||$(this).hasClass('current'))){
      $(this).stop(true,true);
      $(this).animate({'background-color':'#a9915d'}, 250);
    }
  });
  
});


$(window).load(function(){
  
  $('.shadow').dropshadow({
    shadowColor: '#000',
    shadowLayer: -1,
    shadowAlpha: .2,
    distanceX:'0',
    distanceY:'5',
    blur:'20'
  });
  
});


$(window).resize(function(){
  
  $('.drop_shadow_layer').remove();
  $('.shadow').dropshadow({
    shadowColor: '#000',
    shadowLayer: -1,
    shadowAlpha: 0.2,
    distanceX:'0px',
    distanceY:'5px',
    blur:'20'
  });
  
});

