!function(t) {
"use strict";
t.GeneralWidget = function() {
var t, n = this;
n.init = function(n) {
t = n.partnerWidgetService;
}, n.bindButtonEvent = function(n) {
n.on("click", function(i) {
i.preventDefault(), t.partnerLinkClicked(this.getAttribute("href")), enableCssButtonObject(n);
});
}, n.bindLinkEvent = function(n) {
n.on("click", function(n) {
n.preventDefault(), t.partnerLinkClicked(this.getAttribute("href"));
});
}, n.bindFormSubmitEvent = function(n) {
n.on("submit", function(i) {
i.preventDefault(), t.submitFormDataWithTracking(n);
});
};
};
}(window.partnerWidget = window.partnerWidget || {});
!function(i) {
"use strict";
i.PartnerWidgetService = function() {
var i, n, t, a;
this.init = function(r) {
i = r.trackingLink, n = r.trackingMacroParams, t = r.landingPageTakeover, a = r.lastNamesPartnersUrl;
}, this.partnerLinkClicked = function(r) {
t && (r = t), a && (r = a), r += r.indexOf("?") > -1 ? "&" :"?", r += n, r = i + "?" + r, 
window.open(r, "_top", !0);
}, this.submitFormDataWithTracking = function(t) {
var a = t.attr("action") || "", r = window.location.origin + a;
r += r.indexOf("?") > -1 ? n :"?" + n, t.serializeArray().forEach(function(i) {
r += "&" + i.name + "=" + i.value;
}), r = i + "?" + r, window.open(r);
};
};
}(window.partnerWidget = window.partnerWidget || {});
"undefined" != typeof jQuery && !function() {
"use strict";
var e = window.partnerWidget, t = new e.PartnerWidgetService();
t.init({
trackingLink:PartnerWidgetData.trackingLink,
trackingMacroParams:PartnerWidgetData.trackingMacroParams,
lastNamesPartnersUrl:PartnerWidgetData.lastNamesPartnersUrl,
landingPageTakeover:PartnerWidgetData.landingPageTakeover
});
var r = new e.GeneralWidget();
switch (r.init({
partnerWidgetService:t
}), PartnerWidgetData.widget) {
case PartnerWidgetData.WIDGET_RECORDS:
r.bindButtonEvent(jQuery("#show_all_records")), r.bindButtonEvent(jQuery("#show_all_records_tiny")), 
r.bindLinkEvent(jQuery(".widget_record_result"));
break;

case PartnerWidgetData.WIDGET_MINIMAL:
r.bindButtonEvent(jQuery("#view_all_records")), r.bindButtonEvent(jQuery("#view_all_records_tiny")), 
r.bindLinkEvent(jQuery(".link_result"));
break;

case PartnerWidgetData.WIDGET_MIXED:
r.bindButtonEvent(jQuery("#start_your_family_tree")), r.bindButtonEvent(jQuery("#show_all_records")), 
r.bindLinkEvent(jQuery(".widget_record_result"));
break;

case PartnerWidgetData.WIDGET_RECORDS_CAROUSEL:
r.bindLinkEvent(jQuery(".collection_links")), r.bindFormSubmitEvent(jQuery(".search_form"));
break;

default:
r.bindButtonEvent(jQuery("#start_your_family_tree")), r.bindButtonEvent(jQuery("#start_your_family_tree_tiny"));
}
}();
