﻿function isNumeric(k) {
    if (k.keyCode >= 96 && k.keyCode <= 105)
        return true;
    if (k.keyCode >= 48 && k.keyCode <= 57)
        return true;
    if (k.keyCode == 116 || k.keyCode == 37 || k.keyCode == 39 || k.keyCode == 9 || k.keyCode == 8 || k.keyCode == 46 || k.keyCode == 13)
        return true;
    return false;
}

$(document).ready(function () {
    $('.onlyNumbers').keydown(isNumeric);
    $('.aqControl').focus(function () { $(this).removeClass('input-validation-error') });
});

function validateSearchTerms(postUrl, term, formId) {

    var params = {
        cityStateZip: term
    }
    $.ajax({
        type: "POST",
        url: postUrl,
        traditional: true,
        data: params,
        dataType: "json",
        success: function (result) {

            window.location = result.RedirectUrl;
        }
    });

    return false;
}
