From 5c1d1bab1733790d2ff9330fb2fcf8e561ff001a Mon Sep 17 00:00:00 2001 From: Zach Wise Date: Tue, 3 Jul 2012 16:24:19 -0500 Subject: [PATCH] Cleanup and fix touch scrolling of Timeline and general touch device animation fixes --- compiled/js/timeline-min.js | 10 +-- compiled/js/timeline.js | 116 +++++++++++++++++------------ examples/model.json | 1 + source/js/Core/VMM.Library.js | 27 +++---- source/js/Slider/VMM.DragSlider.js | 36 ++++++--- source/js/VMM.Timeline.TimeNav.js | 48 ++++++------ source/js/VMM.Timeline.js | 5 ++ 7 files changed, 142 insertions(+), 101 deletions(-) diff --git a/compiled/js/timeline-min.js b/compiled/js/timeline-min.js index ad9e97f..db3b788 100644 --- a/compiled/js/timeline-min.js +++ b/compiled/js/timeline-min.js @@ -25,8 +25,8 @@ ================================================== *//* Simple JavaScript Inheritance By John Resig http://ejohn.org/ MIT Licensed. -================================================== */function trace(e){VMM.debug&&(window.console?console.log(e):typeof jsTrace!="undefined"&&jsTrace.send(e))}function onYouTubePlayerAPIReady(){trace("GLOBAL YOUTUBE API CALLED");VMM.ExternalAPI.youtube.onAPIReady()}(function(){var e=!1,t=/xyz/.test(function(){xyz})?/\b_super\b/:/.*/;this.Class=function(){};Class.extend=function(n){function o(){!e&&this.init&&this.init.apply(this,arguments)}var r=this.prototype;e=!0;var i=new this;e=!1;for(var s in n)i[s]=typeof n[s]=="function"&&typeof r[s]=="function"&&t.test(n[s])?function(e,t){return function(){var n=this._super;this._super=r[e];var i=t.apply(this,arguments);this._super=n;return i}}(s,n[s]):n[s];o.prototype=i;o.prototype.constructor=o;o.extend=arguments.callee;return o}})();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(e,t,n,r,i){var s="";if(e!=null&&e!=""){s+="<"+e;n!=null&&n!=""&&(s+=" class='"+n+"'");r!=null&&r!=""&&(s+=" "+r);i!=null&&i!=""&&(s+=" style='"+i+"'");s+=">";t!=null&&t!=""&&(s+=t);s=s+""}return s};VMM.createMediaElement=function(e,t,n){var r="",i=!1;r+="
";if(e!=null&&e!=""){valid=!0;r+="";n!=null&&n!=""&&(r+=VMM.createElement("div",n,"credit"));t!=null&&t!=""&&(r+=VMM.createElement("div",t,"caption"))}r+="
";return r};VMM.hideUrlBar=function(){var e=window,t=e.document;if(!location.hash||!e.addEventListener){window.scrollTo(0,1);var n=1,r=setInterval(function(){if(t.body){clearInterval(r);n="scrollTop"in t.body?t.body.scrollTop:1;e.scrollTo(0,n===1?0:1)}},15);e.addEventListener("load",function(){setTimeout(function(){e.scrollTo(0,n===1?0:1)},0)},!1)}}}Array.prototype.remove=function(e,t){var n=this.slice((t||e)+1||this.length);this.length=e<0?this.length+e:e;return this.push.apply(this,n)};Date.prototype.getWeek=function(){var e=new Date(this.getFullYear(),0,1);return Math.ceil(((this-e)/864e5+e.getDay()+1)/7)};Date.prototype.getDayOfYear=function(){var e=new Date(this.getFullYear(),0,1);return Math.ceil((this-e)/864e5)};var is={Null:function(e){return e===null},Undefined:function(e){return e===undefined},nt:function(e){return e===null||e===undefined},Function:function(e){return typeof e=="function"?e.constructor.toString().match(/Function/)!==null:!1},String:function(e){return typeof e=="string"?!0:typeof e=="object"?e.constructor.toString().match(/string/i)!==null:!1},Array:function(e){return typeof e=="object"?e.constructor.toString().match(/array/i)!==null||e.length!==undefined:!1},Boolean:function(e){return typeof e=="boolean"?!0:typeof e=="object"?e.constructor.toString().match(/boolean/i)!==null:!1},Date:function(e){return typeof e=="date"?!0:typeof e=="object"?e.constructor.toString().match(/date/i)!==null:!1},HTML:function(e){return typeof e=="object"?e.constructor.toString().match(/html/i)!==null:!1},Number:function(e){return typeof e=="number"?!0:typeof e=="object"?e.constructor.toString().match(/Number/)!==null:!1},Object:function(e){return typeof e=="object"?e.constructor.toString().match(/object/i)!==null:!1},RegExp:function(e){return typeof e=="function"?e.constructor.toString().match(/regexp/i)!==null:!1}},type={of:function(e){for(var t in is)if(is[t](e))return t.toLowerCase()}};if(typeof VMM!="undefined"){VMM.attachElement=function(e,t){typeof jQuery!="undefined"&&jQuery(e).html(t)};VMM.appendElement=function(e,t){typeof jQuery!="undefined"&&jQuery(e).append(t)};VMM.getHTML=function(e){var t;if(typeof jQuery!="undefined"){t=jQuery(e).html();return t}};VMM.getElement=function(e,t){var n;if(typeof jQuery!="undefined"){t?n=jQuery(e).parent().get(0):n=jQuery(e).get(0);return n}};VMM.bindEvent=function(e,t,n,r){var i,s="click",o={};n!=null&&n!=""&&(s=n);o!=null&&o!=""&&(o=r);typeof jQuery!="undefined"&&jQuery(e).bind(s,o,t)};VMM.unbindEvent=function(e,t,n){var r,i="click",s={};n!=null&&n!=""&&(i=n);typeof jQuery!="undefined"&&jQuery(e).unbind(i,t)};VMM.fireEvent=function(e,t,n){var r,i="click",s=[];t!=null&&t!=""&&(i=t);n!=null&&n!=""&&(s=n);typeof jQuery!="undefined"&&jQuery(e).trigger(i,s)};VMM.getJSON=function(e,t,n){if(typeof jQuery!="undefined"){jQuery.ajaxSetup({timeout:3e3});if(VMM.Browser.browser=="Explorer"&&parseInt(VMM.Browser.version,10)>=7&&window.XDomainRequest){trace("IE JSON");var r=e;if(r.match("^http://"))return jQuery.getJSON(r,t,n);if(r.match("^https://")){r=r.replace("https://","http://");return jQuery.getJSON(r,t,n)}return jQuery.getJSON(e,t,n)}return jQuery.getJSON(e,t,n)}};VMM.parseJSON=function(e){if(typeof jQuery!="undefined")return jQuery.parseJSON(e)};VMM.appendAndGetElement=function(e,t,n,r){var i,s="
",o="",u="",a="";t!=null&&t!=""&&(s=t);n!=null&&n!=""&&(o=n);r!=null&&r!=""&&(u=r);if(typeof jQuery!="undefined"){i=jQuery(t);i.addClass(o);i.html(u);jQuery(e).append(i)}return i};VMM.Lib={init:function(){return this},hide:function(e,t){t!=null&&t!=""?typeof jQuery!="undefined"&&jQuery(e).hide(t):typeof jQuery!="undefined"&&jQuery(e).hide()},remove:function(e){typeof jQuery!="undefined"&&jQuery(e).remove()},detach:function(e){typeof jQuery!="undefined"&&jQuery(e).detach()},append:function(e,t){typeof jQuery!="undefined"&&jQuery(e).append(t)},prepend:function(e,t){typeof jQuery!="undefined"&&jQuery(e).prepend(t)},show:function(e,t){t!=null&&t!=""?typeof jQuery!="undefined"&&jQuery(e).show(t):typeof jQuery!="undefined"&&jQuery(e).show()},load:function(e,t,n){var r={elem:e};r!=null&&r!=""&&(r=n);typeof jQuery!="undefined"&&jQuery(e).load(r,t)},addClass:function(e,t){typeof jQuery!="undefined"&&jQuery(e).addClass(t)},removeClass:function(e,t){typeof jQuery!="undefined"&&jQuery(e).removeClass(t)},attr:function(e,t,n){if(n!=null&&n!="")typeof jQuery!="undefined"&&jQuery(e).attr(t,n);else if(typeof jQuery!="undefined")return jQuery(e).attr(t)},prop:function(e,t,n){typeof jQuery=="undefined"||!/[1-9]\.[3-9].[1-9]/.test(jQuery.fn.jquery)?VMM.Lib.attribute(e,t,n):jQuery(e).prop(t,n)},attribute:function(e,t,n){if(n!=null&&n!="")typeof jQuery!="undefined"&&jQuery(e).attr(t,n);else if(typeof jQuery!="undefined")return jQuery(e).attr(t)},visible:function(e,t){if(t!=null)typeof jQuery!="undefined"&&(t?jQuery(e).show(0):jQuery(e).hide(0));else if(typeof jQuery!="undefined")return jQuery(e).is(":visible")?!0:!1},css:function(e,t,n){if(n!=null&&n!="")typeof jQuery!="undefined"&&jQuery(e).css(t,n);else if(typeof jQuery!="undefined")return jQuery(e).css(t)},cssmultiple:function(e,t){if(typeof jQuery!="undefined")return jQuery(e).css(t)},offset:function(e){var t;typeof jQuery!="undefined"&&(t=jQuery(e).offset());return t},position:function(e){var t;typeof jQuery!="undefined"&&(t=jQuery(e).position());return t},width:function(e,t){if(t!=null&&t!="")typeof jQuery!="undefined"&&jQuery(e).width(t);else if(typeof jQuery!="undefined")return jQuery(e).width()},height:function(e,t){if(t!=null&&t!="")typeof jQuery!="undefined"&&jQuery(e).height(t);else if(typeof jQuery!="undefined")return jQuery(e).height()},toggleClass:function(e,t){typeof jQuery!="undefined"&&jQuery(e).toggleClass(t)},each:function(e,t){typeof jQuery!="undefined"&&jQuery(e).each(t)},html:function(e,t){var n;if(typeof jQuery!="undefined"){n=jQuery(e).html();return n}if(t!=null&&t!="")typeof jQuery!="undefined"&&jQuery(e).html(t);else{var n;if(typeof jQuery!="undefined"){n=jQuery(e).html();return n}}},find:function(e,t){if(typeof jQuery!="undefined")return jQuery(e).find(t)},stop:function(e){typeof jQuery!="undefined"&&jQuery(e).stop()},delay_animate:function(e,t,n,r,i,s){if(VMM.Browser.device=="mobile"||VMM.Browser.device=="tablet"){var o=Math.round(n/1500*10)/10,u=o+"s";VMM.Lib.css(t,"-webkit-transition","all "+u+" ease");VMM.Lib.css(t,"-moz-transition","all "+u+" ease");VMM.Lib.css(t,"-o-transition","all "+u+" ease");VMM.Lib.css(t,"-ms-transition","all "+u+" ease");VMM.Lib.css(t,"transition","all "+u+" ease");VMM.Lib.cssmultiple(t,_att)}else typeof jQuery!="undefined"&&jQuery(t).delay(e).animate(i,{duration:n,easing:r})},animate:function(e,t,n,r,i,s){var o="easein",u=!1,a=1e3,f={};t!=null&&(t<1?a=1:a=Math.round(t));n!=null&&n!=""&&(o=n);i!=null&&i!=""&&(u=i);r!=null?f=r:f={opacity:0};if(VMM.Browser.device=="mobile"||VMM.Browser.device=="tablet"){var l=Math.round(a/1500*10)/10,c=l+"s";VMM.Lib.css(e,"-webkit-transition","all "+c+" ease");VMM.Lib.css(e,"-moz-transition","all "+c+" ease");VMM.Lib.css(e,"-o-transition","all "+c+" ease");VMM.Lib.css(e,"-ms-transition","all "+c+" ease");VMM.Lib.css(e,"transition","all "+c+" ease");VMM.Lib.cssmultiple(e,f)}else typeof jQuery!="undefined"&&(s!=null&&s!=""?jQuery(e).animate(f,{queue:u,duration:a,easing:o,complete:s}):jQuery(e).animate(f,{queue:u,duration:a,easing:o}))}}}if(typeof jQuery!="undefined"){(function(e){window.XDomainRequest&&e.ajaxTransport(function(t){if(t.crossDomain&&t.async){if(t.timeout){t.xdrTimeout=t.timeout;delete t.timeout}var n;return{send:function(r,i){function o(t,r,s,o){n.onload=n.onerror=n.ontimeout=e.noop;n=undefined;i(t,r,s,o)}n=new XDomainRequest;n.open(t.type,t.url);n.onload=function(){o(200,"OK",{text:n.responseText},"Content-Type: "+n.contentType)};n.onerror=function(){o(404,"Not Found")};if(t.xdrTimeout){n.ontimeout=function(){o(0,"timeout")};n.timeout=t.xdrTimeout}n.send(t.hasContent&&t.data||null)},abort:function(){if(n){n.onerror=e.noop();n.abort()}}}}})})(jQuery);jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(e,t,n,r,i){return jQuery.easing[jQuery.easing.def](e,t,n,r,i)},easeInExpo:function(e,t,n,r,i){return t==0?n:r*Math.pow(2,10*(t/i-1))+n},easeOutExpo:function(e,t,n,r,i){return t==i?n+r:r*(-Math.pow(2,-10*t/i)+1)+n},easeInOutExpo:function(e,t,n,r,i){return t==0?n:t==i?n+r:(t/=i/2)<1?r/2*Math.pow(2,10*(t-1))+n:r/2*(-Math.pow(2,-10*--t)+2)+n},easeInQuad:function(e,t,n,r,i){return r*(t/=i)*t+n},easeOutQuad:function(e,t,n,r,i){return-r*(t/=i)*(t-2)+n},easeInOutQuad:function(e,t,n,r,i){return(t/=i/2)<1?r/2*t*t+n:-r/2*(--t*(t-2)-1)+n}})}if(typeof VMM!="undefined"&&typeof VMM.Browser=="undefined"){VMM.Browser={init:function(){this.browser=this.searchString(this.dataBrowser)||"An unknown browser";this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"an unknown version";this.OS=this.searchString(this.dataOS)||"an unknown OS";this.device=this.searchDevice(navigator.userAgent);this.orientation=this.searchOrientation(window.orientation)},searchOrientation:function(e){var t="";e==0||e==180?t="portrait":e==90||e==-90?t="landscape":t="normal";return t},searchDevice:function(e){var t="";e.match(/Android/i)||e.match(/iPhone|iPod/i)?t="mobile":e.match(/iPad/i)?t="tablet":e.match(/BlackBerry/i)||e.match(/IEMobile/i)?t="other mobile":t="desktop";return t},searchString:function(e){for(var t=0;t'mmmm d',' yyyy''",full_long:"mmm d',' yyyy 'at' hh:MM TT",full_long_small_date:"hh:MM TT'
mmm d',' yyyy''"},month:["January","February","March","April","May","June","July","August","September","October","November","December"],month_abbr:["Jan.","Feb.","March","April","May","June","July","Aug.","Sept.","Oct.","Nov.","Dec."],day:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],day_abbr:["Sun.","Mon.","Tues.","Wed.","Thurs.","Fri.","Sat."],hour:[1,2,3,4,5,6,7,8,9,10,11,12,1,2,3,4,5,6,7,8,9,10,11,12],hour_suffix:["am"],bc_format:{year:"yyyy",month_short:"mmm",month:"mmmm yyyy",full_short:"mmm d",full:"mmmm d',' yyyy",time_no_seconds_short:"h:MM TT",time_no_seconds_small_date:"dddd', 'h:MM TT'
'mmmm d',' yyyy''",full_long:"dddd',' mmm d',' yyyy 'at' hh:MM TT",full_long_small_date:"hh:MM TT'
'dddd',' mmm d',' yyyy''"},setLanguage:function(e){trace("SET DATE LANGUAGE");VMM.Date.dateformats=e.dateformats;VMM.Date.month=e.date.month;VMM.Date.month_abbr=e.date.month_abbr;VMM.Date.day=e.date.day;VMM.Date.day_abbr=e.date.day_abbr;dateFormat.i18n.dayNames=e.date.day_abbr.concat(e.date.day);dateFormat.i18n.monthNames=e.date.month_abbr.concat(e.date.month)},parse:function(e){"use strict";var t,n,r,i;if(type.of(e)=="date")t=e;else{t=new Date(0,0,1,0,0,0,0);if(e.match(/,/gi)){n=e.split(",");for(var s=0;s1&&t.setMonth(n[1]-1);n[2]>1&&t.setDate(n[2]);n[3]>1&&t.setHours(n[3]);n[4]>1&&t.setMinutes(n[4]);n[5]>1&&t.setSeconds(n[5]);n[6]>1&&t.setMilliseconds(n[6])}else if(e.match("/")){if(e.match(" ")){i=e.split(" ");if(e.match(":")){r=i[1].split(":");r[0]>=1&&t.setHours(r[0]);r[1]>=1&&t.setMinutes(r[1]);r[2]>=1&&t.setSeconds(r[2]);r[3]>=1&&t.setMilliseconds(r[3])}n=i[0].split("/")}else n=e.split("/");n[2]&&t.setFullYear(n[2]);n[0]>1&&t.setMonth(n[0]-1);n[1]>1&&t.setDate(n[1])}else if(e.length<=5){t.setFullYear(parseInt(e,10));t.setMonth(0);t.setDate(1);t.setHours(0);t.setMinutes(0);t.setSeconds(0);t.setMilliseconds(0)}else if(e.match("T"))if(navigator.userAgent.match(/MSIE\s(?!9.0)/)){i=e.split("T");if(e.match(":")){r=_time_parse[1].split(":");r[0]>=1&&t.setHours(r[0]);r[1]>=1&&t.setMinutes(r[1]);r[2]>=1&&t.setSeconds(r[2]);r[3]>=1&&t.setMilliseconds(r[3])}_d_array=i[0].split("-");n[0]&&t.setFullYear(n[0]);n[1]>1&&t.setMonth(n[1]-1);n[2]>1&&t.setDate(n[2])}else t=new Date(Date.parse(e));else t=new Date(parseInt(e.slice(0,4),10),parseInt(e.slice(4,6),10)-1,parseInt(e.slice(6,8),10),parseInt(e.slice(8,10),10),parseInt(e.slice(10,12),10))}return t},prettyDate:function(e,t,n){var r,i,s,o,u=!1,a,f,l;n!=null&&(u=!0);if(type.of(e)=="date"){e.getMonth()===0&&e.getDate()==1&&e.getHours()===0&&e.getMinutes()===0?s=VMM.Date.dateformats.year:e.getDate()<=1&&e.getHours()===0&&e.getMinutes()===0?t?s=VMM.Date.dateformats.month_short:s=VMM.Date.dateformats.month:e.getHours()===0&&e.getMinutes()===0?t?s=VMM.Date.dateformats.full_short:s=VMM.Date.dateformats.full:e.getMinutes()===0?t?s=VMM.Date.dateformats.time_no_seconds_short:s=VMM.Date.dateformats.time_no_seconds_small_date:t?s=VMM.Date.dateformats.time_no_seconds_short:s=VMM.Date.dateformats.full_long;r=dateFormat(e,s,!1);o=r.split(" ");for(var c=0;c99?Math.round(m/10):m),t:p<12?"a":"p",tt:p<12?"am":"pm",T:p<12?"A":"P",TT:p<12?"AM":"PM",Z:o?"UTC":(String(i).match(t)||[""]).pop().replace(n,""),o:(g>0?"-":"+")+r(Math.floor(Math.abs(g)/60)*100+Math.abs(g)%60,4),S:["th","st","nd","rd"][f%10>3?0:(f%100-f%10!=10)*f%10]};return s.replace(e,function(e){return e in y?y[e]:e.slice(1,e.length-1)})}}();dateFormat.masks={"default":"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"};dateFormat.i18n={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"]};Date.prototype.format=function(e,t){return dateFormat(this,e,t)}}typeof VMM!="undefined"&&typeof VMM.Util=="undefined"&&(VMM.Util={init:function(){return this},correctProtocol:function(e){var t=window.parent.location.protocol.toString(),n="",r=e.split("://",2);t.match("http")?n=t:n="https";return n+"://"+r[1]},getObjectAttributeByIndex:function(e,t){if(typeof e!="undefined"){var n=0;for(var r in e){if(t===n)return e[r];n++}return""}return""},randomBetween:function(e,t){return Math.floor(Math.random()*(t-e+1)+e)},average:function(e){var t={mean:0,variance:0,deviation:0},n=e.length;for(var r,i=0,s=n;s--;i+=e[s]);for(r=t.mean=i/n,s=n,i=0;s--;i+=Math.pow(e[s]-r,2));return t.deviation=Math.sqrt(t.variance=i/n),t},customSort:function(e,t){var n=e,r=t;return n==r?0:n>r?1:-1},deDupeArray:function(e){var t,n=e.length,r=[],i={};for(t=0;tt){i.height=t;i.width=Math.round(t/r*n);i.width>e&&trace("FIT: DIDN'T FIT!!! ")}return i},r16_9:function(e,t){if(e!==null&&e!=="")return Math.round(t/16*9);if(t!==null&&t!=="")return Math.round(e/9*16)},r4_3:function(e,t){if(e!==null&&e!=="")return Math.round(t/4*3);if(t!==null&&t!=="")return Math.round(e/3*4)}},doubledigit:function(e){return(e<10?"0":"")+e},truncateWords:function(e,t,n){t||(t=30);n||(n=t);var r=/^[^A-Za-z0-9\'\-]+/gi,i=e.replace(r,""),s=i.split(" "),o=[];t=Math.min(s.length,t);n=Math.min(s.length,n);for(var u=0;u$&").replace(i,"$1$2").replace(s,"$1")},linkify_with_twitter:function(e,t,n){function u(e){var t=/(\b(https?|ftp|file):\/\/([-A-Z0-9+&@#%?=~_|!:,.;]*)([-A-Z0-9+&@#%?\/=~_|!:,.;]*)[-A-Z0-9+&@#\/%=~_|])/ig;return e.replace(t,"$3")}var r=/\b(?:https?|ftp):\/\/[a-z0-9-+&@#\/%?=~_|!:,.;]*[a-z0-9-+&@#\/%=~_|]/gim,i=/(\()((?:ht|f)tps?:\/\/[a-z0-9\-._~!$&'()*+,;=:\/?#[\]@%]+)(\))|(\[)((?:ht|f)tps?:\/\/[a-z0-9\-._~!$&'()*+,;=:\/?#[\]@%]+)(\])|(\{)((?:ht|f)tps?:\/\/[a-z0-9\-._~!$&'()*+,;=:\/?#[\]@%]+)(\})|(<|&(?:lt|#60|#x3c);)((?:ht|f)tps?:\/\/[a-z0-9\-._~!$&'()*+,;=:\/?#[\]@%]+)(>|&(?:gt|#62|#x3e);)|((?:^|[^=\s'"\]])\s*['"]?|[^=\s]\s+)(\b(?:ht|f)tps?:\/\/[a-z0-9\-._~!$'()*+,;=:\/?#[\]@%]+(?:(?!&(?:gt|#0*62|#x0*3e);|&(?:amp|apos|quot|#0*3[49]|#x0*2[27]);[.!&',:?;]?(?:[^a-z0-9\-._~!$&'()*+,;=:\/?#[\]@%]|$))&[a-z0-9\-._~!$'()*+,;=:\/?#[\]@%]*)*[a-z0-9\-_~$()*+=\/#[\]@%])/img,s='$1$4$7$10$13$2$5$8$11$14$3$6$9$12',o=/(^|[^\/])(www\.[\S]+(\b|$))/gim,a=/(([a-zA-Z0-9_\-\.]+)@[a-zA-Z_]+?(?:\.[a-zA-Z]{2,6}))+/gim,f=/\B@([\w-]+)/gm,l=/(#([\w]+))/g;return e.replace(i,s).replace(o,"$1$2").replace(a,"$1").replace(f,"@$1").replace(l,"$1")},linkify_wikipedia:function(e){var t=/]*>(.*?)<\/i>/gim;return e.replace(t,"$&").replace(/]*>/gim,"").replace(/<\/i>/gim,"").replace(/]*>/gim,"").replace(/<\/b>/gim,"")},unlinkify:function(e){if(!e)return e;e=e.replace(/]*>/i,"");e=e.replace(/<\/a>/i,"");return e},untagify:function(e){if(!e)return e;e=e.replace(/<\s*\w.*?>/g,"");return e},nl2br:function(e){return e.replace(/(\r\n|[\r\n]|\\n|\\r)/g,"
")},unique_ID:function(e){var t=function(e){return Math.floor(Math.random()*e)},n=function(){var e="abcdefghijklmnopqurstuvwxyzABCDEFGHIJKLMNOPQURSTUVWXYZ";return e.substr(t(62),1)},r=function(e){var t="";for(var r=0;r=7)return e.replace("_","%20");var t={__smallWords:["a","an","and","as","at","but","by","en","for","if","in","of","on","or","the","to","v[.]?","via","vs[.]?"],init:function(){this.__smallRE=this.__smallWords.join("|");this.__lowerCaseWordsRE=new RegExp("\\b("+this.__smallRE+")\\b","gi");this.__firstWordRE=new RegExp("^([^a-zA-Z0-9 \\r\\n\\t]*)("+this.__smallRE+")\\b","gi");this.__lastWordRE=new RegExp("\\b("+this.__smallRE+")([^a-zA-Z0-9 \\r\\n\\t]*)$","gi")},toTitleCase:function(e){var t="",n=e.split(/([:.;?!][ ]|(?:[ ]|^)["“])/);for(var r=0;r=0)if(o[t].href===e.urls[0]){l("css");break}i+=1;e&&(i<200?setTimeout(d,50):l("css"))}}var t,n,r={},i=0,s={css:[],js:[]},o=e.styleSheets,u=[];return{css:function(e,t,n,r){if(a(e))return t;h("css",e,t,n,r)},js:function(e,t,n,r){if(a(e))return t;h("js",e,t,n,r)}}}(this.document));typeof VMM!="undefined"&&typeof VMM.ExternalAPI=="undefined"&&(VMM.ExternalAPI={pushQues:function(){VMM.master_config.googlemaps.active&&VMM.ExternalAPI.googlemaps.pushQue();VMM.master_config.youtube.active&&VMM.ExternalAPI.youtube.pushQue();VMM.master_config.soundcloud.active&&VMM.ExternalAPI.soundcloud.pushQue();VMM.master_config.googledocs.active&&VMM.ExternalAPI.googledocs.pushQue();VMM.master_config.googleplus.active&&VMM.ExternalAPI.googleplus.pushQue();VMM.master_config.wikipedia.active&&VMM.ExternalAPI.wikipedia.pushQue();VMM.master_config.vimeo.active&&VMM.ExternalAPI.vimeo.pushQue();VMM.master_config.twitter.active&&VMM.ExternalAPI.twitter.pushQue();VMM.master_config.flickr.active&&VMM.ExternalAPI.flickr.pushQue()},twitter:{tweetArray:[],get:function(e,t){var n={mid:e,id:t};VMM.master_config.twitter.que.push(n);VMM.master_config.twitter.active=!0},create:function(e,t){var n=e.mid.toString(),r={twitterid:e.mid},i="http://api.twitter.com/1/statuses/show.json?id="+e.mid+"&include_entities=true&callback=?",s=setTimeout(VMM.ExternalAPI.twitter.errorTimeOut,VMM.master_config.timers.api,e),o=setTimeout(t,VMM.master_config.timers.api,e);VMM.getJSON(i,function(t){var n=t.id_str,r="

",i=VMM.Util.linkify_with_twitter(t.text,"_blank");r+=i;r+="

";typeof t.entities.media!="undefined"&&t.entities.media[0].type=="photo";r+="";VMM.attachElement("#"+e.id.toString(),r);VMM.attachElement("#text_thumb_"+e.id.toString(),t.text)}).error(function(t,n,r){trace("TWITTER error");trace("TWITTER ERROR: "+n+" "+t.responseText);VMM.attachElement("#"+e.id,VMM.MediaElement.loadingmessage("ERROR LOADING TWEET "+e.mid))}).success(function(e){clearTimeout(s);clearTimeout(o);t()})},errorTimeOut:function(e){trace("TWITTER JSON ERROR TIMEOUT "+e.mid);VMM.attachElement("#"+e.id.toString(),VMM.MediaElement.loadingmessage("Still waiting on Twitter: "+e.mid));VMM.getJSON("http://api.twitter.com/1/account/rate_limit_status.json",function(t){trace("REMAINING TWITTER API CALLS "+t.remaining_hits);trace("TWITTER RATE LIMIT WILL RESET AT "+t.reset_time);var n="";if(t.remaining_hits==0){n="

You've reached the maximum number of tweets you can load in an hour.

";n+="

You can view tweets again starting at:
"+t.reset_time+"

"}else n="

Still waiting on Twitter. "+e.mid+"

";VMM.attachElement("#"+e.id.toString(),VMM.MediaElement.loadingmessage(n))})},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(e){var t="http://api.twitter.com/1/statuses/oembed.json?id="+e+"&callback=?";VMM.getJSON(t,VMM.ExternalAPI.twitter.onJSONLoaded)},onJSONLoaded:function(e){trace("TWITTER JSON LOADED");var t=e.id;VMM.attachElement("#"+t,VMM.Util.linkify_with_twitter(e.html))},parseTwitterDate:function(e){var t=new Date(Date.parse(e));return t},prettyParseTwitterDate:function(e){var t=new Date(Date.parse(e));return VMM.Date.prettyDate(t,!0)},getTweets:function(e){var t=[],n=e.length;for(var r=0;r
";r.content=i;r.raw=e;t.push(r);if(t.length==n){var o={tweetdata:t};VMM.fireEvent(global,"TWEETSLOADED",o)}}).success(function(){trace("second success")}).error(function(){trace("error")}).complete(function(){trace("complete")})}},getTweetSearch:function(e,t){var n=40;t!=null&&t!=""&&(n=t);var r="http://search.twitter.com/search.json?q="+e+"&rpp="+n+"&include_entities=true&result_type=mixed",i=[];VMM.getJSON(r,function(e){for(var t=0;t

",s=VMM.Util.linkify_with_twitter(e.results[t].text,"_blank");r+=s;r+="

";r+="— "+e.results[t].from_user_name+" (@"+e.results[t].from_user+") "+VMM.ExternalAPI.twitter.prettyParseTwitterDate(e.results[t].created_at)+"
";n.content=r;n.raw=e.results[t];i.push(n)}var o={tweetdata:i};VMM.fireEvent(global,"TWEETSLOADED",o)})},prettyHTML:function(e,t){var e=e.toString(),n={twitterid:e},r="http://api.twitter.com/1/statuses/show.json?id="+e+"&include_entities=true&callback=?",i=setTimeout(VMM.ExternalAPI.twitter.errorTimeOut,VMM.master_config.timers.api,e);VMM.getJSON(r,VMM.ExternalAPI.twitter.formatJSON).error(function(t,n,r){trace("TWITTER error");trace("TWITTER ERROR: "+n+" "+t.responseText);VMM.attachElement("#twitter_"+e,"

ERROR LOADING TWEET "+e+"

")}).success(function(e){clearTimeout(i);t&&VMM.ExternalAPI.twitter.secondaryMedia(e)})},formatJSON:function(e){var t=e.id_str,n="

",r=VMM.Util.linkify_with_twitter(e.text,"_blank");n+=r;n+="

";n+="";typeof e.entities.media!="undefined"&&e.entities.media[0].type=="photo"&&(n+="");VMM.attachElement("#twitter_"+t.toString(),n);VMM.attachElement("#text_thumb_"+t.toString(),e.text)}},googlemaps:{get:function(e,t){var n,r,i;i=VMM.Util.getUrlVars(e);VMM.master_config.Timeline.api_keys.google!=""?r=VMM.master_config.Timeline.api_keys.google:r=Aes.Ctr.decrypt(VMM.master_config.api_keys_master.google,VMM.master_config.vp,256);var s="http://maps.googleapis.com/maps/api/js?key="+r+"&libraries=places&sensor=false&callback=VMM.ExternalAPI.googlemaps.onMapAPIReady",o={url:e,vars:i,id:t};if(VMM.master_config.googlemaps.active)VMM.master_config.googlemaps.que.push(o);else{VMM.master_config.googlemaps.que.push(o);VMM.master_config.googlemaps.api_loaded||VMM.LoadLib.js(s,function(){trace("Google Maps API Library Loaded")})}},create:function(e){function i(e){if(e in VMM.ExternalAPI.googlemaps.map_providers){t=VMM.ExternalAPI.googlemaps.map_attribution[VMM.ExternalAPI.googlemaps.map_providers[e].attribution];return VMM.ExternalAPI.googlemaps.map_providers[e]}if(VMM.ExternalAPI.googlemaps.defaultType(e)){trace("GOOGLE MAP DEFAULT TYPE");return google.maps.MapTypeId[e.toUpperCase()]}trace("Not a maptype: "+e)}function d(){var t=e.url+"&output=kml";t=t.replace("&output=embed","");var n=new google.maps.KmlLayer(t,{preserveViewport:!0}),i=new google.maps.InfoWindow;n.setMap(r);google.maps.event.addListenerOnce(n,"defaultviewport_changed",function(){r.fitBounds(n.getDefaultViewport());a&&r.panTo(s);f&&r.setZoom(u)});google.maps.event.addListener(n,"click",function(e){function n(e){i.setContent(e);i.open(r)}var t=e.featureData.description;n(t)})}var t="",n,r;google.maps.VeriteMapType=function(e){if(VMM.ExternalAPI.googlemaps.defaultType(e))return google.maps.MapTypeId[e.toUpperCase()];var t=i(e);return google.maps.ImageMapType.call(this,{getTileUrl:function(e,n){var r=(n+e.x+e.y)%VMM.ExternalAPI.googlemaps.map_subdomains.length;return[t.url.replace("{S}",VMM.ExternalAPI.googlemaps.map_subdomains[r]).replace("{Z}",n).replace("{X}",e.x).replace("{Y}",e.y).replace("{z}",n).replace("{x}",e.x).replace("{y}",e.y)]},tileSize:new google.maps.Size(256,256),name:e,minZoom:t.minZoom,maxZoom:t.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)?n=google.maps.MapTypeId[VMM.master_config.Timeline.maptype.toUpperCase()]:n=VMM.master_config.Timeline.maptype:n="toner";var s=new google.maps.LatLng(41.875696,-87.624207),o,u=11,a=!1,f=!1,l;if(type.of(VMM.Util.getUrlVars(e.url)["ll"])=="string"){a=!0;o=VMM.Util.getUrlVars(e.url).ll.split(",");s=new google.maps.LatLng(parseFloat(o[0]),parseFloat(o[1]))}else if(type.of(VMM.Util.getUrlVars(e.url)["sll"])=="string"){o=VMM.Util.getUrlVars(e.url).sll.split(",");s=new google.maps.LatLng(parseFloat(o[0]),parseFloat(o[1]))}if(type.of(VMM.Util.getUrlVars(e.url)["z"])=="string"){f=!0;u=parseFloat(VMM.Util.getUrlVars(e.url).z)}var c={zoom:u,disableDefaultUI:!0,mapTypeControl:!1,zoomControl:!0,zoomControlOptions:{style:google.maps.ZoomControlStyle.SMALL,position:google.maps.ControlPosition.TOP_RIGHT},center:s,mapTypeId:n,mapTypeControlOptions:{mapTypeIds:[n]}},h=e.id.toString()+"_gmap";VMM.attachElement("#"+e.id,"
");var r=new google.maps.Map(document.getElementById(h),c);if(!VMM.ExternalAPI.googlemaps.defaultType(VMM.master_config.Timeline.maptype)){r.mapTypes.set(n,new google.maps.VeriteMapType(n));var p="
"+t+"
";VMM.appendElement("#"+h,p)}d()},pushQue:function(){for(var e=0;eStamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA.",apple:"Map data © 2012 Apple, Imagery © 2012 Apple"},map_providers:{toner:{url:"http://{S}tile.stamen.com/toner/{Z}/{X}/{Y}.png",minZoom:0,maxZoom:20,attribution:"stamen"},"toner-lines":{url:"http://{S}tile.stamen.com/toner-lines/{Z}/{X}/{Y}.png",minZoom:0,maxZoom:20,attribution:"stamen"},"toner-labels":{url:"http://{S}tile.stamen.com/toner-labels/{Z}/{X}/{Y}.png",minZoom:0,maxZoom:20,attribution:"stamen"},sterrain:{url:"http://{S}tile.stamen.com/terrain/{Z}/{X}/{Y}.jpg",minZoom:4,maxZoom:20,attribution:"stamen"},apple:{url:"http://gsp2.apple.com/tile?api=1&style=slideshow&layers=default&lang=en_US&z={z}&x={x}&y={y}&v=9",minZoom:4,maxZoom:14,attribution:"apple"},watercolor:{url:"http://{S}tile.stamen.com/watercolor/{Z}/{X}/{Y}.jpg",minZoom:3,maxZoom:16,attribution:"stamen"}}},googleplus:{get:function(e,t){var n,r={user:e,activity:t};VMM.master_config.googleplus.que.push(r);VMM.master_config.googleplus.active=!0},create:function(e,t){var n="",r="",i="",s="",o="",u,a;googleplus_timeout=setTimeout(VMM.ExternalAPI.googleplus.errorTimeOut,VMM.master_config.timers.api,e),callback_timeout=setTimeout(t,VMM.master_config.timers.api,e);VMM.master_config.Timeline.api_keys.google!=""?r=VMM.master_config.Timeline.api_keys.google:r=Aes.Ctr.decrypt(VMM.master_config.api_keys_master.google,VMM.master_config.vp,256);u="https://www.googleapis.com/plus/v1/people/"+e.user+"/activities/public?alt=json&maxResults=100&fields=items(id,url)&key="+r;n="GOOGLE PLUS API CALL";VMM.getJSON(u,function(t){for(var u=0;u";s+=t.object.content}else s+=t.object.content;if(typeof t.object.attachments!="undefined"){for(var r=0;r"+""+o;else if(t.object.attachments[r].objectType=="video"){o=""+o;o+=""}else if(t.object.attachments[r].objectType=="article"){o+=""}trace(t.object.attachments[r])}o="
"+o+"
"}n="
"+s+o+"
";n+="";VMM.attachElement("#googleplus_"+e.activity,n)});break}}}).error(function(t,n,r){var i=VMM.parseJSON(t.responseText);trace(i.error.message);VMM.attachElement("#googleplus_"+e.activity,VMM.MediaElement.loadingmessage("

ERROR LOADING GOOGLE+

"+i.error.message+"

"))}).success(function(e){clearTimeout(googleplus_timeout);clearTimeout(callback_timeout);t()})},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(e){trace("GOOGLE+ JSON ERROR TIMEOUT "+e.activity);VMM.attachElement("#googleplus_"+e.activity,VMM.MediaElement.loadingmessage("

Still waiting on GOOGLE+

"+e.activity+"

"))}},googledocs:{get:function(e,t){var n={url:e,id:t};VMM.master_config.googledocs.que.push(n);VMM.master_config.googledocs.active=!0},create:function(e){var t="";e.url.match(/docs.google.com/i)?t="":t="";VMM.attachElement("#"+e.id,t)},pushQue:function(){for(var e=0;e")}).error(function(e,t,n){trace("FLICKR error");trace("FLICKR ERROR: "+t+" "+e.responseText)}).success(function(e){clearTimeout(r);t()})},pushQue:function(){if(VMM.master_config.flickr.que.length>0){VMM.ExternalAPI.flickr.create(VMM.master_config.flickr.que[0],VMM.ExternalAPI.flickr.pushQue);VMM.master_config.flickr.que.remove(0)}},sizes:function(e){var t="";e<=75?t="Thumbnail":e<=180?t="Small":e<=240?t="Small 320":e<=375?t="Medium":e<=480?t="Medium 640":e<=600?t="Medium 800":t="Large";return t}},instagram:{get:function(e,t){return t?"http://instagr.am/p/"+e+"/media/?size=t":"http://instagr.am/p/"+e+"/media/?size="+VMM.ExternalAPI.instagram.sizes(VMM.master_config.sizes.api.height)},sizes:function(e){var t="";e<=150?t="t":e<=306?t="m":t="l";return t}},soundcloud:{get:function(e,t){var n={mid:e,id:t};VMM.master_config.soundcloud.que.push(n);VMM.master_config.soundcloud.active=!0},create:function(e,t){var n="http://soundcloud.com/oembed?url="+e.mid+"&format=js&callback=?";VMM.getJSON(n,function(n){VMM.attachElement("#"+e.id,n.html);t()})},pushQue:function(){if(VMM.master_config.soundcloud.que.length>0){VMM.ExternalAPI.soundcloud.create(VMM.master_config.soundcloud.que[0],VMM.ExternalAPI.soundcloud.pushQue);VMM.master_config.soundcloud.que.remove(0)}}},wikipedia:{get:function(e,t,n){var r={url:e,id:t,lang:n};VMM.master_config.wikipedia.que.push(r);VMM.master_config.wikipedia.active=!0},create:function(e,t){var n="http://"+e.lang+".wikipedia.org/w/api.php?action=query&prop=extracts&redirects=&titles="+e.url+"&exintro=1&format=json&callback=?";callback_timeout=setTimeout(t,VMM.master_config.timers.api,e);if(VMM.Browser.browser=="Explorer"&&parseInt(VMM.Browser.version,10)>=7&&window.XDomainRequest){var r="

"+e.url+"

";r+=""+VMM.master_config.language.messages.wikipedia+"";r+="

Wikipedia entry unable to load using Internet Explorer 8 or below.

";VMM.attachElement("#"+e.id,r)}VMM.getJSON(n,function(t){if(t.query){var n,r,i="",s="",o=1,u=[];n=VMM.Util.getObjectAttributeByIndex(t.query.pages,0).extract;r=VMM.Util.getObjectAttributeByIndex(t.query.pages,0).title;n.match("

")?u=n.split("

"):u.push(n);for(var a=0;a"+u[a+1]);i="

"+r+"

";i+=""+VMM.master_config.language.messages.wikipedia+"";i+=VMM.Util.linkify_wikipedia(s);n.match("REDIRECT")||VMM.attachElement("#"+e.id,i)}}).error(function(n,r,i){trace("WIKIPEDIA error");trace("WIKIPEDIA ERROR: "+r+" "+n.responseText);trace(i);VMM.attachElement("#"+e.id,VMM.MediaElement.loadingmessage("

Wikipedia is not responding

"));clearTimeout(callback_timeout);if(VMM.master_config.wikipedia.tries<4){trace("WIKIPEDIA ATTEMPT "+VMM.master_config.wikipedia.tries);trace(e);VMM.master_config.wikipedia.tries++;VMM.ExternalAPI.wikipedia.create(e,t)}else t()}).success(function(e){VMM.master_config.wikipedia.tries=0;clearTimeout(callback_timeout);t()})},pushQue:function(){if(VMM.master_config.wikipedia.que.length>0){trace("WIKIPEDIA PUSH QUE "+VMM.master_config.wikipedia.que.length);VMM.ExternalAPI.wikipedia.create(VMM.master_config.wikipedia.que[0],VMM.ExternalAPI.wikipedia.pushQue);VMM.master_config.wikipedia.que.remove(0)}}},youtube:{get:function(e,t){var n="http://gdata.youtube.com/feeds/api/videos/"+e+"?v=2&alt=jsonc&callback=?",r={mid:e,id:t};VMM.master_config.youtube.que.push(r);VMM.master_config.youtube.active||VMM.master_config.youtube.api_loaded||VMM.LoadLib.js("http://www.youtube.com/player_api",function(){trace("YouTube API Library Loaded")});VMM.getJSON(n,function(e){VMM.ExternalAPI.youtube.createThumb(e,r)})},create:function(e){var t={active:!1,player:{},name:e.id,playing:!1};t.player[e.id]=new YT.Player(e.id,{height:"390",width:"640",playerVars:{enablejsapi:1,color:"white",showinfo:0,theme:"light",rel:0},videoId:e.mid,events:{onReady:VMM.ExternalAPI.youtube.onPlayerReady,onStateChange:VMM.ExternalAPI.youtube.onStateChange}});VMM.master_config.youtube.array.push(t)},createThumb:function(e,t){trace("CREATE THUMB");trace(e);trace(t);if(typeof e.data!="undefined"){var n="#"+t.id+"_thumb";VMM.attachElement(n,"")}},pushQue:function(){for(var e=0;e")},pushQue:function(){if(VMM.master_config.vimeo.que.length>0){VMM.ExternalAPI.vimeo.create(VMM.master_config.vimeo.que[0],VMM.ExternalAPI.vimeo.pushQue);VMM.master_config.vimeo.que.remove(0)}}}});typeof VMM!="undefined"&&typeof VMM.MediaElement=="undefined"&&(VMM.MediaElement={init:function(){return this},loadingmessage:function(e){return"

"+e+"

"},thumbnail:function(e,t,n,r){var i=16,s=24,o="";t!=null&&t!=""&&(i=t);n!=null&&n!=""&&(s=n);r!=null&&r!=""&&(o=r);if(e.media!=null&&e.media!=""){var u=!0,a="",f=VMM.MediaType(e.media);if(f.type=="image"){a="
";return a}if(f.type=="flickr"){a="
";return a}if(f.type=="instagram"){a="
";return a}if(f.type=="youtube"){a="
";return a}if(f.type=="googledoc"){a="
";return a}if(f.type=="vimeo"){a="
";return a}if(f.type=="dailymotion"){a="
";return a}if(f.type=="twitter"){a="
";return a}if(f.type=="twitter-ready"){a="
";return a}if(f.type=="soundcloud"){a="
";return a}if(f.type=="google-map"){a="
";return a}if(f.type=="googleplus"){a="
";return a}if(f.type=="wikipedia"){a="
";return a}if(f.type=="storify"){a="
";return a}if(f.type=="quote"){a="
";return a}if(f.type=="unknown"){f.id.match("blockquote")?a="
":a="
";return a}if(f.type=="website"){a="
";return a}a="
";return a}},create:function(e,t){var n=!1,r=VMM.MediaElement.loadingmessage(VMM.master_config.language.messages.loading+"...");if(e.media!=null&&e.media!=""){var i="",s="",o="",u="",a=!1,f;f=VMM.MediaType(e.media);n=!0;e.credit!=null&&e.credit!=""&&(o="
"+VMM.Util.linkify_with_twitter(e.credit,"_blank")+"
");e.caption!=null&&e.caption!=""&&(s="
"+VMM.Util.linkify_with_twitter(e.caption,"_blank")+"
");if(f.type=="image")i="
";else if(f.type=="flickr"){i="
";VMM.ExternalAPI.flickr.get(f.id,t,f.link)}else if(f.type=="instagram")i="
";else if(f.type=="googledoc"){i="
"+r+"
";VMM.ExternalAPI.googledocs.get(f.id,t)}else if(f.type=="youtube"){i="
"+r+"
";VMM.ExternalAPI.youtube.get(f.id,t)}else if(f.type=="vimeo"){i="
";VMM.ExternalAPI.vimeo.get(f.id,t)}else if(f.type=="dailymotion")i="
";else if(f.type=="twitter"){i="";a=!0;VMM.ExternalAPI.twitter.get(f.id,t)}else if(f.type=="twitter-ready"){a=!0;i=f.id}else if(f.type=="soundcloud"){i="
"+r+"
";VMM.ExternalAPI.soundcloud.get(f.id,t)}else if(f.type=="google-map"){i="
"+r+"
";VMM.ExternalAPI.googlemaps.get(f.id,t)}else if(f.type=="googleplus"){u="googleplus_"+f.id;i="
"+r+"
";a=!0;VMM.ExternalAPI.googleplus.get(f.user,f.id,t)}else if(f.type=="wikipedia"){i="
"+r+"
";a=!0;VMM.ExternalAPI.wikipedia.get(f.id,t,f.lang)}else if(f.type=="storify"){a=!0;i="
"+f.id+"
"}else if(f.type=="quote"){a=!0;i="
"+f.id+"
"}else if(f.type=="unknown"){trace("NO KNOWN MEDIA TYPE FOUND TRYING TO JUST PLACE THE HTML");a=!0;i="
"+VMM.Util.properQuotes(f.id)+"
"}else if(f.type=="website")i="";else{trace("NO KNOWN MEDIA TYPE FOUND");trace(f.type)}i="
"+i+o+s+"
";return a?"
"+i+"
":"
"+i+"
"}}}.init());typeof VMM!="undefined"&&typeof VMM.MediaType=="undefined"&&(VMM.MediaType=function(e){var t=!1,n={type:"unknown",id:"",link:"",lang:"",uniqueid:VMM.Util.unique_ID(6)};if(e.match("div class='twitter'")){n.type="twitter-ready";n.id=e;t=!0}else if(e.match("(www.)?youtube|youtu.be")){e.match("v=")?n.id=VMM.Util.getUrlVars(e).v:e.match("/embed/")?n.id=e.split("embed/")[1].split(/[?&]/)[0]:n.id=e.split(/v\/|v=|youtu\.be\//)[1].split(/[?&]/)[0];n.type="youtube";t=!0}else if(e.match("(player.)?vimeo.com")){n.type="vimeo";n.id=e.split(/video\/|\/\/vimeo\.com\//)[1].split(/[?&]/)[0];t=!0}else if(e.match("(www.)?dailymotion.com")){n.id=e.split(/video\/|\/\/dailymotion\.com\//)[1];n.type="dailymotion";t=!0}else if(e.match("(player.)?soundcloud.com")){n.type="soundcloud";n.id=e;t=!0}else if(e.match("(www.)?twitter.com")&&e.match("status")){e.match("status/")?n.id=e.split("status/")[1]:e.match("statuses/")?n.id=e.split("statuses/")[1]:n.id="";n.type="twitter";t=!0}else if(e.match("maps.google")&&!e.match("staticmap")){n.type="google-map";n.id=e.split(/src=['|"][^'|"]*?['|"]/gi);t=!0}else if(e.match("plus.google")){n.type="googleplus";n.id=e.split("/posts/")[1];e.split("/posts/")[0].match("u/0/")?n.user=e.split("u/0/")[1].split("/posts")[0]:n.user=e.split("google.com/")[1].split("/posts/")[0];t=!0}else if(e.match("flickr.com/photos")){n.type="flickr";n.id=e.split("photos/")[1].split("/")[1];n.link=e;t=!0}else if(e.match("instagr.am/p/")){n.type="instagram";n.link=e;n.id=e.split("/p/")[1].split("/")[0];t=!0}else if(e.match(/jpg|jpeg|png|gif/i)||e.match("staticmap")||e.match("yfrog.com")||e.match("twitpic.com")){n.type="image";n.id=e;t=!0}else if(VMM.FileExtention.googleDocType(e)){n.type="googledoc";n.id=e;t=!0}else if(e.match("(www.)?wikipedia.org")){n.type="wikipedia";var r=e.split("wiki/")[1].split("#")[0].replace("_"," ");n.id=r.replace(" ","%20");n.lang=e.split("//")[1].split(".wikipedia")[0];t=!0}else if(e.indexOf("http://")==0){n.type="website";n.id=e;t=!0}else if(e.match("storify")){n.type="storify";n.id=e;t=!0}else if(e.match("blockquote")){n.type="quote";n.id=e;t=!0}else{trace("unknown media");n.type="unknown";n.id=e;t=!0}if(t)return n;trace("No valid media id detected");trace(e);return!1});if(typeof VMM!="undefined"&&typeof VMM.Media=="undefined"){VMM.Media=function(e,t,n,r){function p(){}var i={},s=!1,o={width:720,height:400,content_width:720,content_height:400,ease:"easeInOutExpo",duration:1e3,spacing:15},u="",a="",f="",l="",c=e;t!=null&&t!=""&&(o.width=t);n!=null&&n!=""&&(o.height=n);this.init=function(e){typeof e!="undefined"?this.setData(e):trace("WAITING ON DATA")};var h=function(e,t,n){u=VMM.appendAndGetElement(c,"
","media");a=VMM.appendAndGetElement(u,"
","container");f=VMM.appendAndGetElement(a,"
","media-container");if(i.media!=null&&i.media!=""){s=!0;var r={};r=VMM.MediaType(i.media);r.type=="image"?VMM.appendElement(f,""):r.type=="youtube"?VMM.appendElement(f,"":t="";VMM.attachElement("#"+e.id,t)},pushQue:function(){for(var e=0;e")}).error(function(e,t,n){trace("FLICKR error");trace("FLICKR ERROR: "+t+" "+e.responseText)}).success(function(e){clearTimeout(r);t()})},pushQue:function(){if(VMM.master_config.flickr.que.length>0){VMM.ExternalAPI.flickr.create(VMM.master_config.flickr.que[0],VMM.ExternalAPI.flickr.pushQue);VMM.master_config.flickr.que.remove(0)}},sizes:function(e){var t="";e<=75?t="Thumbnail":e<=180?t="Small":e<=240?t="Small 320":e<=375?t="Medium":e<=480?t="Medium 640":e<=600?t="Medium 800":t="Large";return t}},instagram:{get:function(e,t){return t?"http://instagr.am/p/"+e+"/media/?size=t":"http://instagr.am/p/"+e+"/media/?size="+VMM.ExternalAPI.instagram.sizes(VMM.master_config.sizes.api.height)},sizes:function(e){var t="";e<=150?t="t":e<=306?t="m":t="l";return t}},soundcloud:{get:function(e,t){var n={mid:e,id:t};VMM.master_config.soundcloud.que.push(n);VMM.master_config.soundcloud.active=!0},create:function(e,t){var n="http://soundcloud.com/oembed?url="+e.mid+"&format=js&callback=?";VMM.getJSON(n,function(n){VMM.attachElement("#"+e.id,n.html);t()})},pushQue:function(){if(VMM.master_config.soundcloud.que.length>0){VMM.ExternalAPI.soundcloud.create(VMM.master_config.soundcloud.que[0],VMM.ExternalAPI.soundcloud.pushQue);VMM.master_config.soundcloud.que.remove(0)}}},wikipedia:{get:function(e,t,n){var r={url:e,id:t,lang:n};VMM.master_config.wikipedia.que.push(r);VMM.master_config.wikipedia.active=!0},create:function(e,t){var n="http://"+e.lang+".wikipedia.org/w/api.php?action=query&prop=extracts&redirects=&titles="+e.url+"&exintro=1&format=json&callback=?";callback_timeout=setTimeout(t,VMM.master_config.timers.api,e);if(VMM.Browser.browser=="Explorer"&&parseInt(VMM.Browser.version,10)>=7&&window.XDomainRequest){var r="

"+e.url+"

";r+=""+VMM.master_config.language.messages.wikipedia+"";r+="

Wikipedia entry unable to load using Internet Explorer 8 or below.

";VMM.attachElement("#"+e.id,r)}VMM.getJSON(n,function(t){if(t.query){var n,r,i="",s="",o=1,u=[];n=VMM.Util.getObjectAttributeByIndex(t.query.pages,0).extract;r=VMM.Util.getObjectAttributeByIndex(t.query.pages,0).title;n.match("

")?u=n.split("

"):u.push(n);for(var a=0;a"+u[a+1]);i="

"+r+"

";i+=""+VMM.master_config.language.messages.wikipedia+"";i+=VMM.Util.linkify_wikipedia(s);n.match("REDIRECT")||VMM.attachElement("#"+e.id,i)}}).error(function(n,r,i){trace("WIKIPEDIA error");trace("WIKIPEDIA ERROR: "+r+" "+n.responseText);trace(i);VMM.attachElement("#"+e.id,VMM.MediaElement.loadingmessage("

Wikipedia is not responding

"));clearTimeout(callback_timeout);if(VMM.master_config.wikipedia.tries<4){trace("WIKIPEDIA ATTEMPT "+VMM.master_config.wikipedia.tries);trace(e);VMM.master_config.wikipedia.tries++;VMM.ExternalAPI.wikipedia.create(e,t)}else t()}).success(function(e){VMM.master_config.wikipedia.tries=0;clearTimeout(callback_timeout);t()})},pushQue:function(){if(VMM.master_config.wikipedia.que.length>0){trace("WIKIPEDIA PUSH QUE "+VMM.master_config.wikipedia.que.length);VMM.ExternalAPI.wikipedia.create(VMM.master_config.wikipedia.que[0],VMM.ExternalAPI.wikipedia.pushQue);VMM.master_config.wikipedia.que.remove(0)}}},youtube:{get:function(e,t){var n="http://gdata.youtube.com/feeds/api/videos/"+e+"?v=2&alt=jsonc&callback=?",r={mid:e,id:t};VMM.master_config.youtube.que.push(r);VMM.master_config.youtube.active||VMM.master_config.youtube.api_loaded||VMM.LoadLib.js("http://www.youtube.com/player_api",function(){trace("YouTube API Library Loaded")});VMM.getJSON(n,function(e){VMM.ExternalAPI.youtube.createThumb(e,r)})},create:function(e){var t={active:!1,player:{},name:e.id,playing:!1};t.player[e.id]=new YT.Player(e.id,{height:"390",width:"640",playerVars:{enablejsapi:1,color:"white",showinfo:0,theme:"light",rel:0},videoId:e.mid,events:{onReady:VMM.ExternalAPI.youtube.onPlayerReady,onStateChange:VMM.ExternalAPI.youtube.onStateChange}});VMM.master_config.youtube.array.push(t)},createThumb:function(e,t){trace("CREATE THUMB");trace(e);trace(t);if(typeof e.data!="undefined"){var n="#"+t.id+"_thumb";VMM.attachElement(n,"")}},pushQue:function(){for(var e=0;e")},pushQue:function(){if(VMM.master_config.vimeo.que.length>0){VMM.ExternalAPI.vimeo.create(VMM.master_config.vimeo.que[0],VMM.ExternalAPI.vimeo.pushQue);VMM.master_config.vimeo.que.remove(0)}}}});typeof VMM!="undefined"&&typeof VMM.MediaElement=="undefined"&&(VMM.MediaElement={init:function(){return this},loadingmessage:function(e){return"

"+e+"

"},thumbnail:function(e,t,n,r){var i=16,s=24,o="";t!=null&&t!=""&&(i=t);n!=null&&n!=""&&(s=n);r!=null&&r!=""&&(o=r);if(e.media!=null&&e.media!=""){var u=!0,a="",f=VMM.MediaType(e.media);if(f.type=="image"){a="
";return a}if(f.type=="flickr"){a="
";return a}if(f.type=="instagram"){a="
";return a}if(f.type=="youtube"){a="
";return a}if(f.type=="googledoc"){a="
";return a}if(f.type=="vimeo"){a="
";return a}if(f.type=="dailymotion"){a="
";return a}if(f.type=="twitter"){a="
";return a}if(f.type=="twitter-ready"){a="
";return a}if(f.type=="soundcloud"){a="
";return a}if(f.type=="google-map"){a="
";return a}if(f.type=="googleplus"){a="
";return a}if(f.type=="wikipedia"){a="
";return a}if(f.type=="storify"){a="
";return a}if(f.type=="quote"){a="
";return a}if(f.type=="unknown"){f.id.match("blockquote")?a="
":a="
";return a}if(f.type=="website"){a="
";return a}a="
";return a}},create:function(e,t){var n=!1,r=VMM.MediaElement.loadingmessage(VMM.master_config.language.messages.loading+"...");if(e.media!=null&&e.media!=""){var i="",s="",o="",u="",a=!1,f;f=VMM.MediaType(e.media);n=!0;e.credit!=null&&e.credit!=""&&(o="
"+VMM.Util.linkify_with_twitter(e.credit,"_blank")+"
");e.caption!=null&&e.caption!=""&&(s="
"+VMM.Util.linkify_with_twitter(e.caption,"_blank")+"
");if(f.type=="image")i="
";else if(f.type=="flickr"){i="
";VMM.ExternalAPI.flickr.get(f.id,t,f.link)}else if(f.type=="instagram")i="
";else if(f.type=="googledoc"){i="
"+r+"
";VMM.ExternalAPI.googledocs.get(f.id,t)}else if(f.type=="youtube"){i="
"+r+"
";VMM.ExternalAPI.youtube.get(f.id,t)}else if(f.type=="vimeo"){i="
";VMM.ExternalAPI.vimeo.get(f.id,t)}else if(f.type=="dailymotion")i="
";else if(f.type=="twitter"){i="";a=!0;VMM.ExternalAPI.twitter.get(f.id,t)}else if(f.type=="twitter-ready"){a=!0;i=f.id}else if(f.type=="soundcloud"){i="
"+r+"
";VMM.ExternalAPI.soundcloud.get(f.id,t)}else if(f.type=="google-map"){i="
"+r+"
";VMM.ExternalAPI.googlemaps.get(f.id,t)}else if(f.type=="googleplus"){u="googleplus_"+f.id;i="
"+r+"
";a=!0;VMM.ExternalAPI.googleplus.get(f.user,f.id,t)}else if(f.type=="wikipedia"){i="
"+r+"
";a=!0;VMM.ExternalAPI.wikipedia.get(f.id,t,f.lang)}else if(f.type=="storify"){a=!0;i="
"+f.id+"
"}else if(f.type=="quote"){a=!0;i="
"+f.id+"
"}else if(f.type=="unknown"){trace("NO KNOWN MEDIA TYPE FOUND TRYING TO JUST PLACE THE HTML");a=!0;i="
"+VMM.Util.properQuotes(f.id)+"
"}else if(f.type=="website")i="";else{trace("NO KNOWN MEDIA TYPE FOUND");trace(f.type)}i="
"+i+o+s+"
";return a?"
"+i+"
":"
"+i+"
"}}}.init());typeof VMM!="undefined"&&typeof VMM.MediaType=="undefined"&&(VMM.MediaType=function(e){var t=!1,n={type:"unknown",id:"",link:"",lang:"",uniqueid:VMM.Util.unique_ID(6)};if(e.match("div class='twitter'")){n.type="twitter-ready";n.id=e;t=!0}else if(e.match("(www.)?youtube|youtu.be")){e.match("v=")?n.id=VMM.Util.getUrlVars(e).v:e.match("/embed/")?n.id=e.split("embed/")[1].split(/[?&]/)[0]:n.id=e.split(/v\/|v=|youtu\.be\//)[1].split(/[?&]/)[0];n.type="youtube";t=!0}else if(e.match("(player.)?vimeo.com")){n.type="vimeo";n.id=e.split(/video\/|\/\/vimeo\.com\//)[1].split(/[?&]/)[0];t=!0}else if(e.match("(www.)?dailymotion.com")){n.id=e.split(/video\/|\/\/dailymotion\.com\//)[1];n.type="dailymotion";t=!0}else if(e.match("(player.)?soundcloud.com")){n.type="soundcloud";n.id=e;t=!0}else if(e.match("(www.)?twitter.com")&&e.match("status")){e.match("status/")?n.id=e.split("status/")[1]:e.match("statuses/")?n.id=e.split("statuses/")[1]:n.id="";n.type="twitter";t=!0}else if(e.match("maps.google")&&!e.match("staticmap")){n.type="google-map";n.id=e.split(/src=['|"][^'|"]*?['|"]/gi);t=!0}else if(e.match("plus.google")){n.type="googleplus";n.id=e.split("/posts/")[1];e.split("/posts/")[0].match("u/0/")?n.user=e.split("u/0/")[1].split("/posts")[0]:n.user=e.split("google.com/")[1].split("/posts/")[0];t=!0}else if(e.match("flickr.com/photos")){n.type="flickr";n.id=e.split("photos/")[1].split("/")[1];n.link=e;t=!0}else if(e.match("instagr.am/p/")){n.type="instagram";n.link=e;n.id=e.split("/p/")[1].split("/")[0];t=!0}else if(e.match(/jpg|jpeg|png|gif/i)||e.match("staticmap")||e.match("yfrog.com")||e.match("twitpic.com")){n.type="image";n.id=e;t=!0}else if(VMM.FileExtention.googleDocType(e)){n.type="googledoc";n.id=e;t=!0}else if(e.match("(www.)?wikipedia.org")){n.type="wikipedia";var r=e.split("wiki/")[1].split("#")[0].replace("_"," ");n.id=r.replace(" ","%20");n.lang=e.split("//")[1].split(".wikipedia")[0];t=!0}else if(e.indexOf("http://")==0){n.type="website";n.id=e;t=!0}else if(e.match("storify")){n.type="storify";n.id=e;t=!0}else if(e.match("blockquote")){n.type="quote";n.id=e;t=!0}else{trace("unknown media");n.type="unknown";n.id=e;t=!0}if(t)return n;trace("No valid media id detected");trace(e);return!1});if(typeof VMM!="undefined"&&typeof VMM.Media=="undefined"){VMM.Media=function(e,t,n,r){function p(){}var i={},s=!1,o={width:720,height:400,content_width:720,content_height:400,ease:"easeInOutExpo",duration:1e3,spacing:15},u="",a="",f="",l="",c=e;t!=null&&t!=""&&(o.width=t);n!=null&&n!=""&&(o.height=n);this.init=function(e){typeof e!="undefined"?this.setData(e):trace("WAITING ON DATA")};var h=function(e,t,n){u=VMM.appendAndGetElement(c,"
","media");a=VMM.appendAndGetElement(u,"
","container");f=VMM.appendAndGetElement(a,"
","media-container");if(i.media!=null&&i.media!=""){s=!0;var r={};r=VMM.MediaType(i.media);r.type=="image"?VMM.appendElement(f,""):r.type=="youtube"?VMM.appendElement(f,"