$(document).ready(function(){
    $('.dropdownBoxSmall a.button').click(function(e){
        e.preventDefault();
        
        var divId = $(this).attr("rel");
        
        $('.dropdownBoxSmall ul#dropdown'+divId).slideToggle(200);
        $('.dropdownBoxSmall a#button'+divId).toggleClass('open');
    });
    
    $('#dropdownBoxFull a#button').click(function(e){
        e.preventDefault();
        
        $('#dropdownBoxFull ul#dropdown').slideToggle(200);
        $('#dropdownBoxFull a#button').toggleClass('open');
    });
    
    $('.rightLift h2 a').click(function(e){
        e.preventDefault();
        
        var divId = $(this).attr("rel");
        
        if($('.rightLift p.ingress'+divId).is(':visible')){
          $('.rightLift p.ingress'+divId).slideToggle(150,function(e){
            $('.rightLift div.content'+divId).slideToggle(300);
            $('.rightLift h2.header'+divId+' a').toggleClass('open');
          });
        } else {
          $('.rightLift div.content'+divId).slideToggle(300,function(e){
            $('.rightLift p.ingress'+divId).slideToggle(150);
            $('.rightLift h2.header'+divId+' a').toggleClass('open');
          });
        }
    });
    
    $('#orderMailForm #email').focus(function () {
      if($('#orderMailForm #fieldTargeted').val() == 0){
        $(this).val('');
      }
      $('#orderMailForm #fieldTargeted').val('1');
    });
    $('#orderMailForm #email').blur(function () {
      if($('#orderMailForm #email').val() == ''){
        $(this).val($('#orderMailForm #fieldOriginalText').val()); 
        $('#orderMailForm #fieldTargeted').val('0');
      }
    });
    
    $('#thumbArea a.thumbFull, #thumbAreaBottom a.thumbFull').lightBox();
    
    $('a.mainImage').click(function(e){
      e.preventDefault();
      $.scrollTo( $("a[name='contentArea']").next(), 500 );
    });
});