$(function() {
    
  /* Volunteers application form. */
  $("#application-form").validate({
    rules: {
      firstname: {
        required: true
      },
      lastname: {
        required: true
      },
      phone: {
        required: true
      },
      email: {
        required: true,
        email: true
      }
    }
  });
  
  $(".lang").css("cursor", "pointer");
  $(".lang").click(function() {
    $(this).parent().find(".lang").attr("src", "/img/star-off.png");
    var val = $(this).attr("alt");
    $(this).attr("src", "/img/star.png");
    $(this).prev().attr("src", "/img/star.png");
    $(this).prev().prev().attr("src", "/img/star.png");
    $(this).prev().prev().prev().attr("src", "/img/star.png");
    $(this).parent().find("input").val(val);
    return false;
  });
});

