)}).success(function(){clearTimeout(d)})},notFoundError:function(a){trace("TWITTER JSON ERROR TIMEOUT "+a);VMM.attachElement("#twitter_"+a,"<span class='messege'><p>Error loading tweet: "+a+"</p></span>");VMM.getJSON("http://api.twitter.com/1/account/rate_limit_status.json",function(b){trace("REMAINING TWITTER API CALLS "+b.remaining_hits);trace("TWITTER RATE LIMIT WILL RESET AT "+b.reset_time);varc="";if(b.remaining_hits==0){c="<p>You've reached the maximum number of tweets you can load in an hour.</p>";c+="<p>You can view tweets again starting at: <br/>"+b.reset_time+"</p>"}elsec="<p>Tweet "+a+" was not found.</p>";VMM.attachElement("#twitter_"+a,"<span class='messege'>"+c+"</span>")})},formatJSON:function(a){trace("TWITTER JSON LOADED F");trace(a);varb=a.id_str,c="<blockquote><p>",d=VMM.Util.linkify_with_twitter(a.text,"_blank");c+=d;c+="</p></blockquote>";c+=" <a href='https://twitter.com/"+a.user.screen_name+"/status/"+a.id+"' target='_blank' alt='link to original tweet' title='link to original tweet'>"+"<span class='created-at'></span>"+" </a>";c+="<div class='vcard author'>";c+="<a class='screen-name url' href='https://twitter.com/"+a.user.screen_name+"' data-screen-name='"+a.user.screen_name+"' target='_blank'>";c+="<span class='avatar'><img src=' "+a.user.profile_image_url+"' alt=''></span>";c+="<span class='fn'>"+a.user.name+"</span>";c+="<span class='nickname'>@"+a.user.screen_name+"</span>";c+="</a>";c+="</div>";VMM.attachElement("#twitter_"+b.toString(),c)}},googlemaps:{get:function(a,b){varc,d=VMM.Util.getUrlVars(a),e;VMM.master_config.Timeline.api_keys.google!=""?e=VMM.master_config.Timeline.api_keys.google:e=Aes.Ctr.decrypt(VMM.master_config.api_keys_master.google,VMM.master_config.vp,256);varf="http://maps.googleapis.com/maps/api/js?key="+e+"&libraries=places&sensor=false&callback=VMM.ExternalAPI.googlemaps.onMapAPIReady",g={url:a,vars:d,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){functione(a){if(ainVMM.ExternalAPI.googlemaps.map_providers){b=VMM.ExternalAPI.googlemaps.map_attribution[VMM.ExternalAPI.googlemaps.map_providers[a].attribution];returnVMM.ExternalAPI.googlemaps.map_providers[a]}if(VMM.ExternalAPI.googlemaps.defaultType(a)){trace("GOOGLE MAP DEFAULT TYPE");returngoogle.maps.MapTypeId[a.toUpperCase()]}trace("Not a maptype: "+a)}functiono(){varb=a.url+"&output=kml";b=b.replace("&output=embed","");varc=newgoogle.maps.KmlLayer(b,{preserveViewport:!0}),e=newgoogle.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){functionc(a){e.setContent(a);e.open(d)}varb=a.featureData.description;c(b)})}varb="",c,d;google.maps.VeriteMapType=function(a){if(VMM.ExternalAPI.googlemaps.defaultType(a))returngoogle.maps.MapTypeId[a.toUpperCase()];varb=e(a);returngoogle.maps.ImageMapType.call(this,{getTileUrl:function(a,c){vard=(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:newgoogle.maps.Size(256,256),name:a,minZoom:b.minZoom,maxZoom:b.maxZoom})};google.maps.VeriteMapType.prototype=newgoogle.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";varf=newgoogle.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=newgoogle.maps.LatLng(parseFloat(g[0]),parseFloat(g[1]))}elseif(type.of(V
(f,R,"mouseenter mouseleave",{number:d,elem:f});varo={marker:e,flag:f,lineevent:n,type:"marker"};if(g[d].type=="start"){trace("BUILD MARKER HAS START PAGE");I.start_page=!0;o.type="start"}i.push(o)}for(varp=0;p<l.length;p++){varq={content:VMM.appendAndGetElement(w,"<div>","era"),startdate:VMM.Util.parseDate(l[p].startDate),enddate:VMM.Util.parseDate(l[p].endDate),title:l[p].headline,uniqueid:VMM.Util.unique_ID(4),color:l[p].color};VMM.Lib.attr(q.content,"id",q.uniqueid);VMM.Lib.css(q.content,"background",q.color);VMM.appendElement(q.content,"<h3>"+VMM.Util.unlinkify(q.title)+"</h3>");h.push(q)}}});typeofVMM.Timeline!="undefined"&&typeofVMM.Timeline.DataObj=="undefined"&&(VMM.Timeline.DataObj={data_obj:{},model_array:[],getData:function(a){data=VMM.Timeline.DataObj.data_obj;if(type.of(a)=="object"){trace("DATA SOURCE: JSON OBJECT");VMM.Timeline.DataObj.parseJSON(a)}elseif(type.of(a)=="string")if(a.match("%23")){trace("DATA SOURCE: TWITTER SEARCH");VMM.Timeline.DataObj.model_Tweets.getData("%23medill")}elseif(a.match("spreadsheet")){trace("raw_data "+a);trace("DATA SOURCE: GOOGLE SPREADSHEET");VMM.Timeline.DataObj.model_GoogleSpreadsheet.getData(a)}else{VMM.fireEvent(global,"MESSEGE",VMM.Timeline.Config.language.messages.loading_timeline);trace("DATA SOURCE: JSON");VMM.getJSON(a,VMM.Timeline.DataObj.parseJSON)}elseif(type.of(a)=="html"){trace("DATA SOURCE: HTML");VMM.Timeline.DataObj.parseHTML(a)}elsetrace("DATA SOURCE: UNKNOWN")},parseHTML:function(a){trace("parseHTML");trace("WARNING: THIS IS STILL ALPHA AND WILL NOT WORK WITH ID's other than #timeline");varb=VMM.Timeline.DataObj.data_template_obj;if(VMM.Lib.find("#timeline section","time")[0]){b.timeline.startDate=VMM.Lib.html(VMM.Lib.find("#timeline section","time")[0]);b.timeline.headline=VMM.Lib.html(VMM.Lib.find("#timeline section","h2"));b.timeline.text=VMM.Lib.html(VMM.Lib.find("#timeline section","article"));varc=!1;if(VMM.Lib.find("#timeline section","figure img").length!=0){c=!0;b.timeline.asset.media=VMM.Lib.attr(VMM.Lib.find("#timeline section","figure img"),"src")}elseif(VMM.Lib.find("#timeline section","figure a").length!=0){c=!0;b.timeline.asset.media=VMM.Lib.attr(VMM.Lib.find("#timeline section","figure a"),"href")}if(c){VMM.Lib.find("#timeline section","cite").length!=0&&(b.timeline.asset.credit=VMM.Lib.html(VMM.Lib.find("#timeline section","cite")));VMM.Lib.find(this,"figcaption").length!=0&&(b.timeline.asset.caption=VMM.Lib.html(VMM.Lib.find("#timeline section","figcaption")))}}VMM.Lib.each("#timeline li",function(a,c){vard=!1,e={type:"default",startDate:"",headline:"",text:"",asset:{media:"",credit:"",caption:""},tags:"Optional"};if(VMM.Lib.find(this,"time")!=0){d=!0;e.startDate=VMM.Lib.html(VMM.Lib.find(this,"time")[0]);VMM.Lib.find(this,"time")[1]&&(e.endDate=VMM.Lib.html(VMM.Lib.find(this,"time")[0]));e.headline=VMM.Lib.html(VMM.Lib.find(this,"h3"));e.text=VMM.Lib.html(VMM.Lib.find(this,"article"));varf=!1;if(VMM.Lib.find(this,"figure img").length!=0){f=!0;e.asset.media=VMM.Lib.attr(VMM.Lib.find(this,"figure img"),"src")}elseif(VMM.Lib.find(this,"figure a").length!=0){f=!0;e.asset.media=VMM.Lib.attr(VMM.Lib.find(this,"figure a"),"href")}if(f){VMM.Lib.find(this,"cite").length!=0&&(e.asset.credit=VMM.Lib.html(VMM.Lib.find(this,"cite")));VMM.Lib.find(this,"figcaption").length!=0&&(e.asset.caption=VMM.Lib.html(VMM.Lib.find(this,"figcaption")))}trace(e);b.timeline.date.push(e)}});VMM.fireEvent(global,"DATAREADY",b)},parseJSON:function(a){if(a.timeline.type=="default"){trace("DATA SOURCE: JSON STANDARD TIMELINE");VMM.fireEvent(global,"DATAREADY",a)}elseif(a.timeline.type=="twitter"){trace("DATA SOURCE: JSON TWEETS");VMM.Timeline.DataObj.model_Tweets.buildData(a)}else{trace("DATA SOURCE: UNKNOWN JSON");trace(type.of(a.timeline))}},model_Tweets:{type:"twitter",buildData:function(a){VMM.bindEvent(global,VMM.Timeline.DataObj.model_Tweets.onTwitterDataReady,"TWEETSLOADED");VMM.ExternalAPI.twitter.getTweets(a.timeline.tweets)},getData:function(a){VMM.bindEvent(global,VMM.Timeline.DataObj.model_Tweets.onTwitterDataReady,"TWEETSLOADED");VMM.Exte