$(document).ready(function(){
  $.swapImage(".swapImage"); 
  $('body').supersleight({shim: '/images/x.gif'});
  
  $('a[rel=image]').colorbox({
    transition: 'elastic',
    speed: 350,
    current: "{current} of {total} photos"
  });
  
  $('#contact input[type=text]').focus(function() {
    $(this).addClass('selected');
    if ($(this).val()==$(this)[0].defaultValue) {
      $(this).val('');
    }
    $(this).addClass('modified');
  });
  
  $('#contact input').blur(function() {
    $(this).removeClass('selected');
    if ($(this).val()=='') {
      $(this).val($(this)[0].defaultValue);
      $(this).removeClass('modified');
    }
  });
  
  $('#contactForm').submit(function() {
    var status=true;
    $('#contactForm input.required').each(function() {
      if ($(this).val()==$(this)[0].defaultValue || $(this).val()=='')  {
        $(this).addClass('error');
        $('#contact #status').addClass('error');
        $('#contact #status').text('*Please complete all required fields');
        status=false;
      } 
    });
    return status;
  });
});
