﻿
/* jQuery Document READY */
$(document).ready(function() {
    $("#DISPLAY_ENTER_HOST").html(relay_host_val);
    $("#SUBMIT_RELAY").click(function() {
        $("#SUBMIT_RELAY").attr('disabled', true);
        sendFormProcess();
    });

    $(document).keypress(function(e) {
        if (e.which == 13) {
            if (sendFormProcess()) {
                $("#INPUT_RELAY_URI").val("");
                $("#INPUT_RELAY_URI").focus();
            }
        }
    });
});

function sendFormProcess() {
    if ($.trim($("#INPUT_RELAY_URI").val()) == "") {
        alert(ERROR_MSG_1);
        $("#INPUT_RELAY_URI").focus();
        $("#SUBMIT_RELAY").attr('disabled', false);
        return;
    }
    sendForm();
}


function sendForm() {
    $("#hid_relay_uri").val($("#INPUT_RELAY_URI").val());

    ClickSubmitBtn();
}