// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

var file_count = 1;

function add_file_field() {
  var file = document.createElement('input');
  file.setAttribute('name','images[]');
  file.setAttribute('type','file');
  $('file_list').appendChild(file);
  file_count++;
  if (file_count >= 3) {
    $('add_file_link').hide();
  }
}

function check_terms_agreed() {
  if ($('terms_agreed').checked == true) {
    return true;
  } else {
    alert('You must agree to the terms and conditions before submitting.');
    return false;
  }
}