﻿
function subscribe() {
    dest = 'https://service.govdelivery.com/service/multi_subscribe.html?code=USMHSDHFRL';
    dest = dest + '&login=' + document.govDelivery.emailText.value + '&origin=' + window.location.href;
    window.open(dest, "GovDelivery");
}

function SubmitSearch() {

    document.submit();
}

function externalCheck(site) {
    var msg = "The appearance of external hyperlinks (" + site + ") does not constitute endorsement by the United States Department of Defense of the linked web sites, or the information, products or services contained therein. For other than authorized activities such as military exchanges and Morale, Welfare and Recreation (MWR) sites, the United States Department of Defense does not exercise any editorial control over the information you may find at these locations. Such links are provided consistent with the stated purpose of this DoD Web site."

    alert(msg);
}

function popupFutureProduct() {
    alert("This product will be available at a future date");
    return false;
}

function submitform() {
    if (validate())
        document.feedback.submit();

    return false;
}

function validate() {
    var form = document.feedback;
    if (isNaN(form.age.value)) {
        alert("Age must be numeric");
        return false;
    }
    else if (form.address.value.length > 200) {
        alert("The address text field cannot be any more than 200 characters.")
        return false;
    }
    else if (form.newTopics.value.length > 200) {
        alert("The 'Suggest New Topics' text field cannot be any more than 200 characters.")
        return false;
    }
    else if (form.Q_comments.value.length > 200) {
        alert("The comments text field cannot be any more than 200 characters.")
        return false;
    }

    return true;
}

