/*! TimelineJS Designed and built by Zach Wise at VéritéCo This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. http://www.gnu.org/licenses/ *//*********************************************** Begin VMM.js ***********************************************//* Verite * Verite JS Master * Version: 0.6 * Date: April 26, 2012 * Copyright 2012 Verite unless part of Verite Timeline, * if part of Timeline then it inherits Timeline's license. * Designed and built by Zach Wise digitalartwork.net * ----------------------------------------------------- *//* Simple JavaScript Inheritance * By John Resig http://ejohn.org/ * MIT Licensed. ================================================== */function trace(a){VMM.debug&&(window.console?console.log(a):typeof jsTrace!="undefined"&&jsTrace.send(a))}function onYouTubePlayerAPIReady(){trace("GLOBAL YOUTUBE API CALLED");VMM.ExternalAPI.youtube.onAPIReady()}(function(){var a=!1,b=/xyz/.test(function(){xyz})?/\b_super\b/:/.*/;this.Class=function(){};Class.extend=function(c){function g(){!a&&this.init&&this.init.apply(this,arguments)}var d=this.prototype;a=!0;var e=new this;a=!1;for(var f in c)e[f]=typeof c[f]=="function"&&typeof d[f]=="function"&&b.test(c[f])?function(a,b){return function(){var c=this._super;this._super=d[a];var e=b.apply(this,arguments);this._super=c;return e}}(f,c[f]):c[f];g.prototype=e;g.prototype.constructor=g;g.extend=arguments.callee;return g}})();var global=function(){return this||(1,eval)("this")}();if(typeof VMM=="undefined"){var VMM=Class.extend({});VMM.debug=!0;VMM.master_config={init:function(){return this},sizes:{api:{width:0,height:0}},vp:"Pellentesque nibh felis, eleifend id, commodo in, interdum vitae, leo",api_keys_master:{flickr:"RAIvxHY4hE/Elm5cieh4X5ptMyDpj7MYIxziGxi0WGCcy1s+yr7rKQ==",google:"jwNGnYw4hE9lmAez4ll0QD+jo6SKBJFknkopLS4FrSAuGfIwyj57AusuR0s8dAo=",twitter:""},timers:{api:7e3},api:{pushques:[]},twitter:{active:!1,array:[],api_loaded:!1,que:[]},flickr:{active:!1,array:[],api_loaded:!1,que:[]},youtube:{active:!1,array:[],api_loaded:!1,que:[]},vimeo:{active:!1,array:[],api_loaded:!1,que:[]},googlemaps:{active:!1,map_active:!1,places_active:!1,array:[],api_loaded:!1,que:[]},googledocs:{active:!1,array:[],api_loaded:!1,que:[]},googleplus:{active:!1,array:[],api_loaded:!1,que:[]},wikipedia:{active:!1,array:[],api_loaded:!1,que:[],tries:0},soundcloud:{active:!1,array:[],api_loaded:!1,que:[]}}.init();VMM.createElement=function(a,b,c,d,e){var f="";if(a!=null&&a!=""){f+="<"+a;c!=null&&c!=""&&(f+=" class='"+c+"'");d!=null&&d!=""&&(f+=" "+d);e!=null&&e!=""&&(f+=" style='"+e+"'");f+=">";b!=null&&b!=""&&(f+=b);f=f+""+a+">"}return f};VMM.createMediaElement=function(a,b,c){var d="",e=!1;d+="
";typeof b.entities.media!="undefined"&&b.entities.media[0].type!="photo";d+=" ";VMM.attachElement("#"+a.id.toString(),d);VMM.attachElement("#text_thumb_"+a.id.toString(),b.text)}).error(function(b,c,d){trace("TWITTER error");trace("TWITTER ERROR: "+c+" "+b.responseText);VMM.attachElement("#"+a.id,"",e=VMM.Util.linkify_with_twitter(b.text,"_blank");d+=e;d+="
ERROR LOADING TWEET "+a.mid+"
")}).success(function(a){clearTimeout(f);clearTimeout(g);b()})},errorTimeOut:function(a){trace("TWITTER JSON ERROR TIMEOUT "+a.mid);VMM.attachElement("#tweet_"+a.id,"Still waiting on Twitter: "+a.mid+"
");VMM.getJSON("http://api.twitter.com/1/account/rate_limit_status.json",function(a){trace("REMAINING TWITTER API CALLS "+a.remaining_hits);trace("TWITTER RATE LIMIT WILL RESET AT "+a.reset_time);var b="";if(a.remaining_hits==0){b="You've reached the maximum number of tweets you can load in an hour.
";b+="You can view tweets again starting at:
"+a.reset_time+"
Still waiting on Twitter. "+id+"
";VMM.attachElement("#twitter_"+id,""+b+"")})},pushQue:function(){if(VMM.master_config.twitter.que.length>0){VMM.ExternalAPI.twitter.create(VMM.master_config.twitter.que[0],VMM.ExternalAPI.twitter.pushQue);VMM.master_config.twitter.que.remove(0)}},getHTML:function(a){var b="http://api.twitter.com/1/statuses/oembed.json?id="+ a+"&callback=?";VMM.getJSON(b,VMM.ExternalAPI.twitter.onJSONLoaded)},onJSONLoaded:function(a){trace("TWITTER JSON LOADED");var b=a.id;VMM.attachElement("#"+b,VMM.Util.linkify_with_twitter(a.html))},parseTwitterDate:function(a){var b=new Date(Date.parse(a));return b},prettyParseTwitterDate:function(a){var b=new Date(Date.parse(a));return VMM.Date.prettyDate(b,!0)},getTweets:function(a){var b=[],c=a.length;for(var d=0;d",f=VMM.Util.linkify_with_twitter(a.text,"_blank");e+=f;e+="
";e+="— "+a.user.name+" (@"+a.user.screen_name+") "+VMM.ExternalAPI.twitter.prettyParseTwitterDate(a.created_at)+"
";c.content=d;c.raw=a.results[b];e.push(c)}var g={tweetdata:e};VMM.fireEvent(global,"TWEETSLOADED",g)})},prettyHTML:function(a,b){var a=a.toString(),c={twitterid:a},d="http://api.twitter.com/1/statuses/show.json?id="+a+"&include_entities=true&callback=?",e=setTimeout(VMM.ExternalAPI.twitter.errorTimeOut,VMM.master_config.timers.api,a);VMM.getJSON(d,VMM.ExternalAPI.twitter.formatJSON).error(function(b,c,d){trace("TWITTER error");trace("TWITTER ERROR: "+c+" "+b.responseText);VMM.attachElement("#twitter_"+a,"",f=VMM.Util.linkify_with_twitter(a.results[b].text,"_blank");d+=f;d+="
";d+="— "+a.results[b].from_user_name+" (@"+a.results[b].from_user+") "+VMM.ExternalAPI.twitter.prettyParseTwitterDate(a.results[b].created_at)+"
ERROR LOADING TWEET "+a+"
")}).success(function(a){clearTimeout(e);b&&VMM.ExternalAPI.twitter.secondaryMedia(a)})},formatJSON:function(a){var b=a.id_str,c="";c+=" ";typeof a.entities.media!="undefined"&&a.entities.media[0].type=="photo"&&(c+="");VMM.attachElement("#twitter_"+b.toString(),c);VMM.attachElement("#text_thumb_"+b.toString(),a.text)}},googlemaps:{get:function(a,b){var c,d,e;e=VMM.Util.getUrlVars(a);VMM.master_config.Timeline.api_keys.google!=""?d=VMM.master_config.Timeline.api_keys.google:d=Aes.Ctr.decrypt(VMM.master_config.api_keys_master.google,VMM.master_config.vp,256);var f="http://maps.googleapis.com/maps/api/js?key="+d+"&libraries=places&sensor=false&callback=VMM.ExternalAPI.googlemaps.onMapAPIReady",g={url:a,vars:e,id:b};if(VMM.master_config.googlemaps.active)VMM.master_config.googlemaps.que.push(g);else{VMM.master_config.googlemaps.que.push(g);VMM.master_config.googlemaps.api_loaded||VMM.LoadLib.js(f,function(){trace("Google Maps API Library Loaded")})}},create:function(a){function e(a){if(a in VMM.ExternalAPI.googlemaps.map_providers){b=VMM.ExternalAPI.googlemaps.map_attribution[VMM.ExternalAPI.googlemaps.map_providers[a].attribution];return VMM.ExternalAPI.googlemaps.map_providers[a]}if(VMM.ExternalAPI.googlemaps.defaultType(a)){trace("GOOGLE MAP DEFAULT TYPE");return google.maps.MapTypeId[a.toUpperCase()]}trace("Not a maptype: "+a)}function o(){var b=a.url+"&output=kml";b=b.replace("&output=embed","");var c=new google.maps.KmlLayer(b,{preserveViewport:!0}),e=new google.maps.InfoWindow;c.setMap(d);google.maps.event.addListenerOnce(c,"defaultviewport_changed",function(){d.fitBounds(c.getDefaultViewport());i&&d.panTo(f);j&&d.setZoom(h)});google.maps.event.addListener(c,"click",function(a){function c(a){e.setContent(a);e.open(d)}var b=a.featureData.description;c(b)})}var b="",c,d;google.maps.VeriteMapType=function(a){if(VMM.ExternalAPI.googlemaps.defaultType(a))return google.maps.MapTypeId[a.toUpperCase()];var b=e(a);return google.maps.ImageMapType.call(this,{getTileUrl:function(a,c){var d=(c+a.x+a.y)%VMM.ExternalAPI.googlemaps.map_subdomains.length;return[b.url.replace("{S}",VMM.ExternalAPI.googlemaps.map_subdomains[d]).replace("{Z}",c).replace("{X}",a.x).replace("{Y}",a.y).replace("{z}",c).replace("{x}",a.x).replace("{y}",a.y)]},tileSize:new google.maps.Size(256,256),name:a,minZoom:b.minZoom,maxZoom:b.maxZoom})};google.maps.VeriteMapType.prototype=new google.maps.ImageMapType("_");type.of(VMM.master_config.Timeline.maptype)=="string"?VMM.ExternalAPI.googlemaps.defaultType(VMM.master_config.Timeline.maptype)?c=google.maps.MapTypeId[VMM.master_config.Timeline.maptype.toUpperCase()]:c=VMM.master_config.Timeline.maptype:c="toner";var f=new google.maps.LatLng(41.875696,-87.624207),g,h=11,i=!1,j=!1,k;if(type.of(VMM.Util.getUrlVars(a.url)["ll"])=="string"){i=!0;g=VMM.Util.getUrlVars(a.url).ll.split(",");f=new google.maps.LatLng(parseFloat(g[0]),parseFloat(g[1]))}else if(type.of(VMM.Util.getUrlVars(a.url)["sll"])=="string"){g=VMM.Util.getUrlVars(a.url).sll.split(",");f=new google.maps.LatLng(parseFloat(g[0]),parseFloat(g[1]))}if(type.of(VMM.Util.getUrlVars(a.url)["z"])=="string"){j=!0;h=parseFloat(VMM.Util.getUrlVars(a.url).z)}var l={zoom:h,disableDefaultUI:!0,mapTypeControl:!1,zoomControl:!0,zoomControlOptions:{style:google.maps.ZoomControlStyle.SMALL,position:google.maps.ControlPosition.TOP_RIGHT},center:f,mapTypeId:c,mapTypeControlOptions:{mapTypeIds:[c]}},m=a.id.toString()+"_gmap";VMM.attachElement("#"+a.id,"");var d=new google.maps.Map(document.getElementById(m),l);if(!VMM.ExternalAPI.googlemaps.defaultType(VMM.master_config.Timeline.maptype)){d.mapTypes.set(c,new google.maps.VeriteMapType(c));var n="",d=VMM.Util.linkify_with_twitter(a.text,"_blank");c+=d;c+="
"+b.object.attachments[d].content+"
";g+="";g+="ERROR LOADING GOOGLE+
"+e.error.message+"
")}).success(function(a){clearTimeout(googleplus_timeout);clearTimeout(callback_timeout);b()})},pushQue:function(){if(VMM.master_config.googleplus.que.length>0){VMM.ExternalAPI.googleplus.create(VMM.master_config.googleplus.que[0],VMM.ExternalAPI.googleplus.pushQue);VMM.master_config.googleplus.que.remove(0)}},errorTimeOut:function(a){trace("GOOGLE+ JSON ERROR TIMEOUT "+a.activity);VMM.attachElement("#googleplus_"+a.activity,"Still waiting on GOOGLE+
"+a.activity+"
")}},googledocs:{get:function(a,b){var c={url:a,id:b};VMM.master_config.googledocs.que.push(c);VMM.master_config.googledocs.active=!0},create:function(a){var b="";a.url.match(/docs.google.com/i)?b="":b="";VMM.attachElement("#"+a.id,b)},pushQue:function(){for(var a=0;aWikipedia entry unable to load using Internet Explorer 8 or below.
";VMM.attachElement("#"+a.id,d)}VMM.getJSON(c,function(b){if(b.query){var c,d,e="",f="",g=1,h=[];c=VMM.Util.getObjectAttributeByIndex(b.query.pages,0).extract;d=VMM.Util.getObjectAttributeByIndex(b.query.pages,0).title;c.match("")?h=c.split("
"):h.push(c);for(var i=0;i Wikipedia is not responding "+VMM.master_config.language.messages.loading+""+d+"
";e+=""+VMM.master_config.language.messages.wikipedia+"";e+=VMM.Util.linkify_wikipedia(f);c.match("REDIRECT")||VMM.attachElement("#"+a.id,e)}}).error(function(c,d,e){trace("WIKIPEDIA error");trace("WIKIPEDIA ERROR: "+d+" "+c.responseText);trace(e);VMM.attachElement("#"+a.id,"