if(typeof SSA==="undefined"||!SSA){var SSA={};
}if(typeof SSA.fn==="undefined"||!SSA.fn){SSA.fn={};
}(function(){SSA.fn.setup={username:{URL:"UsernameInUse"},pageTimeout:{duration:25,URL:"Controller",firstwarningmsg:"",secondwarningmsg:"",thirdwarningmsg:""},offhours:{userStyle:"",timeInterval:1,URL:"#"},accessKeys:{stylesheet:"ssa.fn.accesskeys.css",previewKey:"17"},pageID:"",addHTMLDataAttr:function(){var htmlEl=$("html");
if(htmlEl){SSA.fn.setup.pageID=htmlEl.attr("id");
if(htmlEl.attr("id")&&!htmlEl.attr("data-ssa-page-id")){htmlEl.attr("data-ssa-page-id",htmlEl.attr("id"));
}}},addMobileMenuAccessibility:function(){var _removeAccessibility=function(menuHideBtn,menuShowBtn){menuHideBtn.removeAttr("role");
menuShowBtn.removeAttr("role");
menuHideBtn.removeAttr("aria-label");
menuShowBtn.removeAttr("aria-label");
};
var _showMenuAccessibility=function(e){var menuHideBtn=$("#uef-tmpl-nav-hide-btn"),menuShowBtn=$("#uef-tmpl-nav-show-btn");
_removeAccessibility(menuHideBtn,menuShowBtn);
menuHideBtn.attr("aria-label","Menu, Open");
menuHideBtn.attr("role","alert");
};
var _hideMenuAccessibility=function(e){var menuHideBtn=$("#uef-tmpl-nav-hide-btn"),menuShowBtn=$("#uef-tmpl-nav-show-btn");
_removeAccessibility(menuHideBtn,menuShowBtn);
menuShowBtn.attr("aria-label","Menu, Closed");
menuShowBtn.attr("role","alert");
};
$("#uef-tmpl-nav-show-btn").on("click",_showMenuAccessibility);
$("#uef-tmpl-nav-hide-btn").on("click",_hideMenuAccessibility);
},addMobileMenuItems:function(){$("*[data-uef-tmpl-mobile-nav-menu-item=true]").each(function(index){if(!$(this).parent().hasClass("uef-tmpl-viewport-large")){var mobileMenuEl=document.createElement("li");
mobileMenuEl.className="uef-tmpl-viewport-small";
$(mobileMenuEl).append($(this).clone());
if($(".uef-tmpl-nav-content").length==0){$("#uef-tmpl-nav").append("<div class='uef-tmpl-nav-content'></div>");
}if($("#uef-tmpl-nav-menu").length==0){$(".uef-tmpl-nav-content").append("<ul id='uef-tmpl-nav-menu' role='navigation'></ul>");
}if($(this).attr("data-uef-tmpl-mobile-nav-menu-item-location")=="top"){$("#uef-tmpl-nav-menu").prepend(mobileMenuEl);
}else{$("#uef-tmpl-nav-menu").append(mobileMenuEl);
}}});
},config:function(userPrefs){if(typeof userPrefs==="object"){if(typeof userPrefs.username!=="undefined"&&typeof userPrefs.username.URL!=="undefined"&&typeof userPrefs.username.URL!==""){SSA.fn.setup.username.URL=userPrefs.username.URL;
}if(typeof userPrefs.pageTimeout!=="undefined"&&typeof userPrefs.pageTimeout.URL!=="undefined"&&typeof userPrefs.pageTimeout.URL!==""){SSA.fn.setup.pageTimeout.URL=userPrefs.pageTimeout.URL;
}if(typeof userPrefs.pageTimeout!=="undefined"&&typeof userPrefs.pageTimeout.duration!=="undefined"&&typeof userPrefs.pageTimeout.duration!==""){SSA.fn.setup.pageTimeout.duration=userPrefs.pageTimeout.duration;
}if(typeof userPrefs.pageTimeout!=="undefined"&&typeof userPrefs.pageTimeout.firstwarningmsg!=="undefined"&&typeof userPrefs.pageTimeout.firstwarningmsg!==""){SSA.fn.setup.pageTimeout.firstwarningmsg=userPrefs.pageTimeout.firstwarningmsg;
}if(typeof userPrefs.pageTimeout!=="undefined"&&typeof userPrefs.pageTimeout.secondwarningmsg!=="undefined"&&typeof userPrefs.pageTimeout.secondwarningmsg!==""){SSA.fn.setup.pageTimeout.secondwarningmsg=userPrefs.pageTimeout.secondwarningmsg;
}if(typeof userPrefs.pageTimeout!=="undefined"&&typeof userPrefs.pageTimeout.thirdwarningmsg!=="undefined"&&typeof userPrefs.pageTimeout.thirdwarningmsg!==""){SSA.fn.setup.pageTimeout.thirdwarningmsg=userPrefs.pageTimeout.thirdwarningmsg;
}if(typeof userPrefs.offhours!=="undefined"&&typeof userPrefs.offhours.userStyle!=="undefined"&&userPrefs.offhours.userStyle!==""){SSA.fn.setup.offhours.userStyle=userPrefs.offhours.userStyle;
}if(typeof userPrefs.offhours!=="undefined"&&typeof userPrefs.offhours.timeInterval!=="undefined"&&userPrefs.offhours.timeInterval!==""){SSA.fn.setup.offhours.timeInterval=userPrefs.offhours.timeInterval;
}if(typeof userPrefs.offhours!=="undefined"&&typeof userPrefs.offhours.URL!=="undefined"&&userPrefs.offhours.URL!==""){SSA.fn.setup.offhours.URL=userPrefs.offhours.URL;
}if(typeof userPrefs.accessKeys!=="undefined"&&typeof userPrefs.accessKeys.stylesheet!=="undefined"&&userPrefs.accessKeys.stylesheet!==""){SSA.fn.setup.accessKeys.stylesheet=userPrefs.accessKeys.stylesheet;
}if(typeof userPrefs.accessKeys!=="undefined"&&typeof userPrefs.accessKeys.previewKey!=="undefined"&&userPrefs.accessKeys.previewKey!==""){SSA.fn.setup.accessKeys.previewKey=userPrefs.accessKeys.previewKey;
}}},init:function(){SSA.fn.setup.removeJavaScriptOffMessage();
SSA.fn.setup.addMobileMenuItems();
SSA.fn.setup.addMobileMenuAccessibility();
},removeJavaScriptOffMessage:function(){if($("#uef-tmpl-javaScriptOff").length>0){$("#uef-tmpl-javaScriptOff").remove();
}if($("#uef-tmpl-content-wrapper").length>0&&$("#uef-tmpl-content-wrapper").hasClass("hide")){$("#uef-tmpl-content-wrapper").removeClass("hide");
}}};
$(document).ready(SSA.fn.setup.init);
})();
SSA.fn.setup.addHTMLDataAttr();
