Cufon.replace('h1, #additional .tabs h3',{
  fontFamily: 'ArnoPro',
  textShadow: '#000 1px 1px',
  color: '-linear-gradient(#fff, 0.4=#95d9ea, #95d9ea)'
});
Cufon.replace('#additional .tabs h3',{
  fontFamily: 'ArnoPro',
  textShadow: '#000 1px 1px'
});
Cufon.replace('#banner .nav a, .student-work h2, .tabs h2, .sidebar .ancestor-title, .sidebar .widgettitle, #interior .nav h2, #interior .twitter h3, #interior .photo-bar .title, .album h3, .alumni h2',{
  fontFamily: 'DIN'
})

jQuery(function($){
  $('#close-banner').click(function(){
    $('#banner').slideUp();
  })
  
  $('.tab').prev().click(function(){
    $('.tab').css('display','none').removeClass('active').prev().removeClass('active');
    $('.tabs h2').each(function(){
      $(this).html($(this).text());
    })
    $(this).next().css('display','block').addClass('active').prev().addClass('active');
    Cufon.replace('.tabs h2');
  })
  
  $('#videos').cycle({
    fx: 'cover',
    timeout: 0,
    prev: '#prev',
    next: '#next'
  });
  
  $('#interior .image .images').cycle({
    fx: 'cover',
    timeout: 5000,
    prev: '#prev',
    next: '#next'
  });
  
  $('form.search input[type=text]').defaultvalue('search the site');
  $('#footer form').ajaxForm({
    success: function(data) {
      $('#footer form input[type=text], #footer form textarea').removeClass('error');
      if ( data.redirect ) {
        window.location = data.redirect;
      }
    },
    error: function(obj) {
      $('#footer form input[type=text], #footer form textarea').removeClass('error');
      data = jQuery.parseJSON(obj.responseText);
      $.each(data.fields,function(){
        $('#footer form *[name=' + this + ']').addClass('error');
      })
    }
  });
  
  $('.main form.contact').ajaxForm({
    dataType: 'json',
    success: function(data) {
      $('.main form.contact input[type=text], #footer form textarea').removeClass('error');
      if ( data.redirect ) {
        window.location = data.redirect;
      }
    },
    error: function(obj) {
      $('.main form.contact input[type=text], #footer form textarea').removeClass('error');
      data = jQuery.parseJSON(obj.responseText);
      $.each(data.fields,function(){
        $('.main form.contact *[name=' + this + ']').addClass('error');
      })
    }
  });
  
  $.get('/_/background.php',{ js: true}, function(data) {
    $.each(data.paths,function(){
      var i = new Image();
      i.src = this;
    })
  } );
  
})