$(document).ready(function() {
  $('#nav_container a').not('.selected').hoverImages();
});

jQuery.fn.hoverImages = function() {
  this.hover(function() {
    $(this).find('img').each(function() {
      this.src = this.src.replace('Off', 'On');
    });
    $(this).addClass('hover');
  }, function() {
    $(this).find('img').each(function() {
      this.src = this.src.replace('On', 'Off');
    });
    $(this).removeClass('hover');
  });
}



$(document).ready(function(){
 
$('form.check-required').submit(function() {
    ok = true;
 
    $(this).find('input.required[@value=""], textarea.required[@value=""]').each(function() {
      $(this).addClass('alert').change(function() {
        if(!$(this).is('[@value=""]')) {
          $(this).removeClass('alert');
        }
        else {
          $(this).addClass('alert');
        }
      }).keyup(function() {
        $(this).trigger('change');
      });
     
      ok = false;
    });    
 
    if(!ok) {
      $('p.red').slideDown('fast');
      return(false);
    }
 
    else {
      $('p.red').slideUp('fast');
    }
});
 
 
});


