
function checkEmail() {
  if (document.addphotos.email.value.indexOf('@') < 0) {
    if (document.addphotos.email.focus) {
      document.addphotos.email.focus();
    }
    document.addphotos.email.className = 'invalid';
    alert('Please, provide your email address.\nYour email address will never show up on NCVC web site.\nWe only will use it in order to contact you if we have questions regarding your submission.');
    return false;
  }
  return true;
}

ncvcNextPhoto = 6;
function doAddMorePhotos() {
    if (!document.getElementById && document.createElement) { return; }
    var marker = document.getElementById('morePhotosMarker');
    var newField = document.createElement("input");
    var name = String('file_' + ncvcNextPhoto);
    ncvcNextPhoto++;
    
    newField.name = name;
    newField.type = 'file';
    var tr = document.createElement('tr');
    var td = document.createElement('td');
    marker.parentNode.insertBefore(tr, marker);
    tr.appendChild(td);
    td.appendChild(newField);
}

function addMorePhotos() {
    for (i = 0; i < 5; i++) {
        doAddMorePhotos();
    }
}
