function start_up() { sessionStorage.removeItem('rec_list'); sessionStorage.setItem('recipients',JSON.stringify(guys)); pop_guys(); document.getElementById('maxsizeblurb').textContent = document.getElementsByName('MAX_FILE_SIZE')[0].value / 1024 / 1024; console.log('start_up'); } function pop_guys() { sel=document.getElementById('recipients'); if (sel == null) { return(false); } guys = JSON.parse(sessionStorage.getItem('recipients')); sel.length = 0; var opt=document.createElement('option'); opt.text='- Select -'; opt.value=''; sel.add(opt); var opt=document.createElement('option'); opt.text='- Enter it in -'; opt.value='new'; sel.add(opt); var opt=document.createElement('option'); opt.text='- Edit your quick list -'; opt.value='edit'; sel.add(opt); if (guys == null) { return(false); } for (i=0; i'; xx = xx + ' '; xx = xx + 'Cc: (you!)
'; } else { xx = ''; } zz=dd.innerHTML; dd.innerHTML=zz+xx; } function del_rec(idnum) { nn = 'notify['+idnum+']'; xr = 'del_rec['+idnum+']'; dr = 'disp_rec['+idnum+']'; nne=document.getElementById(nn); nnev=nne.value; xre=document.getElementById(xr); dre=document.getElementById(dr); pp=nne.parentElement; pp.removeChild(nne); pp.removeChild(xre); pp.removeChild(dre); newguys = new Array(); guys = JSON.parse(sessionStorage.getItem('rec_list')); if (guys == null) { guys=new Array(); } ng=0; for (i=0;i'; xx = xx + ' X  '; xx = xx + 'To: '+guys[i]+'
'; } dd.innerHTML=xx; } function another_recipient() { z1=document.getElementById('pre_notify[0]'); z2=document.getElementById('pre_notify[1]'); if (z1.value != z2.value) { alert('The entries must match.'); return(false); } if (z1.value == '') { alert('You may not save empties.'); return(false); } guys = JSON.parse(sessionStorage.getItem('rec_list')); if (guys == null) { guys=new Array(); } guys.push(z1.value); guys.sort(); // REMOVE DUPES BY SOME RANDOM GENIUS ON THE INTERWEB guys = guys.filter (function (value, index, array) { return array.indexOf (value) == index; }); sessionStorage.setItem('rec_list',JSON.stringify(guys)); build_rec_list(guys); document.getElementById('enter_new_recipient').style.display='none'; document.getElementById('recipients').value=''; add_cc_me(); return(false); } function delete_this_guy_from_quick() { z1=document.getElementById('pre_notify[0]'); z2=document.getElementById('pre_notify[1]'); if (z1.value != z2.value) { alert('The entries must match before deleting.'); return(false); } if (z1.value == '') { alert('You may not save empties.'); return(false); } if (!confirm('Are you sure?')) { return(false); } guys = JSON.parse(sessionStorage.getItem('recipients')); if (guys == null) { return(false); } loc=guys.indexOf(z1.value); guys.splice(loc,1); guys = guys.filter (function (value, index, array) { return array.indexOf (value) == index; }); sessionStorage.setItem('recipients',JSON.stringify(guys)); pop_guys(); document.getElementById('enter_new_recipient').style.display='none'; document.getElementById('recipients').value=''; return(false); } function checkprenotify(num){ if (num == 0) { if (document.getElementById('pre_notify[0]').value =='Enter an email address') { document.getElementById('pre_notify[0]').value =''; } } if (num == 1) { if (document.getElementById('pre_notify[1]').value =='Enter twice to verify') { document.getElementById('pre_notify[1]').value =''; } } } function save_this_guy_to_quick() { z1=document.getElementById('pre_notify[0]'); z2=document.getElementById('pre_notify[1]'); if (z1.value != z2.value) { alert('The entries must match before saving.'); return(false);} if (z1.value == '') { alert('You may not save empties.'); return(false);} guys = JSON.parse(sessionStorage.getItem('recipients')); if (guys == null) { guys=new Array(); } guys.push(z1.value); guys.sort(); // REMOVE DUPES BY SOME RANDOM GENIUS ON THE INTERWEB guys = guys.filter (function (value, index, array) { return array.indexOf (value) == index; }); sessionStorage.setItem('recipients',JSON.stringify(guys)); pop_guys(); document.getElementById('enter_new_recipient').style.display='none'; document.getElementById('recipients').value=''; return(false); } function check_form_validity() { if (!check_valid_sender_emails()) { return(false); } if (!check_valid_files()) { return(false); } if (!check_valid_select_recipients()) { return(false); } if (!check_valid_note()) { return(false); } if (!check_subject()) { return(false); } if (!check_blank_recaptcha()) { return(false); } return(true); } function check_valid_sender_emails() { q=document.getElementById('email1'); r=document.getElementById('email2'); if (q.value == '' || r.value == '') { alert('You must enter your email twice to send.'); return(false); } if (q.value != r.value) { alert('Your two email entries do not match.'); return(false); } return(true); } function check_valid_files() { q=document.getElementById('userfile[]'); if (q.value == '') { alert('Choose at least one file, please.'); return(false); } if (q.files.length > 5) { alert('You cannot choose more than five files.'); return(false); } return(true); } function check_valid_select_recipients() { q=document.getElementById('notify[]'); if (q.selectedOptions.length == 0) { alert('Choose at least one recipient, please.'); return(false); } return (true); } function check_valid_select_recipients_xx() { q=document.getElementById('notify[]'); if (q.selectedOptions.length == 0) { alert('Choose at least one recipient, please.'); return(false); } return (true); }; function check_subject() { q=document.getElementById('subject'); if (q.value == 'Replace this subject.' ) { alert('Please replace the subject with something meaningful.'); return(false); } return(true); } function check_valid_note() { q=document.getElementById('note'); if (q.value == 'Replace this text with a note to your recipient about the file.' || q.value == '') { alert('Please replace the note with something meaningful.'); return(false); } var text=q.value; var reg=/^[a-zA-Z0-9\,\?\.\!\@\#\$\%\-\'\+\ ]*$/; if (!reg.test(text)) { alert("Only letters, numbers, comma, ? . ! @ # $ % - + allowed"); return(false); } return(true); } function check_blank_recaptcha() { q=document.getElementById('recaptcha_response_field'); if (q.value == '') { alert('Please fill in the anti-spam box.'); return(false); } return(true); } function checkauth() { alert('You must be logged in to your fnsheppard.com email account to send to free-text email addresses.'); return(false); }