/* TimelineJS - ver. 2.34.0 - 2014-10-20 Copyright (c) 2012-2013 Northwestern University a project of the Northwestern University Knight Lab, originally created by Zach Wise https://github.com/NUKnightLab/TimelineJS This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. */ LazyLoad=function(doc){var env,head,pending={},pollCount=0,queue={css:[],js:[]},styleSheets=doc.styleSheets;function createNode(name,attrs){var node=doc.createElement(name),attr;for(attr in attrs){if(attrs.hasOwnProperty(attr)){node.setAttribute(attr,attrs[attr])}}return node}function finish(type){var p=pending[type],callback,urls;if(p){callback=p.callback;urls=p.urls;urls.shift();pollCount=0;if(!urls.length){callback&&callback.call(p.context,p.obj);pending[type]=null;queue[type].length&&load(type)}}}function getEnv(){var ua=navigator.userAgent;env={async:doc.createElement("script").async===true};(env.webkit=/AppleWebKit\//.test(ua))||(env.ie=/MSIE/.test(ua))||(env.opera=/Opera/.test(ua))||(env.gecko=/Gecko\//.test(ua))||(env.unknown=true)}function load(type,urls,callback,obj,context){var _finish=function(){finish(type)},isCSS=type==="css",nodes=[],i,len,node,p,pendingUrls,url;env||getEnv();if(urls){urls=typeof urls==="string"?[urls]:urls.concat();if(isCSS||env.async||env.gecko||env.opera){queue[type].push({urls:urls,callback:callback,obj:obj,context:context})}else{for(i=0,len=urls.length;i=0){if(styleSheets[i].href===css.urls[0]){finish("css");break}}pollCount+=1;if(css){if(pollCount<200){setTimeout(pollWebKit,50)}else{finish("css")}}}}return{css:function(urls,callback,obj,context){load("css",urls,callback,obj,context)},js:function(urls,callback,obj,context){load("js",urls,callback,obj,context)}}}(this.document);LoadLib=function(doc){var loaded=[];function isLoaded(url){var i=0,has_loaded=false;for(i=0;ineed;break}}}}catch(err){ready.jquery=false}if(!ready.jquery){LoadLib.js(path.jquery,onloaded_jquery)}else{onloaded_jquery()}function onloaded_jquery(){LoadLib.js(storyjs_e_config.js,onloaded_js)}function onloaded_js(){ready.js=true;if(storyjs_e_config.lang!="en"){LazyLoad.js(path.locale,onloaded_language)}else{ready.language=true}onloaded_check()}function onloaded_language(){ready.language=true;onloaded_check()}function onloaded_css(){ready.css=true;onloaded_check()}function onloaded_font_css(){ready.font.css=true;onloaded_check()}function onloaded_font_js(){ready.font.js=true;onloaded_check()}function onloaded_check(){if(ready.checks>40){return;alert("Error Loading Files")}else{ready.checks++;if(ready.js&&ready.css&&ready.font.css&&ready.font.js&&ready.language){if(!ready.finished){ready.finished=true;buildEmbed()}}else{ready.timeout=setTimeout("onloaded_check_again();",250)}}}this.onloaded_check_again=function(){onloaded_check()};function createEmbedDiv(){var embed_classname="storyjs-embed";t=document.createElement("div");if(storyjs_e_config.embed_id!=""){te=document.getElementById(storyjs_e_config.embed_id)}else{te=document.getElementById("timeline-embed")}te.appendChild(t);t.setAttribute("id",storyjs_e_config.id);if(storyjs_e_config.width.toString().match("%")){te.style.width=storyjs_e_config.width.split("%")[0]+"%"}else{storyjs_e_config.width=storyjs_e_config.width-2;te.style.width=storyjs_e_config.width+"px"}if(storyjs_e_config.height.toString().match("%")){te.style.height=storyjs_e_config.height;embed_classname+=" full-embed";te.style.height=storyjs_e_config.height.split("%")[0]+"%"}else if(storyjs_e_config.width.toString().match("%")){embed_classname+=" full-embed";storyjs_e_config.height=storyjs_e_config.height-16;te.style.height=storyjs_e_config.height+"px"}else{embed_classname+=" sized-embed";storyjs_e_config.height=storyjs_e_config.height-16;te.style.height=storyjs_e_config.height+"px"}te.setAttribute("class",embed_classname);te.setAttribute("className",embed_classname);t.style.position="relative"}function buildEmbed(){VMM.debug=storyjs_e_config.debug;storyjs_embedjs=new VMM.Timeline(storyjs_e_config.id);storyjs_embedjs.init(storyjs_e_config);if(isCDN){VMM.bindEvent(global,onHeadline,"HEADLINE")}}}