var testresults;
function validateEmail(str){
        var filter=/^(\w+(?:\.\w+)*)@((?:\w+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
        if (filter.test(str)){
                testresults=true;
        }
        else {
                alert("Please input a valid email address");
                testresults=false;
        }
        return (testresults);
}
function addAddress(Group_Range){
        var l = document.maillist_add.email.value;
        if ( l && Group_Range ) {
                var yea = validateEmail( l );
                if (yea){
                        document.location='/?action=d7_maillist_public_add_address&Address=' + l + '&Group_ID=' + Group_Range + '&Name=' + document.maillist_add.name.value+'&user_notify_from_address=';
                }
        }
}
function removeAddress(Group_Range) {
        var l = document.maillist_remove.email2.value;
        var yea = validateEmail( l );
        if ( yea ) {
                var t = confirm("Are you sure you want to remove the address: " + l + " from the Mail List?");
                if (t == true) {
                        document.location='/?action=d7_maillist_public_remove_address&Address=' + l + '&Group_ID=' + Group_Range;
                }
        }
}
