(function() { var jQuery; var jqueryforwidget = 'https://events.thehistorylist.com/assets/jquery-for-widget.min.js'; var root_url = 'https://events.thehistorylist.com/'; var current_org = '5440'; var mouseX; var mouseY; function scriptLoadHandler() { jQuery = window.jQuery.noConflict(true); main(); } if (window.jQuery === undefined || window.jQuery.fn.jquery !== "1.4.2") { var script_tag = document.createElement("script"); script_tag.setAttribute("type", "text/javascript"); script_tag.setAttribute("src", jqueryforwidget); if (script_tag.readyState) { script_tag.onreadystatechange = function () { if (this.readyState == "complete" || this.readyState == "loaded") { scriptLoadHandler(); } } } else { script_tag.onload = scriptLoadHandler; }(document.getElementsByTagName("head")[0] || document.documentElement).appendChild(script_tag); } else { jQuery = window.jQuery; main(); } function main() { /*add to cal lib*/ (function (a) { a.widget("tardate.AddToCal", { options: { calendars: [{ value: 1, label: "Add to Google Calendar", enabled: function (a) { return true }, formatlink: function (a) { return "http://www.google.com/calendar/event?action=TEMPLATE&trp=false" + "&text=" + a.title + "&dates=" + a.start + "/" + a.end + "&location=" + a.location + "&details=" + a.details + "&sprop=" + a.url } }, { value: 2, label: "Add to Live Calendar", enabled: function (a) { return true }, formatlink: function (a) { return "http://calendar.live.com/calendar/calendar.aspx?rru=addevent" + "&dtstart=" + a.start + "&dtend=" + a.end + "&summary=" + a.title + "&description=" + a.details + "&location=" + a.location } }, { value: 3, label: "Add to Yahoo! Calendar", enabled: function (a) { return true }, formatlink: function (a) { var b = (Date.parse(a.end) - Date.parse(a.start)) / 60 / 1e3; var c = (b / 60).toPaddedString(2) + (b % 60).toPaddedString(2); return "http://calendar.yahoo.com/?v=60" + "&DUR=" + c + "&TITLE=" + a.title + "&ST=" + a.start + "&in_loc=" + a.location + "&DESC=" + a.details + "&URL=" + a.url } }, { value: 4, label: "iCal", enabled: function (a) { return a.options.icalEnabled }, formatlink: function (a) { return a.icalurl ? a.icalurl : null } }, { value: 5, label: "vCalendar", enabled: function (a) { return a.options.vcalEnabled }, formatlink: function (a) { return a.vcalurl ? a.vcalurl : null } }], icalEnabled: true, vcalEnabled: false, getEventDetails: function (a) { return { webcalurl: "webcal://site.ics", icalurl: "http://site.ics", vcalurl: "http://site.vcs", start: new Date, end: new Date, title: null, details: null, location: null, url: null } }, sanitizeEventDetails: function (a) { a.title = a.title ? encodeURIComponent(a.title) : ""; a.start = typeof a.start.toRFC3339UTCString == "function" ? a.start.toRFC3339UTCString(true, true) : a.start; a.end = typeof a.end.toRFC3339UTCString == "function" ? a.end.toRFC3339UTCString(true, true) : a.end; a.location = a.location ? encodeURIComponent(a.location) : ""; a.details = a.details ? encodeURIComponent(a.details) : ""; a.url = a.url ? encodeURIComponent(a.url) : ""; return a }, selectedCalendarTarget: null, appendTo: "body", position: { my: "left top", at: "left bottom", collision: "none" }, select: function (b, c) { var d = c.sanitizeEventDetails(c.getEventDetails(a(this))); var e = a.grep(c.calendars, function (a, b) { return a.value == c.selectedCalendarTarget }); var f = e[0].formatlink(d); if (f) window.open(f) } }, source: [], _create: function () { var b = this, c = this.element[0].ownerDocument; this.element.addClass("ui-addtocal").bind("click.addtocal mouseenter", function (a) { a.preventDefault(); a.stopPropagation(); b.toggleMenu() }); this.element.bind("click.addtocal mouseleave", function (a) { a.preventDefault(); a.stopPropagation() }); this._initSource(); this.menu = a("