var testresults
function checkemail(){
var str=document.validation.emailcheck.value
var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
if (filter.test(str)){
if( check_for_dups()==false ) {
return false;
}
return appendOptionLast(document.validation.emailcheck.value)
testresults=true
}else{
alert("Please input a valid email address!")
testresults=false
}
return (testresults)
}
function checkbae(){
if (document.layers||document.getElementById||document.all)
return checkemail()
else
return true
}
function appendOptionLast(Email)
{
var elOptNew = document.createElement('option');
elOptNew.text = Email;
elOptNew.value = Email;
var elSel = document.getElementById('selectEmail');
try {
elSel.add(elOptNew, null); // standards compliant; doesn't work in IE
}
catch(ex) {
elSel.add(elOptNew); // IE only
}
document.validation.emailcheck.value="";
}
function removeOptionSelected()
{
var elSel = document.getElementById('selectEmail');
var i;
for (i = elSel.length - 1; i>=0; i--) {
if (elSel.options.selected) {
elSel.remove(i);
}
}
}
function check_for_dups () {
var f_source = new Array ();
var f_check = document.validation.emailcheck.value;
var f_source = document.validation.OutboxMail;
for (i=0; i<f_source.length; ++i) {
if (f_source.value) {
if (f_check == f_source.value) {
f_source.focus();
alert ('You have a duplicate Email: \n' + f_source.value);
return false;
}
}
}
return true;
}
function check_for_null () {
var f_source = new Array ();
var f_source = document.validation.OutboxMail;