[\\s\\S]*?<\\/p>/)) {\n\n\t\t\treturn str;\n\t\t} else {\n\t\t\treturn \"
\" + str + \"
\";\n\t\t}\n\t},\n\n\t/*\t* Turns plain text links into real links\n\t================================================== */\n\tlinkify: function(text,targets,is_touch) {\n\n var make_link = function(url, link_text, prefix) {\n if (!prefix) {\n prefix = \"\";\n }\n var MAX_LINK_TEXT_LENGTH = 30;\n if (link_text && link_text.length > MAX_LINK_TEXT_LENGTH) {\n link_text = link_text.substring(0,MAX_LINK_TEXT_LENGTH) + \"\\u2026\"; // unicode ellipsis\n }\n return prefix + \"\" + link_text + \"\";\n }\n\t\t// http://, https://, ftp://\n\t\tvar urlPattern = /\\b(?:https?|ftp):\\/\\/([a-z0-9-+&@#\\/%?=~_|!:,.;]*[a-z0-9-+&@#\\/%=~_|])/gim;\n\n\t\t// www. sans http:// or https://\n\t\tvar pseudoUrlPattern = /(^|[^\\/>])(www\\.[\\S]+(\\b|$))/gim;\n\n\t\t// Email addresses\n\t\tvar emailAddressPattern = /([a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+)/gim;\n\n\n\t\treturn text\n\t\t\t.replace(urlPattern, function(match, url_sans_protocol, offset, string) {\n // Javascript doesn't support negative lookbehind assertions, so\n // we need to handle risk of matching URLs in legit hrefs\n if (offset > 0) {\n var prechar = string[offset-1];\n if (prechar == '\"' || prechar == \"'\" || prechar == \"=\") {\n return match;\n }\n }\n return make_link(match, url_sans_protocol);\n })\n\t\t\t.replace(pseudoUrlPattern, function(match, beforePseudo, pseudoUrl, offset, string) {\n return make_link('http://' + pseudoUrl, pseudoUrl, beforePseudo);\n })\n\t\t\t.replace(emailAddressPattern, function(match, email, offset, string) {\n return make_link('mailto:' + email, email);\n });\n\t},\n\n\tunlinkify: function(text) {\n\t\tif(!text) return text;\n\t\ttext = text.replace(/]*>/i,\"\");\n\t\ttext = text.replace(/<\\/a>/i, \"\");\n\t\treturn text;\n\t},\n\n\tgetParamString: function (obj) {\n\t\tvar params = [];\n\t\tfor (var i in obj) {\n\t\t\tif (obj.hasOwnProperty(i)) {\n\t\t\t\tparams.push(i + '=' + obj[i]);\n\t\t\t}\n\t\t}\n\t\treturn '?' + params.join('&');\n\t},\n\n\tformatNum: function (num, digits) {\n\t\tvar pow = Math.pow(10, digits || 5);\n\t\treturn Math.round(num * pow) / pow;\n\t},\n\n\tfalseFn: function () {\n\t\treturn false;\n\t},\n\n\trequestAnimFrame: (function () {\n\t\tfunction timeoutDefer(callback) {\n\t\t\twindow.setTimeout(callback, 1000 / 60);\n\t\t}\n\n\t\tvar requestFn = window.requestAnimationFrame ||\n\t\t\twindow.webkitRequestAnimationFrame ||\n\t\t\twindow.mozRequestAnimationFrame ||\n\t\t\twindow.oRequestAnimationFrame ||\n\t\t\twindow.msRequestAnimationFrame ||\n\t\t\ttimeoutDefer;\n\n\t\treturn function (callback, context, immediate, contextEl) {\n\t\t\tcallback = context ? TL.Util.bind(callback, context) : callback;\n\t\t\tif (immediate && requestFn === timeoutDefer) {\n\t\t\t\tcallback();\n\t\t\t} else {\n\t\t\t\trequestFn(callback, contextEl);\n\t\t\t}\n\t\t};\n\t}()),\n\n\tbind: function (/*Function*/ fn, /*Object*/ obj) /*-> Object*/ {\n\t\treturn function () {\n\t\t\treturn fn.apply(obj, arguments);\n\t\t};\n\t},\n\n\ttemplate: function (str, data) {\n\t\treturn str.replace(/\\{ *([\\w_]+) *\\}/g, function (str, key) {\n\t\t\tvar value = data[key];\n\t\t\tif (!data.hasOwnProperty(key)) {\n\t\t\t throw new TL.Error(\"template_value_err\", str);\n\t\t\t}\n\t\t\treturn value;\n\t\t});\n\t},\n\n\thexToRgb: function(hex) {\n\t // Expand shorthand form (e.g. \"03F\") to full form (e.g. \"0033FF\")\n if (TL.Util.css_named_colors[hex.toLowerCase()]) {\n hex = TL.Util.css_named_colors[hex.toLowerCase()];\n }\n\t var shorthandRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;\n\t hex = hex.replace(shorthandRegex, function(m, r, g, b) {\n\t return r + r + g + g + b + b;\n\t });\n\n\t var result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n\t return result ? {\n\t r: parseInt(result[1], 16),\n\t g: parseInt(result[2], 16),\n\t b: parseInt(result[3], 16)\n\t } : null;\n\t},\n\t// given an object with r, g, and b keys, or a string of the form 'rgb(mm,nn,ll)', return a CSS hex string including the leading '#' character\n\trgbToHex: function(rgb) {\n\t\tvar r,g,b;\n\t\tif (typeof(rgb) == 'object') {\n\t\t\tr = rgb.r;\n\t\t\tg = rgb.g;\n\t\t\tb = rgb.b;\n\t\t} else if (typeof(rgb.match) == 'function'){\n\t\t\tvar parts = rgb.match(/^rgb\\((\\d+),(\\d+),(\\d+)\\)$/);\n\t\t\tif (parts) {\n\t\t\t\tr = parts[1];\n\t\t\t\tg = parts[2];\n\t\t\t\tb = parts[3];\n\t\t\t}\n\t\t}\n\t\tif (isNaN(r) || isNaN(b) || isNaN(g)) {\n\t\t\tthrow new TL.Error(\"invalid_rgb_err\");\n\t\t}\n\t\treturn \"#\" + TL.Util.intToHexString(r) + TL.Util.intToHexString(g) + TL.Util.intToHexString(b);\n\t},\n\tcolorObjToHex: function(o) {\n\t\tvar parts = [o.r, o.g, o.b];\n\t\treturn TL.Util.rgbToHex(\"rgb(\" + parts.join(',') + \")\")\n\t},\n css_named_colors: {\n \"aliceblue\": \"#f0f8ff\",\n \"antiquewhite\": \"#faebd7\",\n \"aqua\": \"#00ffff\",\n \"aquamarine\": \"#7fffd4\",\n \"azure\": \"#f0ffff\",\n \"beige\": \"#f5f5dc\",\n \"bisque\": \"#ffe4c4\",\n \"black\": \"#000000\",\n \"blanchedalmond\": \"#ffebcd\",\n \"blue\": \"#0000ff\",\n \"blueviolet\": \"#8a2be2\",\n \"brown\": \"#a52a2a\",\n \"burlywood\": \"#deb887\",\n \"cadetblue\": \"#5f9ea0\",\n \"chartreuse\": \"#7fff00\",\n \"chocolate\": \"#d2691e\",\n \"coral\": \"#ff7f50\",\n \"cornflowerblue\": \"#6495ed\",\n \"cornsilk\": \"#fff8dc\",\n \"crimson\": \"#dc143c\",\n \"cyan\": \"#00ffff\",\n \"darkblue\": \"#00008b\",\n \"darkcyan\": \"#008b8b\",\n \"darkgoldenrod\": \"#b8860b\",\n \"darkgray\": \"#a9a9a9\",\n \"darkgreen\": \"#006400\",\n \"darkkhaki\": \"#bdb76b\",\n \"darkmagenta\": \"#8b008b\",\n \"darkolivegreen\": \"#556b2f\",\n \"darkorange\": \"#ff8c00\",\n \"darkorchid\": \"#9932cc\",\n \"darkred\": \"#8b0000\",\n \"darksalmon\": \"#e9967a\",\n \"darkseagreen\": \"#8fbc8f\",\n \"darkslateblue\": \"#483d8b\",\n \"darkslategray\": \"#2f4f4f\",\n \"darkturquoise\": \"#00ced1\",\n \"darkviolet\": \"#9400d3\",\n \"deeppink\": \"#ff1493\",\n \"deepskyblue\": \"#00bfff\",\n \"dimgray\": \"#696969\",\n \"dodgerblue\": \"#1e90ff\",\n \"firebrick\": \"#b22222\",\n \"floralwhite\": \"#fffaf0\",\n \"forestgreen\": \"#228b22\",\n \"fuchsia\": \"#ff00ff\",\n \"gainsboro\": \"#dcdcdc\",\n \"ghostwhite\": \"#f8f8ff\",\n \"gold\": \"#ffd700\",\n \"goldenrod\": \"#daa520\",\n \"gray\": \"#808080\",\n \"green\": \"#008000\",\n \"greenyellow\": \"#adff2f\",\n \"honeydew\": \"#f0fff0\",\n \"hotpink\": \"#ff69b4\",\n \"indianred\": \"#cd5c5c\",\n \"indigo\": \"#4b0082\",\n \"ivory\": \"#fffff0\",\n \"khaki\": \"#f0e68c\",\n \"lavender\": \"#e6e6fa\",\n \"lavenderblush\": \"#fff0f5\",\n \"lawngreen\": \"#7cfc00\",\n \"lemonchiffon\": \"#fffacd\",\n \"lightblue\": \"#add8e6\",\n \"lightcoral\": \"#f08080\",\n \"lightcyan\": \"#e0ffff\",\n \"lightgoldenrodyellow\": \"#fafad2\",\n \"lightgray\": \"#d3d3d3\",\n \"lightgreen\": \"#90ee90\",\n \"lightpink\": \"#ffb6c1\",\n \"lightsalmon\": \"#ffa07a\",\n \"lightseagreen\": \"#20b2aa\",\n \"lightskyblue\": \"#87cefa\",\n \"lightslategray\": \"#778899\",\n \"lightsteelblue\": \"#b0c4de\",\n \"lightyellow\": \"#ffffe0\",\n \"lime\": \"#00ff00\",\n \"limegreen\": \"#32cd32\",\n \"linen\": \"#faf0e6\",\n \"magenta\": \"#ff00ff\",\n \"maroon\": \"#800000\",\n \"mediumaquamarine\": \"#66cdaa\",\n \"mediumblue\": \"#0000cd\",\n \"mediumorchid\": \"#ba55d3\",\n \"mediumpurple\": \"#9370db\",\n \"mediumseagreen\": \"#3cb371\",\n \"mediumslateblue\": \"#7b68ee\",\n \"mediumspringgreen\": \"#00fa9a\",\n \"mediumturquoise\": \"#48d1cc\",\n \"mediumvioletred\": \"#c71585\",\n \"midnightblue\": \"#191970\",\n \"mintcream\": \"#f5fffa\",\n \"mistyrose\": \"#ffe4e1\",\n \"moccasin\": \"#ffe4b5\",\n \"navajowhite\": \"#ffdead\",\n \"navy\": \"#000080\",\n \"oldlace\": \"#fdf5e6\",\n \"olive\": \"#808000\",\n \"olivedrab\": \"#6b8e23\",\n \"orange\": \"#ffa500\",\n \"orangered\": \"#ff4500\",\n \"orchid\": \"#da70d6\",\n \"palegoldenrod\": \"#eee8aa\",\n \"palegreen\": \"#98fb98\",\n \"paleturquoise\": \"#afeeee\",\n \"palevioletred\": \"#db7093\",\n \"papayawhip\": \"#ffefd5\",\n \"peachpuff\": \"#ffdab9\",\n \"peru\": \"#cd853f\",\n \"pink\": \"#ffc0cb\",\n \"plum\": \"#dda0dd\",\n \"powderblue\": \"#b0e0e6\",\n \"purple\": \"#800080\",\n \"rebeccapurple\": \"#663399\",\n \"red\": \"#ff0000\",\n \"rosybrown\": \"#bc8f8f\",\n \"royalblue\": \"#4169e1\",\n \"saddlebrown\": \"#8b4513\",\n \"salmon\": \"#fa8072\",\n \"sandybrown\": \"#f4a460\",\n \"seagreen\": \"#2e8b57\",\n \"seashell\": \"#fff5ee\",\n \"sienna\": \"#a0522d\",\n \"silver\": \"#c0c0c0\",\n \"skyblue\": \"#87ceeb\",\n \"slateblue\": \"#6a5acd\",\n \"slategray\": \"#708090\",\n \"snow\": \"#fffafa\",\n \"springgreen\": \"#00ff7f\",\n \"steelblue\": \"#4682b4\",\n \"tan\": \"#d2b48c\",\n \"teal\": \"#008080\",\n \"thistle\": \"#d8bfd8\",\n \"tomato\": \"#ff6347\",\n \"turquoise\": \"#40e0d0\",\n \"violet\": \"#ee82ee\",\n \"wheat\": \"#f5deb3\",\n \"white\": \"#ffffff\",\n \"whitesmoke\": \"#f5f5f5\",\n \"yellow\": \"#ffff00\",\n \"yellowgreen\": \"#9acd32\"\n },\n\tratio: {\n\t\tsquare: function(size) {\n\t\t\tvar s = {\n\t\t\t\tw: 0,\n\t\t\t\th: 0\n\t\t\t}\n\t\t\tif (size.w > size.h && size.h > 0) {\n\t\t\t\ts.h = size.h;\n\t\t\t\ts.w = size.h;\n\t\t\t} else {\n\t\t\t\ts.w = size.w;\n\t\t\t\ts.h = size.w;\n\t\t\t}\n\t\t\treturn s;\n\t\t},\n\n\t\tr16_9: function(size) {\n\t\t\tif (size.w !== null && size.w !== \"\") {\n\t\t\t\treturn Math.round((size.w / 16) * 9);\n\t\t\t} else if (size.h !== null && size.h !== \"\") {\n\t\t\t\treturn Math.round((size.h / 9) * 16);\n\t\t\t} else {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t},\n\t\tr4_3: function(size) {\n\t\t\tif (size.w !== null && size.w !== \"\") {\n\t\t\t\treturn Math.round((size.w / 4) * 3);\n\t\t\t} else if (size.h !== null && size.h !== \"\") {\n\t\t\t\treturn Math.round((size.h / 3) * 4);\n\t\t\t}\n\t\t}\n\t},\n\tgetObjectAttributeByIndex: function(obj, index) {\n\t\tif(typeof obj != 'undefined') {\n\t\t\tvar i = 0;\n\t\t\tfor (var attr in obj){\n\t\t\t\tif (index === i){\n\t\t\t\t\treturn obj[attr];\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t}\n\t\t\treturn \"\";\n\t\t} else {\n\t\t\treturn \"\";\n\t\t}\n\n\t},\n\tgetUrlVars: function(string) {\n\t\tvar str,\n\t\t\tvars = [],\n\t\t\thash,\n\t\t\thashes;\n\n\t\tstr = string.toString();\n\n\t\tif (str.match('&')) {\n\t\t\tstr = str.replace(\"&\", \"&\");\n\t\t} else if (str.match('&')) {\n\t\t\tstr = str.replace(\"&\", \"&\");\n\t\t} else if (str.match('&')) {\n\t\t\tstr = str.replace(\"&\", \"&\");\n\t\t}\n\n\t\thashes = str.slice(str.indexOf('?') + 1).split('&');\n\n\t\tfor(var i = 0; i < hashes.length; i++) {\n\t\t\thash = hashes[i].split('=');\n\t\t\tvars.push(hash[0]);\n\t\t\tvars[hash[0]] = hash[1];\n\t\t}\n\n\n\t\treturn vars;\n\t},\n /**\n * Remove any leading or trailing whitespace from the given string.\n * If `str` is undefined or does not have a `replace` function, return\n * an empty string.\n */\n\ttrim: function(str) {\n if (str && typeof(str.replace) == 'function') {\n return str.replace(/^\\s+|\\s+$/g, '');\n }\n return \"\";\n\t},\n\n\tslugify: function(str) {\n\t\t// borrowed from http://stackoverflow.com/a/5782563/102476\n\t\tstr = TL.Util.trim(str);\n\t\tstr = str.toLowerCase();\n\n\t\t// remove accents, swap ñ for n, etc\n\t\tvar from = \"ãàáäâẽèéëêìíïîõòóöôùúüûñç·/_,:;\";\n\t\tvar to = \"aaaaaeeeeeiiiiooooouuuunc------\";\n\t\tfor (var i=0, l=from.length ; i\" + d.description + \"
\";\n\n\t\tthis._setContent(content);\n\t},\n\n\t_setContent: function(content) {\n\t\t// Create Dom element\n\t\tthis._el.content_item\t= TL.Dom.create(\"div\", \"tl-media-item tl-media-website\", this._el.content);\n\t\tthis._el.content_container.className = \"tl-media-content-container tl-media-content-container-text\";\n\t\tthis._el.content_item.innerHTML = content;\n\n\t\t// After Loaded\n\t\tthis.onLoaded();\n\n\t},\n\n\tupdateMediaDisplay: function() {\n\n\t},\n\n\t_updateMediaDisplay: function() {\n\n\t}\n\n\n});\n\n\n/* **********************************************\n Begin TL.Media.Wikipedia.js\n********************************************** */\n\n/*\tTL.Media.Wikipedia\n================================================== */\n\nTL.Media.Wikipedia = TL.Media.extend({\n\n\tincludes: [TL.Events],\n\n\t/*\tLoad the media\n\t================================================== */\n\t_loadMedia: function() {\n\t\tvar api_url,\n\t\t\tapi_language,\n\t\t\tself = this;\n\n\t\t// Create Dom element\n\t\tthis._el.content_item\t= TL.Dom.create(\"div\", \"tl-media-item tl-media-wikipedia\", this._el.content);\n\t\tthis._el.content_container.className = \"tl-media-content-container tl-media-content-container-text\";\n\n\t\t// Get Media ID\n\t\tthis.media_id\t = this.data.url.split(\"wiki\\/\")[1].split(\"#\")[0].replace(\"_\", \" \");\n\t\tthis.media_id\t = this.media_id.replace(\" \", \"%20\");\n\t\tapi_language\t = this.data.url.split(\"//\")[1].split(\".wikipedia\")[0];\n\n\t\t// API URL\n\t\tapi_url = \"https://\" + api_language + \".wikipedia.org/w/api.php?action=query&prop=extracts|pageimages&redirects=&titles=\" + this.media_id + \"&exintro=1&format=json&callback=?\";\n\n\t\t// API Call\n\t\tTL.ajax({\n\t\t\ttype: 'GET',\n\t\t\turl: api_url,\n\t\t\tdataType: 'json', //json data type\n\n\t\t\tsuccess: function(d){\n\t\t\t\tself.createMedia(d);\n\t\t\t},\n\t\t\terror:function(xhr, type){\n\t\t\t\tvar error_text = \"\";\n\t\t\t\terror_text += self._(\"wikipedia_load_err\") + \"\")) {\n\t\t\t\twiki.text_array = wiki.extract.split(\"
\");\n\t\t\t} else {\n\t\t\t\twiki.text_array.push(wiki.extract);\n\t\t\t}\n\n\t\t\tfor(var i = 0; i < wiki.text_array.length; i++) {\n\t\t\t\tif (i+1 <= wiki.paragraphs && i+1 < wiki.text_array.length) {\n\t\t\t\t\twiki.text\t+= \"
\" + wiki.text_array[i+1];\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\tcontent\t\t+=\t\"\";\n\t\t\tcontent\t\t+=\t\"
.dateformats\n\t second: 'time_short',\n\t minute: 'time_no_seconds_short',\n\t hour: 'time_no_minutes_short',\n\t day: 'full_short',\n\t month: 'month_short',\n\t year: 'year',\n\t decade: 'year',\n\t century: 'year',\n\t millennium: 'year',\n\t age: 'compact', // ...TL.Language..bigdateformats\n\t epoch: 'compact',\n\t era: 'compact',\n\t eon: 'compact',\n\t eon2: 'compact'\n\t }\n\n\t\t// Main element\n\t\tif (typeof elem === 'object') {\n\t\t\tthis._el.container = elem;\n\t\t} else {\n\t\t\tthis._el.container = TL.Dom.get(elem);\n\t\t}\n\n\t\t// Merge Data and Options\n\t\tTL.Util.mergeData(this.options, options);\n\n\t\tthis._initLayout();\n\t\tthis._initEvents();\n\n\t},\n\n\t/*\tAdding, Hiding, Showing etc\n\t================================================== */\n\tshow: function() {\n\n\t},\n\n\thide: function() {\n\n\t},\n\n\taddTo: function(container) {\n\t\tcontainer.appendChild(this._el.container);\n\t},\n\n\tremoveFrom: function(container) {\n\t\tcontainer.removeChild(this._el.container);\n\t},\n\n\tupdateDisplay: function(w, h) {\n\t\tthis._updateDisplay(w, h);\n\t},\n\n\tgetLeft: function() {\n\t\treturn this._el.container.style.left.slice(0, -2);\n\t},\n\n\tdrawTicks: function(timescale, optimal_tick_width) {\n\n\t\tvar ticks = timescale.getTicks();\n\n\t\tvar controls = {\n\t\t\tminor: {\n\t\t\t\tel: this._el.minor,\n\t\t\t\tdateformat: this.dateformat_lookup[ticks['minor'].name],\n\t\t\t\tts_ticks: ticks['minor'].ticks,\n\t\t\t\ttick_elements: this.minor_ticks\n\t\t\t},\n\t\t\tmajor: {\n\t\t\t\tel: this._el.major,\n\t\t\t\tdateformat: this.dateformat_lookup[ticks['major'].name],\n\t\t\t\tts_ticks: ticks['major'].ticks,\n\t\t\t\ttick_elements: this.major_ticks\n\t\t\t}\n\t\t}\n\t\t// FADE OUT\n\t\tthis._el.major.className = \"tl-timeaxis-major\";\n\t\tthis._el.minor.className = \"tl-timeaxis-minor\";\n\t\tthis._el.major.style.opacity = 0;\n\t\tthis._el.minor.style.opacity = 0;\n\n\t\t// CREATE MAJOR TICKS\n\t\tthis.major_ticks = this._createTickElements(\n\t\t\tticks['major'].ticks,\n\t\t\tthis._el.major,\n\t\t\tthis.dateformat_lookup[ticks['major'].name]\n\t\t);\n\n\t\t// CREATE MINOR TICKS\n\t\tthis.minor_ticks = this._createTickElements(\n\t\t\tticks['minor'].ticks,\n\t\t\tthis._el.minor,\n\t\t\tthis.dateformat_lookup[ticks['minor'].name],\n\t\t\tticks['major'].ticks\n\t\t);\n\n\t\tthis.positionTicks(timescale, optimal_tick_width, true);\n\n\t\t// FADE IN\n\t\tthis._el.major.className = \"tl-timeaxis-major tl-animate-opacity tl-timeaxis-animate-opacity\";\n\t\tthis._el.minor.className = \"tl-timeaxis-minor tl-animate-opacity tl-timeaxis-animate-opacity\";\n\t\tthis._el.major.style.opacity = 1;\n\t\tthis._el.minor.style.opacity = 1;\n\t},\n\n\t_createTickElements: function(ts_ticks,tick_element,dateformat,ticks_to_skip) {\n\t\ttick_element.innerHTML = \"\";\n\t\tvar skip_times = {}\n\t\tif (ticks_to_skip){\n\t\t\tfor (var i = 0; i < ticks_to_skip.length; i++) {\n\t\t\t\tskip_times[ticks_to_skip[i].getTime()] = true;\n\t\t\t}\n\t\t}\n\n\t\tvar tick_elements = []\n\t\tfor (var i = 0; i < ts_ticks.length; i++) {\n\t\t\tvar ts_tick = ts_ticks[i];\n\t\t\tif (!(ts_tick.getTime() in skip_times)) {\n\t\t\t\tvar tick = TL.Dom.create(\"div\", \"tl-timeaxis-tick\", tick_element),\n\t\t\t\t\ttick_text \t= TL.Dom.create(\"span\", \"tl-timeaxis-tick-text tl-animate-opacity\", tick);\n\n\t\t\t\ttick_text.innerHTML = ts_tick.getDisplayDate(this.getLanguage(), dateformat);\n\n\t\t\t\ttick_elements.push({\n\t\t\t\t\ttick:tick,\n\t\t\t\t\ttick_text:tick_text,\n\t\t\t\t\tdisplay_date:ts_tick.getDisplayDate(this.getLanguage(), dateformat),\n\t\t\t\t\tdate:ts_tick\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\treturn tick_elements;\n\t},\n\n\tpositionTicks: function(timescale, optimal_tick_width, no_animate) {\n\n\t\t// Handle Animation\n\t\tif (no_animate) {\n\t\t\tthis._el.major.className = \"tl-timeaxis-major\";\n\t\t\tthis._el.minor.className = \"tl-timeaxis-minor\";\n\t\t} else {\n\t\t\tthis._el.major.className = \"tl-timeaxis-major tl-timeaxis-animate\";\n\t\t\tthis._el.minor.className = \"tl-timeaxis-minor tl-timeaxis-animate\";\n\t\t}\n\n\t\tthis._positionTickArray(this.major_ticks, timescale, optimal_tick_width);\n\t\tthis._positionTickArray(this.minor_ticks, timescale, optimal_tick_width);\n\n\t},\n\n\t_positionTickArray: function(tick_array, timescale, optimal_tick_width) {\n\t\t// Poition Ticks & Handle density of ticks\n\t\tif (tick_array[1] && tick_array[0]) {\n\t\t\tvar distance = ( timescale.getPosition(tick_array[1].date.getMillisecond()) - timescale.getPosition(tick_array[0].date.getMillisecond()) ),\n\t\t\t\tfraction_of_array = 1;\n\n\n\t\t\tif (distance < optimal_tick_width) {\n\t\t\t\tfraction_of_array = Math.round(optimal_tick_width/timescale.getPixelsPerTick());\n\t\t\t}\n\n\t\t\tvar show = 1;\n\n\t\t\tfor (var i = 0; i < tick_array.length; i++) {\n\n\t\t\t\tvar tick = tick_array[i];\n\n\t\t\t\t// Poition Ticks\n\t\t\t\ttick.tick.style.left = timescale.getPosition(tick.date.getMillisecond()) + \"px\";\n\t\t\t\ttick.tick_text.innerHTML = tick.display_date;\n\n\t\t\t\t// Handle density of ticks\n\t\t\t\tif (fraction_of_array > 1) {\n\t\t\t\t\tif (show >= fraction_of_array) {\n\t\t\t\t\t\tshow = 1;\n\t\t\t\t\t\ttick.tick_text.style.opacity = 1;\n\t\t\t\t\t\ttick.tick.className = \"tl-timeaxis-tick\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\tshow++;\n\t\t\t\t\t\ttick.tick_text.style.opacity = 0;\n\t\t\t\t\t\ttick.tick.className = \"tl-timeaxis-tick tl-timeaxis-tick-hidden\";\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\ttick.tick_text.style.opacity = 1;\n\t\t\t\t\ttick.tick.className = \"tl-timeaxis-tick\";\n\t\t\t\t}\n\n\t\t\t};\n\t\t}\n\t},\n\n\t/*\tEvents\n\t================================================== */\n\n\n\t/*\tPrivate Methods\n\t================================================== */\n\t_initLayout: function () {\n\t\tthis._el.content_container\t\t= TL.Dom.create(\"div\", \"tl-timeaxis-content-container\", this._el.container);\n\t\tthis._el.major\t\t\t\t\t= TL.Dom.create(\"div\", \"tl-timeaxis-major\", this._el.content_container);\n\t\tthis._el.minor\t\t\t\t\t= TL.Dom.create(\"div\", \"tl-timeaxis-minor\", this._el.content_container);\n\n\t\t// Fire event that the slide is loaded\n\t\tthis.onLoaded();\n\t},\n\n\t_initEvents: function() {\n\n\t},\n\n\t// Update Display\n\t_updateDisplay: function(width, height, layout) {\n\n\t\tif (width) {\n\t\t\tthis.options.width \t\t\t\t\t= width;\n\t\t}\n\n\t\tif (height) {\n\t\t\tthis.options.height = height;\n\t\t}\n\n\t}\n\n});\n\n\n/* **********************************************\n Begin TL.AxisHelper.js\n********************************************** */\n\n/* TL.AxisHelper\n Strategies for laying out the timenav\n markers and time axis\n Intended as a private class -- probably only known to TimeScale\n================================================== */\nTL.AxisHelper = TL.Class.extend({\n initialize: function (options) {\n\t\tif (options) {\n this.scale = options.scale;\n\t this.minor = options.minor;\n\t this.major = options.major;\n\t\t} else {\n throw new TL.Error(\"axis_helper_no_options_err\")\n }\n\n },\n\n getPixelsPerTick: function(pixels_per_milli) {\n return pixels_per_milli * this.minor.factor;\n },\n\n getMajorTicks: function(timescale) {\n\t\treturn this._getTicks(timescale, this.major)\n },\n\n getMinorTicks: function(timescale) {\n return this._getTicks(timescale, this.minor)\n },\n\n _getTicks: function(timescale, option) {\n\n var factor_scale = timescale._scaled_padding * option.factor;\n var first_tick_time = timescale._earliest - factor_scale;\n var last_tick_time = timescale._latest + factor_scale;\n var ticks = []\n for (var i = first_tick_time; i < last_tick_time; i += option.factor) {\n ticks.push(timescale.getDateFromTime(i).floor(option.name));\n }\n\n return {\n name: option.name,\n ticks: ticks\n }\n\n }\n\n});\n\n(function(cls){ // add some class-level behavior\n\n var HELPERS = {};\n\n var setHelpers = function(scale_type, scales) {\n HELPERS[scale_type] = [];\n\n for (var idx = 0; idx < scales.length - 1; idx++) {\n var minor = scales[idx];\n var major = scales[idx+1];\n HELPERS[scale_type].push(new cls({\n scale: minor[3],\n minor: { name: minor[0], factor: minor[1]},\n major: { name: major[0], factor: major[1]}\n }));\n }\n };\n\n setHelpers('human', TL.Date.SCALES);\n setHelpers('cosmological', TL.BigDate.SCALES);\n\n cls.HELPERS = HELPERS;\n\n cls.getBestHelper = function(ts,optimal_tick_width) {\n if (typeof(optimal_tick_width) != 'number' ) {\n optimal_tick_width = 100;\n }\n var ts_scale = ts.getScale();\n var helpers = HELPERS[ts_scale];\n\n if (!helpers) {\n throw new TL.Error(\"axis_helper_scale_err\", ts_scale);\n }\n\n var prev = null;\n for (var idx in helpers) {\n var curr = helpers[idx];\n var pixels_per_tick = curr.getPixelsPerTick(ts._pixels_per_milli);\n if (pixels_per_tick > optimal_tick_width) {\n if (prev == null) return curr;\n var curr_dist = Math.abs(optimal_tick_width - pixels_per_tick);\n var prev_dist = Math.abs(optimal_tick_width - pixels_per_tick);\n if (curr_dist < prev_dist) {\n return curr;\n } else {\n return prev;\n }\n }\n prev = curr;\n }\n return helpers[helpers.length - 1]; // last resort\n }\n})(TL.AxisHelper);\n\n\n/* **********************************************\n Begin TL.Timeline.js\n********************************************** */\n\n/* TimelineJS\nDesigned and built by Zach Wise at KnightLab\n\nThis Source Code Form is subject to the terms of the Mozilla Public\nLicense, v. 2.0. If a copy of the MPL was not distributed with this\nfile, You can obtain one at https://mozilla.org/MPL/2.0/.\n\n================================================== */\n/*\nTODO\n\n*/\n\n/* Required Files\nCodeKit Import\nhttps://incident57.com/codekit/\n================================================== */\n\n// CORE\n\t// @codekit-prepend \"core/TL.js\";\n\t// @codekit-prepend \"core/TL.Error.js\";\n\t// @codekit-prepend \"core/TL.Util.js\";\n\t// @codekit-prepend \"data/TL.Data.js\";\n\t// @codekit-prepend \"core/TL.Class.js\";\n\t// @codekit-prepend \"core/TL.Events.js\";\n\t// @codekit-prepend \"core/TL.Browser.js\";\n\t// @codekit-prepend \"core/TL.Load.js\";\n\t// @codekit-prepend \"core/TL.TimelineConfig.js\";\n\t// @codekit-prepend \"core/TL.ConfigFactory.js\";\n\n\n// LANGUAGE\n\t// @codekit-prepend \"language/TL.Language.js\";\n\t// @codekit-prepend \"language/TL.I18NMixins.js\";\n\n// ANIMATION\n\t// @codekit-prepend \"animation/TL.Ease.js\";\n\t// @codekit-prepend \"animation/TL.Animate.js\";\n\n// DOM\n\t// @codekit-prepend \"dom/TL.Point.js\";\n\t// @codekit-prepend \"dom/TL.DomMixins.js\";\n\t// @codekit-prepend \"dom/TL.Dom.js\";\n\t// @codekit-prepend \"dom/TL.DomUtil.js\";\n\t// @codekit-prepend \"dom/TL.DomEvent.js\";\n\t// @codekit-prepend \"dom/TL.StyleSheet.js\";\n\n// Date\n\t// @codekit-prepend \"date/TL.Date.js\";\n\t// @codekit-prepend \"date/TL.DateUtil.js\";\n\n// UI\n\t// @codekit-prepend \"ui/TL.Draggable.js\";\n\t// @codekit-prepend \"ui/TL.Swipable.js\";\n\t// @codekit-prepend \"ui/TL.MenuBar.js\";\n\t// @codekit-prepend \"ui/TL.Message.js\";\n\n// MEDIA\n\t// @codekit-prepend \"media/TL.MediaType.js\";\n\t// @codekit-prepend \"media/TL.Media.js\";\n\n// MEDIA TYPES\n\t// @codekit-prepend \"media/types/TL.Media.Blockquote.js\";\n\t// @codekit-prepend \"media/types/TL.Media.DailyMotion.js\";\n\t// @codekit-prepend \"media/types/TL.Media.DocumentCloud.js\";\n\t// @codekit-prepend \"media/types/TL.Media.Flickr.js\";\n\t// @codekit-prepend \"media/types/TL.Media.GoogleDoc.js\";\n\t// @codekit-prepend \"media/types/TL.Media.GooglePlus.js\";\n\t// @codekit-prepend \"media/types/TL.Media.IFrame.js\";\n\t// @codekit-prepend \"media/types/TL.Media.Image.js\";\n\t// @codekit-prepend \"media/types/TL.Media.Imgur.js\";\n\t// @codekit-prepend \"media/types/TL.Media.Instagram.js\";\n\t// @codekit-prepend \"media/types/TL.Media.GoogleMap.js\";\n\t// @codekit-prepend \"media/types/TL.Media.PDF.js\";\n\t// @codekit-prepend \"media/types/TL.Media.Profile.js\";\n\t// @codekit-prepend \"media/types/TL.Media.Slider.js\";\n\t// @codekit-prepend \"media/types/TL.Media.SoundCloud.js\";\n\t// @codekit-prepend \"media/types/TL.Media.Spotify.js\";\n\t// @codekit-prepend \"media/types/TL.Media.Storify.js\";\n\t// @codekit-prepend \"media/types/TL.Media.Text.js\";\n\t// @codekit-prepend \"media/types/TL.Media.Twitter.js\";\n\t// @codekit-prepend \"media/types/TL.Media.TwitterEmbed.js\";\n\t// @codekit-prepend \"media/types/TL.Media.Vimeo.js\";\n\t// @codekit-prepend \"media/types/TL.Media.Vine.js\";\n\t// @codekit-prepend \"media/types/TL.Media.Website.js\";\n\t// @codekit-prepend \"media/types/TL.Media.Wikipedia.js\";\n\t// @codekit-prepend \"media/types/TL.Media.YouTube.js\";\n\n// STORYSLIDER\n\t// @codekit-prepend \"slider/TL.Slide.js\";\n\t// @codekit-prepend \"slider/TL.SlideNav.js\";\n\t// @codekit-prepend \"slider/TL.StorySlider.js\";\n\n// TIMENAV\n\t// @codekit-prepend \"timenav/TL.TimeNav.js\";\n\t// @codekit-prepend \"timenav/TL.TimeMarker.js\";\n\t// @codekit-prepend \"timenav/TL.TimeEra.js\";\n\t// @codekit-prepend \"timenav/TL.TimeGroup.js\";\n\t// @codekit-prepend \"timenav/TL.TimeScale.js\";\n\t// @codekit-prepend \"timenav/TL.TimeAxis.js\";\n\t// @codekit-prepend \"timenav/TL.AxisHelper.js\";\n\n\nTL.Timeline = TL.Class.extend({\n\tincludes: [TL.Events, TL.I18NMixins],\n\n\t/* Private Methods\n\t================================================== */\n\tinitialize: function (elem, data, options) {\n\t\tvar self = this;\n\t\tif (!options) { options = {}};\n\t\t// Version\n\t\tthis.version = \"3.2.6\";\n\n\t\t// Ready\n\t\tthis.ready = false;\n\n\t\t// DOM ELEMENTS\n\t\tthis._el = {\n\t\t\tcontainer: {},\n\t\t\tstoryslider: {},\n\t\t\ttimenav: {},\n\t\t\tmenubar: {}\n\t\t};\n\n\t\t// Determine Container Element\n\t\tif (typeof elem === 'object') {\n\t\t\tthis._el.container = elem;\n\t\t} else {\n\t\t\tthis._el.container = TL.Dom.get(elem);\n\t\t}\n\n\t\t// Slider\n\t\tthis._storyslider = {};\n\n\t\t// Style Sheet\n\t\tthis._style_sheet = new TL.StyleSheet();\n\n\t\t// TimeNav\n\t\tthis._timenav = {};\n\n\t\t// Menu Bar\n\t\tthis._menubar = {};\n\n\t\t// Loaded State\n\t\tthis._loaded = {storyslider:false, timenav:false};\n\n\t\t// Data Object\n\t\tthis.config = null;\n\n\t\tthis.options = {\n\t\t\tscript_path: \t\t\t\t\"\",\n\t\t\theight: \t\t\t\t\tthis._el.container.offsetHeight,\n\t\t\twidth: \t\t\t\t\t\tthis._el.container.offsetWidth,\n\t\t\tdebug: \t\t\t\t\t\tfalse,\n\t\t\tis_embed: \t\t\t\t\tfalse,\n\t\t\tis_full_embed: \t\t\t\tfalse,\n\t\t\thash_bookmark: false,\n\t\t\tdefault_bg_color: \t\t\t{r:255, g:255, b:255},\n\t\t\tscale_factor: \t\t\t\t2,\t\t\t\t\t\t// How many screen widths wide should the timeline be\n\t\t\tlayout: \t\t\t\t\t\"landscape\",\t\t\t// portrait or landscape\n\t\t\ttimenav_position: \t\t\t\"bottom\",\t\t\t\t// timeline on top or bottom\n\t\t\toptimal_tick_width: \t\t60,\t\t\t\t\t\t// optimal distance (in pixels) between ticks on axis\n\t\t\tbase_class: \t\t\t\t\"tl-timeline\", \t\t// removing tl-timeline will break all default stylesheets...\n\t\t\ttimenav_height: \t\t\tnull,\n\t\t\ttimenav_height_percentage: \t25,\t\t\t\t\t\t// Overrides timenav height as a percentage of the screen\n\t\t\ttimenav_mobile_height_percentage: 40, \t\t\t\t// timenav height as a percentage on mobile devices\n\t\t\ttimenav_height_min: \t\t175,\t\t\t\t\t// Minimum timenav height\n\t\t\tmarker_height_min: \t\t\t30,\t\t\t\t\t\t// Minimum Marker Height\n\t\t\tmarker_width_min: \t\t\t100,\t\t\t\t\t// Minimum Marker Width\n\t\t\tmarker_padding: \t\t\t5,\t\t\t\t\t\t// Top Bottom Marker Padding\n\t\t\tstart_at_slide: \t\t\t0,\n\t\t\tstart_at_end: \t\t\t\tfalse,\n\t\t\tmenubar_height: \t\t\t0,\n\t\t\tskinny_size: \t\t\t\t650,\n\t\t\tmedium_size: \t\t\t\t800,\n\t\t\trelative_date: \t\t\t\tfalse,\t\t\t\t\t// Use momentjs to show a relative date from the slide.text.date.created_time field\n\t\t\tuse_bc: \t\t\t\t\tfalse,\t\t\t\t\t// Use declared suffix on dates earlier than 0\n\t\t\t// animation\n\t\t\tduration: \t\t\t\t\t1000,\n\t\t\tease: \t\t\t\t\t\tTL.Ease.easeInOutQuint,\n\t\t\t// interaction\n\t\t\tdragging: \t\t\t\t\ttrue,\n\t\t\ttrackResize: \t\t\t\ttrue,\n\t\t\tmap_type: \t\t\t\t\t\"stamen:toner-lite\",\n\t\t\tslide_padding_lr: \t\t\t100,\t\t\t\t\t// padding on slide of slide\n\t\t\tslide_default_fade: \t\t\"0%\",\t\t\t\t\t// landscape fade\n\t\t\tzoom_sequence: \t\t\t\t[0.5, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89], // Array of Fibonacci numbers for TimeNav zoom levels\n\t\t\tlanguage: \t\t\t\t\t\"en\",\n\t\t\tga_property_id: \t\t\tnull,\n\t\t\ttrack_events: \t\t\t\t['back_to_start','nav_next','nav_previous','zoom_in','zoom_out' ]\n\t\t};\n\n\t\t// Animation Objects\n\t\tthis.animator_timenav = null;\n\t\tthis.animator_storyslider = null;\n\t\tthis.animator_menubar = null;\n\n\t\t// Add message to DOM\n\t\tthis.message = new TL.Message({}, {message_class: \"tl-message-full\"}, this._el.container);\n\n\t\t// Merge Options\n\t\tif (typeof(options.default_bg_color) == \"string\") {\n\t\t\tvar parsed = TL.Util.hexToRgb(options.default_bg_color); // will clear it out if its invalid\n\t\t\tif (parsed) {\n\t\t\t\toptions.default_bg_color = parsed;\n\t\t\t} else {\n\t\t\t\tdelete options.default_bg_color\n\t\t\t\ttrace(\"Invalid default background color. Ignoring.\");\n\t\t\t}\n\t\t}\n\t\tTL.Util.mergeData(this.options, options);\n\n\t\twindow.addEventListener(\"resize\", function(e){\n\t\t\tself.updateDisplay();\n\t\t});\n\n\t\t// Set Debug Mode\n\t\tTL.debug = this.options.debug;\n\n\t\t// Apply base class to container\n\t\tTL.DomUtil.addClass(this._el.container, 'tl-timeline');\n\n\t\tif (this.options.is_embed) {\n\t\t\tTL.DomUtil.addClass(this._el.container, 'tl-timeline-embed');\n\t\t}\n\n\t\tif (this.options.is_full_embed) {\n\t\t\tTL.DomUtil.addClass(this._el.container, 'tl-timeline-full-embed');\n\t\t}\n\n\t\t// Use Relative Date Calculations\n\t\t// NOT YET IMPLEMENTED\n\t\tif(this.options.relative_date) {\n\t\t\tif (typeof(moment) !== 'undefined') {\n\t\t\t\tself._loadLanguage(data);\n\t\t\t} else {\n\t\t\t\tTL.Load.js(this.options.script_path + \"/library/moment.js\", function() {\n\t\t\t\t\tself._loadLanguage(data);\n\t\t\t\t\ttrace(\"LOAD MOMENTJS\")\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tself._loadLanguage(data);\n\t\t}\n\n\t},\n\n\t/* Load Language\n\t================================================== */\n\t_loadLanguage: function(data) {\n\t\ttry {\n\t\t this.options.language = new TL.Language(this.options);\n\t\t this._initData(data);\n\t\t} catch(e) {\n\t\t this.showMessage(e);\n\t\t}\n\t},\n\n\t_translateError: function(e) {\n\t if(e.hasOwnProperty('stack')) {\n\t trace(e.stack);\n\t }\n\t if(e.message_key) {\n\t return this._(e.message_key) + (e.detail ? ' [' + e.detail +']' : '')\n\t }\n\t return e;\n\t},\n\n\n\t/* Navigation\n\t================================================== */\n\n\t// Goto slide with id\n\tgoToId: function(id) {\n\t\tif (this.current_id != id) {\n\t\t\tthis.current_id = id;\n\t\t\tthis._timenav.goToId(this.current_id);\n\t\t\tthis._storyslider.goToId(this.current_id, false, true);\n\t\t\tthis.fire(\"change\", {unique_id: this.current_id}, this);\n\t\t}\n\t},\n\n\t// Goto slide n\n\tgoTo: function(n) {\n\t\tif(this.config.title) {\n\t\t\tif(n == 0) {\n\t\t\t\tthis.goToId(this.config.title.unique_id);\n\t\t\t} else {\n\t\t\t\tthis.goToId(this.config.events[n - 1].unique_id);\n\t\t\t}\n\t\t} else {\n\t\t\tthis.goToId(this.config.events[n].unique_id);\n\t\t}\n\t},\n\n\t// Goto first slide\n\tgoToStart: function() {\n\t\tthis.goTo(0);\n\t},\n\n\t// Goto last slide\n\tgoToEnd: function() {\n\t\tvar _n = this.config.events.length - 1;\n\t\tthis.goTo(this.config.title ? _n + 1 : _n);\n\t},\n\n\t// Goto previous slide\n\tgoToPrev: function() {\n\t\tthis.goTo(this._getSlideIndex(this.current_id) - 1);\n\t},\n\n\t// Goto next slide\n\tgoToNext: function() {\n\t\tthis.goTo(this._getSlideIndex(this.current_id) + 1);\n\t},\n\n\t/* Event maniupluation\n\t================================================== */\n\n\t// Add an event\n\tadd: function(data) {\n\t\tvar unique_id = this.config.addEvent(data);\n\n\t\tvar n = this._getEventIndex(unique_id);\n\t\tvar d = this.config.events[n];\n\n\t\tthis._storyslider.createSlide(d, this.config.title ? n+1 : n);\n\t\tthis._storyslider._updateDrawSlides();\n\n\t\tthis._timenav.createMarker(d, n);\n\t\tthis._timenav._updateDrawTimeline(false);\n\n\t\tthis.fire(\"added\", {unique_id: unique_id});\n\t},\n\n\t// Remove an event\n\tremove: function(n) {\n\t\tif(n >= 0 && n < this.config.events.length) {\n\t\t\t// If removing the current, nav to new one first\n\t\t\tif(this.config.events[n].unique_id == this.current_id) {\n\t\t\t\tif(n < this.config.events.length - 1) {\n\t\t\t\t\tthis.goTo(n + 1);\n\t\t\t\t} else {\n\t\t\t\t\tthis.goTo(n - 1);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar event = this.config.events.splice(n, 1);\n\n\t\t\tthis._storyslider.destroySlide(this.config.title ? n+1 : n);\n\t\t\tthis._storyslider._updateDrawSlides();\n\n\t\t\tthis._timenav.destroyMarker(n);\n\t\t\tthis._timenav._updateDrawTimeline(false);\n\n\t\t\tthis.fire(\"removed\", {unique_id: event[0].unique_id});\n\t\t}\n\t},\n\n\tremoveId: function(id) {\n\t\tthis.remove(this._getEventIndex(id));\n\t},\n\n\t/* Get slide data\n\t================================================== */\n\n\tgetData: function(n) {\n\t\tif(this.config.title) {\n\t\t\tif(n == 0) {\n\t\t\t\treturn this.config.title;\n\t\t\t} else if(n > 0 && n <= this.config.events.length) {\n\t\t\t\treturn this.config.events[n - 1];\n\t\t\t}\n\t\t} else if(n >= 0 && n < this.config.events.length) {\n\t\t\treturn this.config.events[n];\n\t\t}\n\t\treturn null;\n\t},\n\n\tgetDataById: function(id) {\n\t\treturn this.getData(this._getSlideIndex(id));\n\t},\n\n\t/* Get slide object\n\t================================================== */\n\n\tgetSlide: function(n) {\n\t\tif(n >= 0 && n < this._storyslider._slides.length) {\n\t\t\treturn this._storyslider._slides[n];\n\t\t}\n\t\treturn null;\n\t},\n\n\tgetSlideById: function(id) {\n\t\treturn this.getSlide(this._getSlideIndex(id));\n\t},\n\n\tgetCurrentSlide: function() {\n\t\treturn this.getSlideById(this.current_id);\n\t},\n\n\n\t/* Display\n\t================================================== */\n\tupdateDisplay: function() {\n\t\tif (this.ready) {\n\t\t\tthis._updateDisplay();\n\t\t}\n\t},\n\n \t/*\n \t\tCompute the height of the navigation section of the Timeline, taking into account\n \t\tthe possibility of an explicit height or height percentage, but also honoring the\n \t\t`timenav_height_min` option value. If `timenav_height` is specified it takes precedence over `timenav_height_percentage` but in either case, if the resultant pixel height is less than `options.timenav_height_min` then the value of `options.timenav_height_min` will be returned. (A minor adjustment is made to the returned value to account for marker padding.)\n\n \t\tArguments:\n \t\t@timenav_height (optional): an integer value for the desired height in pixels\n \t\t@timenav_height_percentage (optional): an integer between 1 and 100\n\n \t */\n\t_calculateTimeNavHeight: function(timenav_height, timenav_height_percentage) {\n\n\t\tvar height = 0;\n\n\t\tif (timenav_height) {\n\t\t\theight = timenav_height;\n\t\t} else {\n\t\t\tif (this.options.timenav_height_percentage || timenav_height_percentage) {\n\t\t\t\tif (timenav_height_percentage) {\n\t\t\t\t\theight = Math.round((this.options.height/100)*timenav_height_percentage);\n\t\t\t\t} else {\n\t\t\t\t\theight = Math.round((this.options.height/100)*this.options.timenav_height_percentage);\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\t// Set new minimum based on how many rows needed\n\t\tif (this._timenav.ready) {\n\t\t\tif (this.options.timenav_height_min < this._timenav.getMinimumHeight()) {\n\t\t\t\tthis.options.timenav_height_min = this._timenav.getMinimumHeight();\n\t\t\t}\n\t\t}\n\n\t\t// If height is less than minimum set it to minimum\n\t\tif (height < this.options.timenav_height_min) {\n\t\t\theight = this.options.timenav_height_min;\n\t\t}\n\n\t\theight = height - (this.options.marker_padding * 2);\n\n\t\treturn height;\n\t},\n\n\t/* Private Methods\n\t================================================== */\n\n\t// Update View\n\t_updateDisplay: function(timenav_height, animate, d) {\n\t\tvar duration = this.options.duration,\n\t\tdisplay_class = this.options.base_class,\n\t\tmenu_position = 0,\n\t\tself = this;\n\n\t\tif (d) {\n\t\t\tduration = d;\n\t\t}\n\n\t\t// Update width and height\n\t\tthis.options.width = this._el.container.offsetWidth;\n\t\tthis.options.height = this._el.container.offsetHeight;\n\n\t\t// Check if skinny\n\t\tif (this.options.width <= this.options.skinny_size) {\n\t\t\tdisplay_class += \" tl-skinny\";\n\t\t\tthis.options.layout = \"portrait\";\n\t\t} else if (this.options.width <= this.options.medium_size) {\n\t\t\tdisplay_class += \" tl-medium\";\n\t\t\tthis.options.layout = \"landscape\";\n\t\t} else {\n\t\t\tthis.options.layout = \"landscape\";\n\t\t}\n\n\t\t// Detect Mobile and Update Orientation on Touch devices\n\t\tif (TL.Browser.touch) {\n\t\t\tthis.options.layout = TL.Browser.orientation();\n\t\t}\n\n\t\tif (TL.Browser.mobile) {\n\t\t\tdisplay_class += \" tl-mobile\";\n\t\t\t// Set TimeNav Height\n\t\t\tthis.options.timenav_height = this._calculateTimeNavHeight(timenav_height, this.options.timenav_mobile_height_percentage);\n\t\t} else {\n\t\t\t// Set TimeNav Height\n\t\t\tthis.options.timenav_height = this._calculateTimeNavHeight(timenav_height);\n\t\t}\n\n\t\t// LAYOUT\n\t\tif (this.options.layout == \"portrait\") {\n\t\t\t// Portrait\n\t\t\tdisplay_class += \" tl-layout-portrait\";\n\n\t\t} else {\n\t\t\t// Landscape\n\t\t\tdisplay_class += \" tl-layout-landscape\";\n\n\t\t}\n\n\t\t// Set StorySlider Height\n\t\tthis.options.storyslider_height = (this.options.height - this.options.timenav_height);\n\n\t\t// Positon Menu\n\t\tif (this.options.timenav_position == \"top\") {\n\t\t\tmenu_position = ( Math.ceil(this.options.timenav_height)/2 ) - (this._el.menubar.offsetHeight/2) - (39/2) ;\n\t\t} else {\n\t\t\tmenu_position = Math.round(this.options.storyslider_height + 1 + ( Math.ceil(this.options.timenav_height)/2 ) - (this._el.menubar.offsetHeight/2) - (35/2));\n\t\t}\n\n\n\t\tif (animate) {\n\n\t\t\t// Animate TimeNav\n\n\t\t\t/*\n\t\t\tif (this.animator_timenav) {\n\t\t\tthis.animator_timenav.stop();\n\t\t\t}\n\n\t\t\tthis.animator_timenav = TL.Animate(this._el.timenav, {\n\t\t\theight: (this.options.timenav_height) + \"px\",\n\t\t\tduration: duration/4,\n\t\t\teasing: TL.Ease.easeOutStrong,\n\t\t\tcomplete: function () {\n\t\t\t//self._map.updateDisplay(self.options.width, self.options.timenav_height, animate, d, self.options.menubar_height);\n\t\t\t}\n\t\t\t});\n\t\t\t*/\n\n\t\t\tthis._el.timenav.style.height = Math.ceil(this.options.timenav_height) + \"px\";\n\n\t\t\t// Animate StorySlider\n\t\t\tif (this.animator_storyslider) {\n\t\t\t\tthis.animator_storyslider.stop();\n\t\t\t}\n\t\t\tthis.animator_storyslider = TL.Animate(this._el.storyslider, {\n\t\t\t\theight: this.options.storyslider_height + \"px\",\n\t\t\t\tduration: duration/2,\n\t\t\t\teasing: TL.Ease.easeOutStrong\n\t\t\t});\n\n\t\t\t// Animate Menubar\n\t\t\tif (this.animator_menubar) {\n\t\t\t\tthis.animator_menubar.stop();\n\t\t\t}\n\n\t\t\tthis.animator_menubar = TL.Animate(this._el.menubar, {\n\t\t\t\ttop: menu_position + \"px\",\n\t\t\t\tduration: duration/2,\n\t\t\t\teasing: TL.Ease.easeOutStrong\n\t\t\t});\n\n\t\t} else {\n\t\t\t// TimeNav\n\t\t\tthis._el.timenav.style.height = Math.ceil(this.options.timenav_height) + \"px\";\n\n\t\t\t// StorySlider\n\t\t\tthis._el.storyslider.style.height = this.options.storyslider_height + \"px\";\n\n\t\t\t// Menubar\n\t\t\tthis._el.menubar.style.top = menu_position + \"px\";\n\t\t}\n\n\t\tif (this.message) {\n\t\t\tthis.message.updateDisplay(this.options.width, this.options.height);\n\t\t}\n\t\t// Update Component Displays\n\t\tthis._timenav.updateDisplay(this.options.width, this.options.timenav_height, animate);\n\t\tthis._storyslider.updateDisplay(this.options.width, this.options.storyslider_height, animate, this.options.layout);\n\n\t\t// Apply class\n\t\tthis._el.container.className = display_class;\n\n\t},\n\n\t// Update hashbookmark in the url bar\n\t_updateHashBookmark: function(id) {\n\t\tvar hash = \"#\" + \"event-\" + id.toString();\n\t\tif (window.location.protocol != 'file:') {\n\t\t\twindow.history.replaceState(null, \"Browsing TimelineJS\", hash);\n\t\t}\n\t\tthis.fire(\"hash_updated\", {unique_id:this.current_id, hashbookmark:\"#\" + \"event-\" + id.toString()}, this);\n\t},\n\n\t/* Init\n\t================================================== */\n\t// Initialize the data\n\t_initData: function(data) {\n\t\tvar self = this;\n\n\t\tif (typeof data == 'string') {\n\t\t\tvar self = this;\n\t\t\tTL.ConfigFactory.makeConfig(data, function(config) {\n\t\t\t\tself.setConfig(config);\n\t\t\t});\n\t\t} else if (TL.TimelineConfig == data.constructor) {\n\t\t\tthis.setConfig(data);\n\t\t} else {\n\t\t\tthis.setConfig(new TL.TimelineConfig(data));\n\t\t}\n\t},\n\n\tsetConfig: function(config) {\n\t\tthis.config = config;\n\t\tthis.config.validate();\n\t\tthis._validateOptions();\n\t\tif (this.config.isValid()) {\n\t\t try {\n\t\t\t this._onDataLoaded();\n\t\t\t} catch(e) {\n\t\t\t this.showMessage(\"\"+ this._('error') +\": \" + this._translateError(e));\n\t\t\t}\n\t\t} else {\n\t\t var translated_errs = [];\n\n\t\t for(var i = 0, errs = this.config.getErrors(); i < errs.length; i++) {\n\t\t translated_errs.push(this._translateError(errs[i]));\n\t\t }\n\n\t\t\tthis.showMessage(\"\"+ this._('error') +\": \" + translated_errs.join('
'));\n\t\t\t// should we set 'self.ready'? if not, it won't resize,\n\t\t\t// but most resizing would only work\n\t\t\t// if more setup happens\n\t\t}\n\t},\n\t_validateOptions: function() {\n\t\t// assumes that this.options and this.config have been set.\n\t\tvar INTEGER_PROPERTIES = ['timenav_height', 'timenav_height_min', 'marker_height_min', 'marker_width_min', 'marker_padding', 'start_at_slide', 'slide_padding_lr' ];\n\n\t\tfor (var i = 0; i < INTEGER_PROPERTIES.length; i++) {\n\t\t\t\tvar opt = INTEGER_PROPERTIES[i];\n\t\t\t\tvar value = this.options[opt];\n\t\t\t\tvalid = true;\n\t\t\t\tif (typeof(value) == 'number') {\n\t\t\t\t\tvalid = (value == parseInt(value))\n\t\t\t\t} else if (typeof(value) == \"string\") {\n\t\t\t\t\tvalid = (value.match(/^\\s*\\-?\\d+\\s*$/));\n\t\t\t\t}\n\t\t\t\tif (!valid) {\n\t\t\t\t\tthis.config.logError({ message_key: 'invalid_integer_option', detail: opt });\n\t\t\t\t}\n\t\t}\n\t},\n\t// Initialize the layout\n\t_initLayout: function () {\n\t\tvar self = this;\n\n this.message.removeFrom(this._el.container);\n\t\tthis._el.container.innerHTML = \"\";\n\n\t\t// Create Layout\n\t\tif (this.options.timenav_position == \"top\") {\n\t\t\tthis._el.timenav\t\t= TL.Dom.create('div', 'tl-timenav', this._el.container);\n\t\t\tthis._el.storyslider\t= TL.Dom.create('div', 'tl-storyslider', this._el.container);\n\t\t} else {\n\t\t\tthis._el.storyslider \t= TL.Dom.create('div', 'tl-storyslider', this._el.container);\n\t\t\tthis._el.timenav\t\t= TL.Dom.create('div', 'tl-timenav', this._el.container);\n\t\t}\n\n\t\tthis._el.menubar\t\t\t= TL.Dom.create('div', 'tl-menubar', this._el.container);\n\n\n\t\t// Initial Default Layout\n\t\tthis.options.width = this._el.container.offsetWidth;\n\t\tthis.options.height = this._el.container.offsetHeight;\n\t\tthis._el.storyslider.style.top = \"1px\";\n\n\t\t// Set TimeNav Height\n\t\tthis.options.timenav_height = this._calculateTimeNavHeight(this.options.timenav_height);\n\n\t\t// Create TimeNav\n\t\tthis._timenav = new TL.TimeNav(this._el.timenav, this.config, this.options);\n\t\tthis._timenav.on('loaded', this._onTimeNavLoaded, this);\n\t\tthis._timenav.on('update_timenav_min', this._updateTimeNavHeightMin, this);\n\t\tthis._timenav.options.height = this.options.timenav_height;\n\t\tthis._timenav.init();\n\n // intial_zoom cannot be applied before the timenav has been created\n if (this.options.initial_zoom) {\n // at this point, this.options refers to the merged set of options\n this.setZoom(this.options.initial_zoom);\n }\n\n\t\t// Create StorySlider\n\t\tthis._storyslider = new TL.StorySlider(this._el.storyslider, this.config, this.options);\n\t\tthis._storyslider.on('loaded', this._onStorySliderLoaded, this);\n\t\tthis._storyslider.init();\n\n\t\t// Create Menu Bar\n\t\tthis._menubar = new TL.MenuBar(this._el.menubar, this._el.container, this.options);\n\n\t\t// LAYOUT\n\t\tif (this.options.layout == \"portrait\") {\n\t\t\tthis.options.storyslider_height = (this.options.height - this.options.timenav_height - 1);\n\t\t} else {\n\t\t\tthis.options.storyslider_height = (this.options.height - 1);\n\t\t}\n\n\n\t\t// Update Display\n\t\tthis._updateDisplay(this._timenav.options.height, true, 2000);\n\n\t},\n\n /* Depends upon _initLayout because these events are on things the layout initializes */\n\t_initEvents: function () {\n\t\t// TimeNav Events\n\t\tthis._timenav.on('change', this._onTimeNavChange, this);\n\t\tthis._timenav.on('zoomtoggle', this._onZoomToggle, this);\n\n\t\t// StorySlider Events\n\t\tthis._storyslider.on('change', this._onSlideChange, this);\n\t\tthis._storyslider.on('colorchange', this._onColorChange, this);\n\t\tthis._storyslider.on('nav_next', this._onStorySliderNext, this);\n\t\tthis._storyslider.on('nav_previous', this._onStorySliderPrevious, this);\n\n\t\t// Menubar Events\n\t\tthis._menubar.on('zoom_in', this._onZoomIn, this);\n\t\tthis._menubar.on('zoom_out', this._onZoomOut, this);\n\t\tthis._menubar.on('back_to_start', this._onBackToStart, this);\n\n\t},\n\n\t/* Analytics\n\t================================================== */\n\t_initGoogleAnalytics: function() {\n\t\t(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','//www.google-analytics.com/analytics.js','ga');\n\n\t\tga('create', this.options.ga_property_id, 'auto');\n\t},\n\n\t_initAnalytics: function() {\n\t\tif (this.options.ga_property_id === null) { return; }\n\t\tthis._initGoogleAnalytics();\n ga('send', 'pageview');\n\t\tvar events = this.options.track_events;\n\t\tfor (i=0; i < events.length; i++) {\n\t\t\tvar event_ = events[i];\n\t\t\tthis.addEventListener(event_, function(e) {\n\t\t\t\tga('send', 'event', e.type, 'clicked');\n\t\t\t});\n\t\t}\n\t},\n\n\t_onZoomToggle: function(e) {\n\t\tif (e.zoom == \"in\") {\n\t\t\tthis._menubar.toogleZoomIn(e.show);\n\t\t} else if (e.zoom == \"out\") {\n\t\t\tthis._menubar.toogleZoomOut(e.show);\n\t\t}\n\n\t},\n\n\t/* Get index of event by id\n\t================================================== */\n\t_getEventIndex: function(id) {\n\t\tfor(var i = 0; i < this.config.events.length; i++) {\n\t\t\tif(id == this.config.events[i].unique_id) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t},\n\n\t/* Get index of slide by id\n\t================================================== */\n\t_getSlideIndex: function(id) {\n\t\tif(this.config.title && this.config.title.unique_id == id) {\n\t\t\treturn 0;\n\t\t}\n\t\tfor(var i = 0; i < this.config.events.length; i++) {\n\t\t\tif(id == this.config.events[i].unique_id) {\n\t\t\t\treturn this.config.title ? i+1 : i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t},\n\n\t/* Events\n\t================================================== */\n\n\t_onDataLoaded: function(e) {\n\t\tthis.fire(\"dataloaded\");\n\t\tthis._initLayout();\n\t\tthis._initEvents();\n\t\tthis._initAnalytics();\n\t\tif (this.message) {\n\t\t\tthis.message.hide();\n\t\t}\n\n\t\tthis.ready = true;\n\n\t},\n\n\tshowMessage: function(msg) {\n\t\tif (this.message) {\n\t\t\tthis.message.updateMessage(msg);\n\t\t} else {\n\t\t\ttrace(\"No message display available.\")\n\t\t\ttrace(msg);\n\t\t}\n\t},\n\n\t_onColorChange: function(e) {\n\t\tthis.fire(\"color_change\", {unique_id:this.current_id}, this);\n\t\tif (e.color || e.image) {\n\n\t\t} else {\n\n\t\t}\n\t},\n\n\t_onSlideChange: function(e) {\n\t\tif (this.current_id != e.unique_id) {\n\t\t\tthis.current_id = e.unique_id;\n\t\t\tthis._timenav.goToId(this.current_id);\n\t\t\tthis._onChange(e);\n\t\t}\n\t},\n\n\t_onTimeNavChange: function(e) {\n\t\tif (this.current_id != e.unique_id) {\n\t\t\tthis.current_id = e.unique_id;\n\t\t\tthis._storyslider.goToId(this.current_id);\n\t\t\tthis._onChange(e);\n\t\t}\n\t},\n\n\t_onChange: function(e) {\n\t\tthis.fire(\"change\", {unique_id:this.current_id}, this);\n\t\tif (this.options.hash_bookmark && this.current_id) {\n\t\t\tthis._updateHashBookmark(this.current_id);\n\t\t}\n\t},\n\n\t_onBackToStart: function(e) {\n\t\tthis._storyslider.goTo(0);\n\t\tthis.fire(\"back_to_start\", {unique_id:this.current_id}, this);\n\t},\n\n\t/**\n\t * Zoom in and zoom out should be part of the public API.\n\t */\n\tzoomIn: function() {\n\t this._timenav.zoomIn();\n\t},\n\tzoomOut: function() {\n\t this._timenav.zoomOut();\n\t},\n\n\tsetZoom: function(level) {\n\t this._timenav.setZoom(level);\n\t},\n\n\t_onZoomIn: function(e) {\n\t\tthis._timenav.zoomIn();\n\t\tthis.fire(\"zoom_in\", {zoom_level:this._timenav.options.scale_factor}, this);\n\t},\n\n\t_onZoomOut: function(e) {\n\t\tthis._timenav.zoomOut();\n\t\tthis.fire(\"zoom_out\", {zoom_level:this._timenav.options.scale_factor}, this);\n\t},\n\n\t_onTimeNavLoaded: function() {\n\t\tthis._loaded.timenav = true;\n\t\tthis._onLoaded();\n\t},\n\n\t_onStorySliderLoaded: function() {\n\t\tthis._loaded.storyslider = true;\n\t\tthis._onLoaded();\n\t},\n\n\t_onStorySliderNext: function(e) {\n\t\tthis.fire(\"nav_next\", e);\n\t},\n\n\t_onStorySliderPrevious: function(e) {\n\t\tthis.fire(\"nav_previous\", e);\n\t},\n\n\t_onLoaded: function() {\n\t\tif (this._loaded.storyslider && this._loaded.timenav) {\n\t\t\tthis.fire(\"loaded\", this.config);\n\t\t\t// Go to proper slide\n\t\t\tif (this.options.hash_bookmark && window.location.hash != \"\") {\n\t\t\t\tthis.goToId(window.location.hash.replace(\"#event-\", \"\"));\n\t\t\t} else {\n\t\t\t\tif(this.options.start_at_end == \"true\" || this.options.start_at_slide > this.config.events.length ) {\n\t\t\t\t\tthis.goToEnd();\n\t\t\t\t} else {\n\t\t\t\t\tthis.goTo(this.options.start_at_slide);\n\t\t\t\t}\n\t\t\t\tif (this.options.hash_bookmark ) {\n\t\t\t\t\tthis._updateHashBookmark(this.current_id);\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t}\n\n});\n\nTL.Timeline.source_path = (function() {\n\tvar script_tags = document.getElementsByTagName('script');\n\tvar src = script_tags[script_tags.length-1].src;\n\treturn src.substr(0,src.lastIndexOf('/'));\n})();\n\n","!function(t){\"use strict\";function e(t,s,n,i,a,r,l,c){var o,d,f,h,g,p=function(t){r.text(t),r[c?\"prepend\":\"append\"](l)};return c?(o=0===i?\"\":n.slice(-i),d=n.slice(-a)):(o=n.slice(0,i),d=n.slice(0,a)),sh?a:(f=parseInt((i+a)/2,10),o=c?n.slice(-f):n.slice(0,f),p(o),r[t]()===s?f:(r[t]()>s?a=f-1:i=f+1,e(t,s,n,i,a,r,l,c))))}t.fn.truncate=function(s){s&&s.center&&!s.side&&(s.side=\"center\",delete s.center),s&&!/^(left|right|center)$/.test(s.side)&&delete s.side;var n={width:\"auto\",token:\"…\",side:\"right\",addclass:!1,addtitle:!1,multiline:!1,assumeSameStyle:!1};s=t.extend(n,s);var i,a,r,l;return s.assumeSameStyle&&(a=t(this[0]),i={fontFamily:a.css(\"fontFamily\"),fontSize:a.css(\"fontSize\"),fontStyle:a.css(\"fontStyle\"),fontWeight:a.css(\"fontWeight\"),\"font-variant\":a.css(\"font-variant\"),\"text-indent\":a.css(\"text-indent\"),\"line-height\":a.css(\"line-height\"),\"text-transform\":a.css(\"text-transform\"),\"letter-spacing\":a.css(\"letter-spacing\"),\"word-spacing\":a.css(\"word-spacing\"),display:\"none\"},r=t(\"\").css(i).appendTo(\"body\")),this.each(function(){a=t(this),l=a.text(),s.assumeSameStyle?r.text(l):(i={fontFamily:a.css(\"fontFamily\"),fontSize:a.css(\"fontSize\"),fontStyle:a.css(\"fontStyle\"),fontWeight:a.css(\"fontWeight\"),\"font-variant\":a.css(\"font-variant\"),\"text-indent\":a.css(\"text-indent\"),\"line-height\":a.css(\"line-height\"),\"text-transform\":a.css(\"text-transform\"),\"letter-spacing\":a.css(\"letter-spacing\"),\"word-spacing\":a.css(\"word-spacing\"),display:\"none\"},r=t(\"\").css(i).text(l).appendTo(\"body\"));var n,c,o,d=r.width(),f=parseInt(s.width,10)||a.width(),h=\"width\";if(s.multiline?(r.width(a.width()),h=\"height\",c=r.height(),o=a.height()+1):(c=d,o=f),n={before:\"\",after:\"\"},c>o){var g,p;r.text(\"\"),\"left\"===s.side?(g=e(h,o,l,0,l.length,r,s.token,!0),n.after=l.slice(-1*g)):\"center\"===s.side?(o=parseInt(o/2,10)-1,g=e(h,o,l,0,l.length,r,s.token,!1),p=e(h,o,l,0,l.length,r,\"\",!0),n.before=l.slice(0,g),n.after=l.slice(-1*p)):\"right\"===s.side&&(g=e(h,o,l,0,l.length,r,s.token,!1),n.before=l.slice(0,g)),s.addclass&&a.addClass(s.addclass),s.addtitle&&a.attr(\"title\",l),n.before=r.text(n.before).html(),n.after=r.text(n.after).html(),a.empty().html(n.before+s.token+n.after)}s.assumeSameStyle||r.remove()})}}(jQuery);","!function(a){\"use strict\";function b(a){return new RegExp(\"(^|\\\\s+)\"+a+\"(\\\\s+|$)\")}function c(a,b){var c=d(a,b)?f:e;c(a,b)}var d,e,f;\"classList\"in document.documentElement?(d=function(a,b){return a.classList.contains(b)},e=function(a,b){a.classList.add(b)},f=function(a,b){a.classList.remove(b)}):(d=function(a,c){return b(c).test(a.className)},e=function(a,b){d(a,b)||(a.className=a.className+\" \"+b)},f=function(a,c){a.className=a.className.replace(b(c),\" \")});var g={hasClass:d,addClass:e,removeClass:f,toggleClass:c,has:d,add:e,remove:f,toggle:c};\"function\"==typeof define&&define.amd?define(g):a.classie=g}(window);","/**\n * webfonts.js\n *\n * Load Webfonts to use on the site. Uses the Web Font Loader asynchronously.\n *\n * You can set your default Font Stack in scss/_settings.scss.\n * Documentation: https://github.com/typekit/webfontloader and https://developers.google.com/speed/libraries/devguide#webfont\n */\n\n WebFontConfig = {\n typekit: { id: 'dfj6umg' }\n };\n \n\n(function() {\n\tvar wf = document.createElement('script');\n\twf.src = ('https:' === document.location.protocol ? 'https' : 'http') +\n\t\t\t'://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';\n\twf.type = 'text/javascript';\n\twf.async = 'true';\n\tvar s = document.getElementsByTagName('script')[0];\n\ts.parentNode.insertBefore(wf, s);\n})();\n","/**\n * skip-link-focus-fix.js\n *\n * Skip Link Focus Fix\n * This fixes the focus problem in Opera and Webkit browsers when using skiplinks.\n */\n\n( function() {\n\tvar is_webkit = navigator.userAgent.toLowerCase().indexOf( 'webkit' ) > -1,\n\t\tis_opera = navigator.userAgent.toLowerCase().indexOf( 'opera' ) > -1,\n\t\tis_ie = navigator.userAgent.toLowerCase().indexOf( 'msie' ) > -1;\n\n\tif ( ( is_webkit || is_opera || is_ie ) && document.getElementById && window.addEventListener ) {\n\t\twindow.addEventListener( 'hashchange', function() {\n\t\t\tvar element = document.getElementById( location.hash.substring( 1 ) );\n\n\t\t\tif ( element ) {\n\t\t\t\tif ( ! /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) )\n\t\t\t\t\telement.tabIndex = -1;\n\n\t\t\t\telement.focus();\n\t\t\t}\n\t\t}, false );\n\t}\n})();\n","/**\n * custom.js\n *\n * Custom JavaScript (jQuery) code for the Application.\n */\n\n/**\n * Executes the JavaScript code when the DOM is ready to be used.\n * By passing the $ you can code using the $ alias for jQuery.\n * Inside of this function, $() will work as an alias for jQuery()\n * and other libraries also using $ will not be accessible under this shortcut\n */\n(function ($) {\n\n\t// Initialize the Foundation JavaScript\n\t// Documentation can be found at: http://foundation.zurb.com/docs\n\t$(document).foundation();\n\n\t/*************************************************\n\t *\n\t * Move sidebar below article on mobile-screens\n\t *\n\t ************************************************/\n\tif ($(window).width() < 1024) {\n\t\t$(\".single-post .post-sidebar-content\").insertBefore(\".single-post .entry-meta.singlearticle\");\n\t}\n\n\t/*************************************************\n\t *\n\t * Open all external links in new browser window\n\t *\n\t ************************************************/\n\t$('.entry-content p a').each(function() {\n\t\tvar a = new RegExp('/' + window.location.host + '/');\n\t\tif(!a.test(this.href)) {\n\t\t\t$(this).click(function(event) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tevent.stopPropagation();\n\t\t\t\twindow.open(this.href, '_blank');\n\t\t\t});\n\t\t}\n\t});\n\n\t/*************************************************\n\t *\n\t * Mobile slideout navigation\n\t *\n\t ************************************************/\n\t$(document).ready(function () {\n\n\t\tif ($(window).width() < 1024) {\n\t\t\t$(\"ul.menu > li.menu-item-has-children > i\").click(function () {\n\t\t\t\tconsole.log(\"nivå 1\");\n\t\t\t\t$(this).parent('li').siblings().find(\".sub-menu\").slideUp(\"fast\");\n\t\t\t\t$(this).parent('li').siblings().removeClass('open');\n\t\t\t\t$(this).parent('li').toggleClass('open');\n\t\t\t\t$(this).parent('li').find('> .sub-menu').slideToggle('fast');\n\t\t\t});\n\n\t\t\t$(\".menu-item-has-children li i\").click(function () {\n\t\t\t\tconsole.log(\"nivå 2\");\n\t\t\t\t$(this).parent('li').toggleClass('open').find('.sub-menu').slideToggle('fast');\n\t\t\t});\n\n\n\t\t\tvar body = document.body,\n\t\t\t\tmask = document.createElement(\"div\"),\n\t\t\t\ttoggleSlideRight = document.querySelector(\".toggle-slide-right\"),\n\t\t\t\tslideMenuRight = document.querySelector(\".slide-menu-right\"),\n\t\t\t\tactiveNav;\n\n\t\t\tmask.className = \"mask\";\n\n\t\t\t/* slide menu right */\n\t\t\tif (toggleSlideRight) {\n\t\t\t\ttoggleSlideRight.addEventListener(\"click\", function () {\n\t\t\t\t\tclassie.add(body, \"smr-open\");\n\t\t\t\t\tdocument.body.appendChild(mask);\n\t\t\t\t\tactiveNav = \"smr-open\";\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t/* hide active menu if mask is clicked */\n\t\t\tif (mask) {\n\t\t\t\tmask.addEventListener(\"click\", function () {\n\t\t\t\t\tclassie.remove(body, activeNav);\n\t\t\t\t\tactiveNav = \"\";\n\t\t\t\t\tdocument.body.removeChild(mask);\n\t\t\t\t});\n\t\t\t}\n\n\n\t\t\t/* hide active menu if close menu button is clicked */\n\t\t\t[].slice.call(document.querySelectorAll(\".close-menu\")).forEach(function (el, i) {\n\t\t\t\tel.addEventListener(\"click\", function () {\n\t\t\t\t\tclassie.remove(body, activeNav);\n\t\t\t\t\tactiveNav = \"\";\n\t\t\t\t\tdocument.body.removeChild(mask);\n\t\t\t\t});\n\t\t\t});\n\t\t\t[].slice.call(document.querySelectorAll(\"nav.slide-menu-right li a\")).forEach(function (el, i) {\n\t\t\t\tel.addEventListener(\"click\", function () {\n\t\t\t\t\tclassie.remove(body, activeNav);\n\t\t\t\t\tactiveNav = \"\";\n\t\t\t\t\tdocument.body.removeChild(mask);\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t});\n\n\t/*************************************************\n\t *\n\t * Sticky header on scroll\n\t *\n\t ************************************************/\n\t$(window).scroll(function () {\n\t\tvar scroll = $(window).scrollTop();\n\n\t\tif (scroll >= 1) {\n\t\t\t$(\".site-header\").not('.map-header').addClass(\"sticky\");\n\t\t} else {\n\t\t\t$(\".site-header\").not('.map-header').removeClass(\"sticky\");\n\t\t}\n\t});\n\n\t/*************************************************\n\t *\n\t * Social Links in footer open popup\n\t *\n\t ************************************************/\n\t$(document).ready(function ($) {\n\t\t$('.social-link').click(function () {\n\t\t\tvar NWin = window.open($(this).prop('href'), '', 'scrollbars=1,height=600,width=600');\n\n\t\t\tif (window.focus) {\n\t\t\t\tNWin.focus();\n\t\t\t}\n\n\t\t\treturn false;\n\t\t});\n\t});\n\n\t/*************************************************\n\t *\n\t * Sorting of posts without form submission(on select change)\n\t *\n\t ************************************************/\n\t$(document).ready(function ($) {\n\t\t$('#sort-submit').hide();\n\t\t$('#sort').change(function () {\n\t\t\t$('form.form-search').submit();\n\t\t});\n\t});\n\n\t/*************************************************\n\t *\n\t * Smooth scroll to anchor\n\t *\n\t ************************************************/\n\t$(function () {\n\t\t$('a[href*=#]:not([href=#])').click(function () {\n\t\t\tif (this.hash.indexOf('/') > -1) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (location.pathname.replace(/^\\//, '') == this.pathname.replace(/^\\//, '') && location.hostname == this.hostname) {\n\t\t\t\tvar target = $(this.hash);\n\t\t\t\ttarget = target.length ? target : $('[name=' + this.hash.slice(1) + ']');\n\t\t\t\tif (target.length) {\n\t\t\t\t\t$('html,body').animate({\n\t\t\t\t\t\tscrollTop: target.offset().top - 300\n\t\t\t\t\t}, 1000);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n\n\t/*************************************************\n\t *\n\t * Slidedown searchform in topbar\n\t *\n\t ************************************************/\n\tvar searchvisible = 0;\n\t$(\"#search-menu\").click(function (e) {\n\t\t//This stops the page scrolling to the top on a # link.\n\t\te.preventDefault();\n\n\t\tif (searchvisible === 0) {\n\t\t\t//Search is currently hidden. Slide down and show it.\n\t\t\t$(\"#search-form\").slideDown(200);\n\t\t\t$(\"#s\").focus(); //Set focus on the search input field.\n\t\t\tsearchvisible = 1; //Set search visible flag to visible.\n\t\t} else {\n\t\t\t//Search is currently showing. Slide it back up and hide it.\n\t\t\t$(\"#search-form\").slideUp(200);\n\t\t\tsearchvisible = 0;\n\t\t}\n\t});\n\n\t/*************************************************\n\t *\n\t * ACF GOOGLE MAPS\n\t *\n\t ************************************************/\n\t/**\n\t * render_map\n\t *\n\t * This function will render a Google Map onto the selected jQuery element\n\t *\n\t * @type function\n\t * @date 8/11/2013\n\t * @since 4.3.0\n\t *\n\t * @param $el (jQuery element)\n\t * @return n/a\n\t */\n\tfunction render_map($el) {\n\t\t// var\n\t\tvar $markers = $el.find('.marker');\n\n\t\t// vars\n\t\tvar args = {\n\t\t\tzoom: 11,\n\t\t\tcenter: new google.maps.LatLng(0, 0),\n\t\t\tmapTypeId: google.maps.MapTypeId.ROADMAP,\n\t\t\tdisableDefaultUI: true,\n\t\t\tstyles: [\n\t\t\t\t{\n\t\t\t\t\t\"featureType\": \"water\",\n\t\t\t\t\t\"elementType\": \"all\",\n\t\t\t\t\t\"stylers\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"color\": \"#8cc0c3\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"featureType\": \"water\",\n\t\t\t\t\t\"elementType\": \"labels.text.fill\",\n\t\t\t\t\t\"stylers\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"hue\": \"#ff0000\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t]\n\t\t};\n\n\t\t// create map\t \t\n\t\tvar map = new google.maps.Map($el[0], args);\n\n\t\t// add a markers reference\n\t\tmap.markers = [];\n\n\t\t// add markers\n\t\t$markers.each(function () {\n\t\t\tadd_marker($(this), map);\n\t\t});\n\n\t\t// center map\n\t\tcenter_map(map);\n\t}\n\n\t/**\n\t * add_marker\n\t *\n\t * This function will add a marker to the selected Google Map\n\t *\n\t * @type function\n\t * @date 8/11/2013\n\t * @since 4.3.0\n\t *\n\t * @param $marker (jQuery element)\n\t * @param map (Google Map object)\n\t * @return n/a\n\t */\n\tfunction add_marker($marker, map) {\n\t\t// var\n\t\tvar latlng = new google.maps.LatLng($marker.attr('data-lat'), $marker.attr('data-lng'));\n\n\t\t// create marker\n\t\tvar marker = new google.maps.Marker({\n\t\t\tposition: latlng,\n\t\t\tmap: map\n\t\t});\n\n\t\t// add to array\n\t\tmap.markers.push(marker);\n\n\t\t// if marker contains HTML, add it to an infoWindow\n\t\tif ($marker.html()) {\n\t\t\t// create info window\n\t\t\tvar infowindow = new google.maps.InfoWindow({\n\t\t\t\tcontent: $marker.html()\n\t\t\t});\n\n\t\t\t// show info window when marker is clicked\n\t\t\tgoogle.maps.event.addListener(marker, 'click', function () {\n\t\t\t\tinfowindow.open(map, marker);\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * center_map\n\t *\n\t * This function will center the map, showing all markers attached to this map\n\t *\n\t * @type function\n\t * @date 8/11/2013\n\t * @since 4.3.0\n\t *\n\t * @param map (Google Map object)\n\t * @return n/a\n\t */\n\tfunction center_map(map) {\n\t\t// vars\n\t\tvar bounds = new google.maps.LatLngBounds();\n\n\t\t// loop through all markers and create bounds\n\t\t$.each(map.markers, function (i, marker) {\n\n\t\t\tvar latlng = new google.maps.LatLng(marker.position.lat(), marker.position.lng());\n\n\t\t\tbounds.extend(latlng);\n\n\t\t});\n\n\t\t// only 1 marker?\n\t\tif (map.markers.length == 1) {\n\t\t\t// set center of map\n\t\t\tmap.setCenter(bounds.getCenter());\n\t\t\tmap.setZoom(11);\n\t\t}\n\t\telse {\n\t\t\t// fit to bounds\n\t\t\tmap.fitBounds(bounds);\n\t\t}\n\t}\n\n\t/**\n\t * document ready\n\t *\n\t * This function will render each map when the document is ready (page has loaded)\n\t *\n\t * @type function\n\t * @date 8/11/2013\n\t * @since 5.0.0\n\t *\n\t * @param n/a\n\t * @return n/a\n\t */\n\t$(document).ready(function () {\n\t\t$('.acf-map').each(function () {\n\t\t\trender_map($(this));\n\t\t});\n\n\t\t$('.posts-map').each(function () {\n\t\t\trender_map($(this));\n\t\t});\n\t});\n})(jQuery);\n","(function ($) {\n var LightBox = window.lightbox;\n $('body').on('click', 'a', function (e) {\n $img = $(this).find('img');\n var useLightBox = $(this).parent().hasClass('wp-caption') || $(this).parent().hasClass('gallery-icon');\n useLightBox = useLightBox && ($(this).attr('href').match(/\\.(jpeg|jpg|gif|png)$/) != null);\n\n if ($img.length != 0 && useLightBox) {\n e.stopPropagation();\n e.preventDefault();\n\n $captionText = $(this).parent().find('.wp-caption-text');\n if ($captionText.length > 0) {\n $(e.currentTarget).attr('data-title', $($captionText).text());\n }\n\n $(e.currentTarget).attr('rel', 'lighbox');\n LightBox.start($(e.currentTarget));\n\n return false;\n }\n });\n})(jQuery);\n","var postmap_settings = {\n clusterIcon:Sorsamisk.themeUrl + '/images/icons/icon-cluster-scaled.png',\n mapStyle: [{\n \"elementType\": \"geometry\",\n \"stylers\": [{\"hue\": \"#ff4400\"}, {\"saturation\": -68}, {\"lightness\": -4}, {\"gamma\": 0.72}]\n }, {\"featureType\": \"road\", \"elementType\": \"labels.icon\"}, {\n \"featureType\": \"landscape.man_made\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\"hue\": \"#0077ff\"}, {\"gamma\": 3.1}]\n }, {\n \"featureType\": \"water\",\n \"stylers\": [{\"hue\": \"#00ccff\"}, {\"gamma\": 0.44}, {\"saturation\": -33}]\n }, {\n \"featureType\": \"poi.park\",\n \"stylers\": [{\"hue\": \"#44ff00\"}, {\"saturation\": -23}]\n }, {\n \"featureType\": \"water\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\"hue\": \"#007fff\"}, {\"gamma\": 0.77}, {\"saturation\": 65}, {\"lightness\": 99}]\n }, {\n \"featureType\": \"water\",\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [{\"gamma\": 0.11}, {\"weight\": 5.6}, {\"saturation\": 99}, {\"hue\": \"#0091ff\"}, {\"lightness\": -86}]\n }, {\n \"featureType\": \"transit.line\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\"lightness\": -48}, {\"hue\": \"#ff5e00\"}, {\"gamma\": 1.2}, {\"saturation\": -23}]\n }, {\n \"featureType\": \"transit\",\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [{\"saturation\": -64}, {\"hue\": \"#ff9100\"}, {\"lightness\": 16}, {\"gamma\": 0.47}, {\"weight\": 2.7}]\n }]\n};","(function ($) {\n\tif (typeof smartlabs == 'undefined' || !$('.postmap-wrapper').length) {\n\t\treturn;\n\t}\n\n\t/**\n\t * Search / Compare helper\n\t */\n\tvar Should = smartlabs.utility.Should;\n\n\t/**\n\t * The map handler.\n\t *\n\t * @type {smartlabs.PostMap}\n\t */\n\tvar postMap = new smartlabs.PostMap('.postmap', postmap_settings);\n\n\t/**\n\t * Single template object.\n\t *\n\t * @type {smartlabs.Template}\n\t */\n\tvar postSingleView = new smartlabs.Template($('#post-map-single-post'), $('.postmap-single'));\n\n\t/**\n\t * Archive template object.\n\t *\n\t * @type {smartlabs.Template}\n\t */\n\tvar postListView = new smartlabs.Template($('#post-map-list-post'), $('.postmap-archive'));\n\tvar filterSearchString = \"\";\n\tvar filterObject = {};\n\tvar termArray = [];\n\tvar allPosts = [];\n\n\t/**\n\t * Stores the post id to post position for faster lookup.\n\t *\n\t * @type {{}}\n\t */\n\tvar idPostIndexer = {};\n\n\tvar categoryHashSelector = 'kategori';\n\tvar searchHashSelector = 'search';\n\tvar postHashSelector = 'post';\n\n\tfunction get_post_by_id(id) {\n\t\tif (typeof idPostIndexer[id] == 'undefined') {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (typeof allPosts[idPostIndexer[id]] == 'undefined') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn allPosts[idPostIndexer[id]];\n\t}\n\n\t/**\n\t * Register a click event on the postSingleView template.\n\t */\n\tpostSingleView.addEvent('click', '.header button', function ($template, data, e) {\n\t\t$($template).parent().hide();\n\t\twindow.location.hash = '';\n\t});\n\n\t/**\n\t * Register a click event on the postSingleView template.\n\t */\n\tpostSingleView.addEvent('click', '.related-articles a', function ($template, data, e, element) {\n\t\tvar postID = $(element).data('post-id');\n\t\tvar post = get_post_by_id(postID);\n\t\tif (!post) {\n\t\t\treturn;\n\t\t}\n\n\t\tshow_single_post_view(post);\n\t});\n\n\t/**\n\t * Register a hover event on the postListView template.\n\t */\n\tpostListView.addEvent('mouseenter mouseleave', '', function ($template, data, e) {\n\t\t$($template).toggleClass('hover');\n\t\tvar marker = postMap.getMarkerByPostId(data.ID);\n\t\tif (marker == null) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (marker.active === true) {\n\t\t\tmarker.active = false;\n\t\t\tmarker.setIcon(marker.iconDefault);\n\t\t} else {\n\t\t\tmarker.active = true;\n\t\t\tmarker.setIcon(marker.iconActive);\n\t\t}\n\t});\n\n\t/**\n\t * Register a click event on the postListView template.\n\t */\n\tpostListView.addEvent('click', '.action-show-single', function ($template, data, e) {\n\t\tshow_single_post_view(data);\n\t});\n\n\t/**\n\t * Register a click event on the postListView template.\n\t */\n\tpostListView.addEvent('click', 'h2', function ($template, data, e) {\n\t\tshow_single_post_view(data);\n\t});\n\n\t/**\n\t * Register a click event on the postListView template.\n\t */\n\tpostListView.addEvent('click', '.action-show-on-map', function ($template, data, e) {\n\t\tvar marker = postMap.getMarkerByPostId(data.ID);\n\t\tif (marker == null) {\n\t\t\treturn false;\n\t\t}\n\n\t\tpostMap.focusOnMarker(marker);\n\t});\n\n\n\t/**\n\t * Register a on rendered event on the postListView template.\n\t */\n\tpostListView.setRenderEvent(function ($template, data) {\n\t\t$template.find('.excerpt').truncate({\n\t\t\twidth: $template.find('.excerpt').width() - 50,\n\t\t\ttoken: '…',\n\t\t\tside: 'right',\n\t\t\tmultiline: false\n\t\t});\n\t});\n\n\t/**\n\t * Fetch a reference to the smartlabs.models.Post object.\n\t */\n\tvar Post = smartlabs.models.Post;\n\n\t/**\n\t * Add functionality to the Post object.\n\t *\n\t * @type {{click: smartlabs.models.Post.events.click, hover: smartlabs.models.Post.events.hover}}\n\t */\n\tPost.prototype.events = {\n\t\tclick: function (post, marker) {\n\t\t\tshow_single_post_view(post);\n\t\t\tpostMap.map.panTo(marker.getPosition());\n\t\t},\n\t\thover: function (post, marker) {\n\t\t\t$postElement = $('#post-map-list-' + post.ID);\n\t\t\tif (marker.active === true) {\n\t\t\t\t$postElement.addClass('active');\n\t\t\t} else {\n\t\t\t\t$postElement.removeClass('active');\n\t\t\t}\n\t\t}\n\t};\n\n\t/**\n\t * Gets the basic share url\n\t * @returns {string}\n\t */\n\tPost.prototype.getShareUrl = function () {\n\t\treturn Sorsamisk.currentUrl + '%23/' + this.ID + '/';\n\t};\n\n\t/**\n\t * Generates the html for the share links.\n\t * @returns {string}\n\t */\n\tPost.prototype.shareLinks = function () {\n\t\tvar url = this.getShareUrl();\n\t\treturn '
' +\n\t\t\t' ';\n\t};\n\n\t/**\n\t * Generates the html for the related posts.\n\t * @returns {*}\n\t */\n\tPost.prototype.relatedPostsView = function () {\n\t\tif (!this.relatedPostIds) {\n\t\t\treturn '';\n\t\t}\n\t\tvar showRelatedPostsView = false;\n\t\tvar html = '
' +\n\t\t\t' ';\n\t\tif (!showRelatedPostsView) {\n\t\t\treturn '';\n\t\t}\n\n\t\treturn html;\n\t};\n\n\t/**\n\t * Register click events for the filters\n\t */\n\t$('body').on('click', '.postmap-filters .trigger', function (e) {\n\t\t$(this).parent().toggleClass('active');\n\t}).on('click', '.postmap-categories-list button', function (e) {\n\t\tvar value = $(this).attr('value');\n\n\t\tif (value == 'all') {\n\t\t\t$('.postmap-categories-list button').removeClass('active');\n\t\t\t$(this).addClass('active');\n\t\t\ttermArray = [];\n\t\t\tfilter_posts();\n\t\t\treturn;\n\t\t} else {\n\t\t\t$('.postmap-categories-list button.all').removeClass('active');\n\t\t}\n\n\t\tvar termIndex = termArray.indexOf(value);\n\t\tif (termIndex > -1) {\n\t\t\t$(this).removeClass('active');\n\t\t\ttermArray.splice(termIndex, 1);\n\t\t} else {\n\t\t\t$(this).addClass('active');\n\t\t\ttermArray.push(value);\n\t\t}\n\n\t\tfilter_posts();\n\t}).on('change', '#map-search', function (e) {\n\t\tfilterSearchString = $(this).attr('value');\n\t\tfilter_posts();\n\t});\n\n\t$('.postmap-wrapper').height($(window).height() - $('#masthead').outerHeight());\n\n\t/**\n\t * This display the single view overlay for the posts.\n\t * @param data\n\t * @returns {boolean}\n\t */\n\tfunction show_single_post_view(data) {\n\t\twindow.location.hash = '#/post/' + data.ID + '/';\n\t\tpostSingleView.$container.scrollTop(0);\n\t\tvar marker = postMap.getMarkerByPostId(data.ID);\n\t\tif (marker == null) {\n\t\t\tpostSingleView.clear();\n\t\t\tpostSingleView.render(data);\n\t\t\tpostSingleView.$container.show();\n\t\t\treturn false;\n\t\t}\n\n\t\tpostSingleView.clear();\n\t\tpostSingleView.render(data);\n\t\tpostSingleView.$container.show();\n\t\t$('.native-slider').slick({\n\t\t\tinfinite: true,\n\t\t\tslidesToShow: 1,\n\t\t\tslidesToScroll: 1,\n\t\t\tdots: false,\n\t\t\tarrows: true,\n\t\t\tautoplay: true,\n\t\t\tautoplaySpeed: 6000,\n\t\t\tprevArrow: '',\n\t\t\tnextArrow: '',\n\t\t});\n\t}\n\n\t/**\n\t * Filters the posts based on the global filtering object.\n\t */\n\tfunction filter_posts() {\n\t\tvar doFilter = false;\n\t\tvar filterObject = {};\n\t\tif (filterSearchString) {\n\t\t\tfilterObject.post_title = Should.contain(filterSearchString);\n\t\t\tdoFilter = true;\n\t\t}\n\n\t\tif (termArray.length > 0) {\n\t\t\tfilterObject.categories = Should.mergeKeyVal('term_id', Should.containOneOf(termArray));\n\t\t\tdoFilter = true;\n\t\t}\n\n\t\tif (!doFilter) {\n\t\t\trender_posts(allPosts);\n\t\t\treturn;\n\t\t}\n\n\t\tvar filteredPosts = [];\n\t\tfor (var i = 0; i < allPosts.length; i++) {\n\t\t\tif (allPosts[i].conformTo(filterObject)) {\n\t\t\t\tfilteredPosts.push(allPosts[i]);\n\t\t\t}\n\t\t}\n\n\t\trender_posts(filteredPosts);\n\t}\n\n\n\t/**\n\t * Parses the hash url, and 'navigates' to the correct post/map position.\n\t */\n\tfunction parse_url() {\n\t\tvar hash = window.location.hash;\n\n\t\tvar urlArray = hash.split('/');\n\n\t\tvar urlCategoriesArray = [];\n\t\tvar urlSearchArray = [];\n\t\tvar postSelectArray = [];\n\t\tvar urlMode = '';\n\t\tvar onMap = false;\n\n\t\tfor (var i in urlArray) {\n\t\t\tif (!urlArray[i]) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (urlArray[i] == categoryHashSelector) {\n\t\t\t\turlMode = 'category';\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (urlArray[i] == searchHashSelector) {\n\t\t\t\turlMode = 'search';\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (urlArray[i] == postHashSelector) {\n\t\t\t\turlMode = 'post';\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (urlArray[i] == 'map') {\n\t\t\t\tonMap = true;\n\t\t\t}\n\n\n\t\t\tif (urlMode == 'search') {\n\t\t\t\turlSearchArray.push(urlArray[i]);\n\t\t\t} else if (urlMode == 'category') {\n\t\t\t\tvar categoryObject = get_category_by_slug(urlArray[i]);\n\t\t\t\turlCategoriesArray.push(categoryObject.term_id);\n\t\t\t} else if (urlMode == 'post') {\n\t\t\t\tpostSelectArray.push(urlArray[i]);\n\t\t\t}\n\t\t}\n\n\t\tif (postSelectArray.length > 0) {\n\t\t\tif (onMap) {\n\t\t\t\tvar marker = postMap.getMarkerByPostId(postSelectArray[0]);\n\t\t\t\tif (marker) {\n\t\t\t\t\tpostMap.focusOnMarker(marker);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tvar post = get_post_by_id(postSelectArray[0]);\n\t\t\t\tif (post) {\n\t\t\t\t\tshow_single_post_view(post);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Renderes the posts passed.\n\t * @param posts\n\t */\n\tfunction render_posts(posts) {\n\t\tpostListView.clear();\n\t\tpostListView.renderArray(posts);\n\t\tpostMap.posts = posts;\n\t\tpostMap.update();\n\t\t$('.update-filter-counter .count').text(posts.length);\n\t}\n\n\t/**\n\t * Initialises the map, start with getting the json data neede.\n\t */\n\tfunction init() {\n\t\t$.getJSON(Sorsamisk.uploadUrl + '/map-data-' + Sorsamisk.currentLanguage + '.json', function (data, status) {\n\t\t\tvar posts = smartlabs.models.Post.getPostArrayFromObjectArray(data.posts);\n\t\t\tallPosts = posts;\n\n\t\t\tfor (var i = 0; i < allPosts.length; i++) {\n\t\t\t\tidPostIndexer[allPosts[i].ID] = i;\n\t\t\t}\n\n\t\t\trender_posts(posts);\n\n\t\t\t$('.postmap-loader').removeClass('active');\n\n\t\t\tif (!window.location.hash) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tparse_url();\n\t\t});\n\t}\n\n\tinit();\n})(jQuery);\n","(function ($) {\n\t$timline = $('#timeline');\n\t$masthead = $('#masthead');\n\tif (!$timline.length) {\n\t\treturn;\n\t}\n\n\t$timline.height(($(window).height() - $masthead.height()) - 10);\n\tconsole.log(Sorsamisk.uploadUrl + '/timeline-data-' + Sorsamisk.currentLanguage + '.json');\n\n\tvar Timeline = new TL.Timeline('timeline', Sorsamisk.uploadUrl + '/timeline-data-' + Sorsamisk.currentLanguage + '.json', {\n\t\tlanguage: 'no'\n\t});\n})(jQuery);"]}