﻿// If Path is Localhost or RenovateAmerica - add nothing else Add Version
var Domain = document.location.host
if (Domain.match("192.168.1.13:81") || Domain.match("192.168.1.13:85")) {
    URL_PATH = "/HEROWebApp"; 
}
else{
    URL_PATH = "";
}
//else {
//    URL_PATH = "/HEROV1.1/HEROWebApp";
//}

$(document).ready(function () {

    $(".ContactPopupShowOnClick").click(function (e) {
        e.preventDefault();
        $.get(URL_PATH + "/Content/Static/ContactUsPopupContent.htm", function (data) {
            $.fn.colorbox({ overlayClose: true, width: 598, height: 520, close: "", title: "", html: data });
        });
    });


    $("#LearnMore").tooltip({
        delay: 0,
        showURL: false,
        fade: 300,
        bodyHandler: function () {
            var title = "<div class='tooltip_title'>Learn More</div>";
            var content = "<div class='tooltip_content'>" +
                       "Any information you provide will remain safe, secure and confidential. Review our " +
                       "privacy policy at the bottom of the page to learn how we protect your personal information. " +
                       "</div>";
            return title + content;
        }
    });

    $().ready(function () {
        $.ajaxSetup({
            timeout: (1000 * 120),
            error: function (x, e) {
                alert("You have encountered a server error, Please Contact Us - (877) 747-4889");
            }
        });
    });
});


; (function ($) {

    $.AutoTab = function (id, ids, keycounts) {
        var pastCurrentFlag = false;
        for (var i = 0; i < ids.length - 1; i++) {

            pastCurrentFlag = ids[i] == id ? true : false;

            if (pastCurrentFlag && (keycounts[i] == $("#" + id).val().length)) {
                $("#" + ids[i + 1]).focus();
                return this;
            }
        }

        return this;
    };
})(jQuery);

