CONSOLE_NONE=0;CONSOLE_ERROR=1;CONSOLE_WARN=2;CONSOLE_INFO=3;CONSOLE_DEBUG=4;CONSOLE_LOG=5;CONSOLE_ALL=9;var P=function(a){for(var b=CONSOLE_NONE,e=a.console,d=/(iphone|ipad|ipod|android)/.test(navigator.userAgent.toLowerCase()),c={},k=[],j,f,l=["error",
"warn","info","debug","log"],p="assert clear count dir dirxml exception group groupCollapsed groupEnd profile profileEnd table time timeEnd trace".split(" "),s=p.length;--s>=0;)(function(g){c[g]=function(){b!==0&&e&&e[g]&&e[g].apply(e,arguments)}})(p[s]);for(s=l.length;--s>=0;)(function(g,u){c[u]=function(){k.push([u].concat(Array.prototype.slice.call(arguments)));if(j&&(f||!e||!e.log))j.apply(a,arguments);if((b>0?b>g:l.length+b<=g)&&e)try{e[u]?d?e[u].call(e,arguments.join(" ")):e[u].apply(e,arguments):
d?e.log.call(e,arguments.join(" ")):e.log.apply(e,arguments)}catch(y){e.log(Array.prototype.slice.call(arguments).join(" "))}}})(s,l[s]);c.getLogs=function(){return k};c.setCallback=function(g,u){j=g;f=!!u};c.setLevel=function(g){b=Number(g)};return c}(window);window.debug=P;(function(a){function b(V,T){var O=/^\w+\:\/\//,da;if(typeof V!=c)V="";if(typeof T!=c)T="";da=(O.test(V)?"":T)+V;return(O.test(da)?"":da.charAt(0)==="/"?ia:ba)+da}function e(V,T){function O(n,I){if(n[l]&&n[l]!==y&&n[l]!=="loaded"||I[v])return J;n[C]=n[q]=h;return F}function da(n,I,W){if((W=!!W)||O(n,I)){I[v]=F;for(var Q in o)if(o[D](Q)&&!o[Q][v])return;Zb=F;$b()}}function Y(n){if(L.call(n[s])===m){n[s]();n[s]=h}}function R(n,
I){if(O(n,I)){I[p]=F;M(function(){H[I[w]].removeChild(n);Y(I)},0)}}function pc(n,I){if(n[l]===4){n[q]=t;I[p]=F;M(function(){Y(I)},0)}}function ma(n,I,W,Q,oa,ya){var A=n[w];M(function(){if("item"in H[A]){if(!H[A][0]){M(arguments.callee,25);return}H[A]=H[A][0]}var K=N.createElement(f);if(typeof W==c)K.type=W;if(typeof Q==c)K.charset=Q;if(L.call(oa)===m){K[C]=K[q]=function(){oa(K,n)};K.src=I;if(U)K.async=J}H[A].insertBefore(K,A===k?H[A].firstChild:h);if(typeof ya==c){K.text=ya;da(K,n,F)}},0)}function ta(n,
I,W,Q){G[n[g]]=F;ma(n,I,W,Q,da)}function na(n,I,W,Q){var oa=arguments;if(ha&&n[p]==h){n[p]=J;ma(n,I,i,Q,R)}else if(!ha&&n[p]!=h&&!n[p])n[s]=function(){na.apply(h,oa)};else ha||ta.apply(h,oa)}function bb(n,I,W,Q){var oa=arguments,ya;if(ha&&n[p]==h){n[p]=J;ya=n.xhr=E?new E("Microsoft.XMLHTTP"):new a.XMLHttpRequest;ya[q]=function(){pc(ya,n)};ya.open("GET",I);ya.send("")}else if(!ha&&n[p]!=h&&!n[p])n[s]=function(){bb.apply(h,oa)};else if(!ha){G[n[g]]=F;ma(n,I,W,Q,h,n.xhr.responseText);n.xhr=h}}function tb(n){if(n.allowDup==
h)n.allowDup=T.dupe;var I=n.type,W=n.charset,Q=n.allowDup;n=b(n.src,qc);var oa=b(n).indexOf(ia)===0;if(typeof W!=c)W=h;Q=!!Q;if(Q=!Q){if(!(Q=G[n]!=h)){if(!(Q=ha&&o[n]))a:{for(var ya=-1;Q=fa[++ya];)if(typeof Q.src==c&&n===b(Q.src)&&Q.type!==i){Q=F;break a}Q=J}Q=Q}Q=Q}if(Q)o[n]!=h&&o[n][p]&&!o[n][v]&&oa&&da(h,o[n],F);else{if(o[n]==h)o[n]={};Q=o[n];if(Q[w]==h)Q[w]=pa;Q[v]=J;Q[g]=n;Kb=F;if(!cb&&Bb&&oa)bb(Q,n,I,W);else!cb&&Cb?na(Q,n,I,W):ta(Q,n,I,W)}}function ub(n){V&&!cb&&Ca.push(n);if(!V||db)n()}function eb(n){var I=
[],W;for(W=-1;++W<n.length;)if(L.call(n[W])===r)I=I.concat(eb(n[W]));else I[I.length]=n[W];return I}V=!!V;if(T==h)T=aa;var Zb=J,db=V&&T[u],Cb=db&&T.cache,cb=db&&T.order,Bb=db&&T.xhr,Qa=T[z],pa=T.which,qc=T.base,$b=t,Kb=J,Db,ha=F,o={},Ca=[],ua=h;db=Cb||Bb||cb;Db={script:function(){B(ua);var n=eb(arguments),I=Db,W;if(Qa)for(W=-1;++W<n.length;){if(W===0)ub(function(){tb(typeof n[0]==c?{src:n[0]}:n[0])});else I=I.script(n[W]);I=I.wait()}else ub(function(){for(W=-1;++W<n.length;)tb(typeof n[W]==c?{src:n[W]}:
n[W])});ua=M(function(){ha=J},5);return I},wait:function(n){B(ua);ha=J;L.call(n)===m||(n=t);var I=e(F,T),W=I.trigger,Q=function(){try{n()}catch(ya){}W()};delete I.trigger;var oa=function(){if(Kb&&!Zb)$b=Q;else Q()};V&&!Kb?Ca.push(oa):ub(oa);return I}};if(V)Db.trigger=function(){for(var n,I=-1;n=Ca[++I];)n();Ca=[]};return Db}function d(V){var T,O={},da={UseCachePreload:"cache",UseLocalXHR:"xhr",UsePreloading:u,AlwaysPreserveOrder:z,AllowDuplicates:"dupe"},Y={AppendTo:w,BasePath:"base"};for(T in da)Y[T]=
da[T];O.order=!!aa.order;for(T in Y)if(Y[D](T)&&aa[Y[T]]!=h)O[Y[T]]=V[T]!=h?V[T]:aa[Y[T]];for(T in da)if(da[D](T))O[da[T]]=!!O[da[T]];if(!O[u])O.cache=O.order=O.xhr=J;O.which=O.which===k||O.which===j?O.which:k;return O}var c="string",k="head",j="body",f="script",l="readyState",p="preloaddone",s="loadtrigger",g="srcuri",u="preload",y="complete",v="done",w="which",z="preserve",q="onreadystatechange",C="onload",D="hasOwnProperty",i="script/cache",m="[object Function]",r="[object Array]",h=null,F=true,
J=false,N=a.document,E=a.ActiveXObject,M=a.setTimeout,B=a.clearTimeout,L=Object.prototype.toString,t=function(){},H={},G={},ba=/^[^?#]*\//.exec(a.location.href)[0],ia=/^\w+\:\/\/\/?[^\/]+/.exec(ba)[0],fa=N.getElementsByTagName(f),xa=a.opera&&L.call(a.opera)=="[object Opera]",S="MozAppearance"in N.documentElement.style,U=N.createElement(f).async===true,aa={cache:!(S||xa),order:S||xa||U,xhr:F,dupe:F,base:"",which:k};aa[z]=J;aa[u]=F;H[k]=N.head||N.getElementsByTagName(k);H[j]=N.getElementsByTagName(j);
a.$LAB={setGlobalDefaults:function(V){aa=d(V)},setOptions:function(V){return e(J,d(V))},script:function(){return e().script.apply(h,arguments)},wait:function(){return e().wait.apply(h,arguments)}};(function(V,T,O){if(N[l]==h&&N[V]){N[l]="loading";N[V](T,O=function(){N.removeEventListener(T,O,J);N[l]=y},J)}})("addEventListener","DOMContentLoaded")})(window);(function(){var a=false,b=/xyz/.test(function(){})?/\b_super\b/:/.*/;this.MingClass=function(){};MingClass.extend=function(e){function d(){!a&&this.init&&this.init.apply(this,arguments)}var c=this.prototype;
a=true;var k=new this;a=false;for(var j in e)k[j]=typeof e[j]=="function"&&typeof c[j]=="function"&&b.test(e[j])?function(f,l){return function(){var p=this._super;this._super=c[f];var s=l.apply(this,arguments);this._super=p;return s}}(j,e[j]):e[j];d.prototype=k;d.constructor=d;d.extend=arguments.callee;return d}})();XHR=function(){function a(e){try{return JSON.parse(e)}catch(d){return e}}
function b(e,d,c,k,j,f){var l=/^(\w+:)?\/\/([^\/?#]+)/.exec(d);l=l&&(l[1]&&l[1].toLowerCase()!==location.protocol||l[2].toLowerCase()!==location.host);var p=window.XDomainRequest&&l?new XDomainRequest:window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");if(f==="script"&&e==="GET"&&l){var s=document.getElementsByTagName("head")[0]||document.documentElement,g=document.createElement("script"),u=false;g.src=d;g.onload=g.onreadystatechange=function(){if(!u&&(!this.readyState||
this.readyState==="loaded"||this.readyState==="complete")){u=true;g.onload=g.onreadystatechange=null;s&&g.parentNode&&s.removeChild(g)}};s.insertBefore(g,s.firstChild);return true}p.open(e,d,!!k);if(p.setRequestHeader){p.setRequestHeader("Content-Type","application/x-www-form-urlencoded");l||p.setRequestHeader("X-Requested-With","XMLHttpRequest")}if(j)p.withCredentials=true;if(k)p.onreadystatechange=function(){p.readyState===4&&k.call(p,a(p.responseText),p.status)};p.send(c);return k?true:a(p.responseText)}
this.get=function(e,d){return b("GET",e,null,d)};this.getWithCredentials=function(e,d){return b("GET",e,null,d,true)};this.getJson=function(e,d){return b("GET",e,null,null,d,"script")};this.post=function(e,d,c){return b("POST",e,d,c)};this.postWithCredentials=function(e,d,c){return b("POST",e,d,c,true)};this.request=b};window.XHR=XHR;ICanHas=function(a,b){return{cors:function(){var e=b.XDomainRequest||b.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest;if(e){e=new Boolean(e);e.withCredentials=
!window.XDomainRequest}return e}(),orientation:window.orientation!==void 0,touch:"ontouchstart"in b,video:function(){var e=a.createElement("video"),d=!!e.canPlayType;if(d){d=new Boolean(d);d.vp6=e.canPlayType('video/x-flv; codecs="vp6"')||false;d.vp8=e.canPlayType('video/webm; codecs="vp8,vorbis"')||false;d.h264=navigator.userAgent.toLowerCase().search("android")>-1?"probably":e.canPlayType('video/mp4; codecs="avc1.42E01E"')||e.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"')||false}return d}()}}(document,
window);FlashDetect=function(){var a=navigator,b=false,e=0,d=0,c=0,k=null,j=null;if(a.plugins&&a.plugins.length){if((a=a.plugins["Shockwave Flash"])&&a.description){k=a.description;
b=true}}else if(a.mimeTypes&&a.mimeTypes.length){if((a=a.mimeTypes["application/x-shockwave-flash"])&&a.enabledPlugin)b=true}else try{k=(new ActiveXObject("ShockwaveFlash.ShockwaveFlash")).GetVariable("$version");b=true}catch(f){}if(k){j=k.replace(/\D+/g,".").replace(/^\./,"");a=j.split(".");e=parseInt(a[0],10);d=parseInt(a[1],10);c=parseInt(a[2],10)}return{installed:b,raw:k,version:j,major:e,minor:d,revision:c,versionAtLeast:function(l,p,s){l=l||10;p=p||0;s=s||0;var g=[e,d,c],u=arguments,y=Math.min(g.length,
u.length),v;for(v=0;v<y;v++)if(g[v]>=u[v]){if(!(v+1<y&&g[v]===u[v]))return true}else return false}}}();$m={};(function(a){function b(i,m,r){if(a.type(r)!=="array"||r===l)r=[r];for(var h=0,F=r.length;h<F;h++)r[h][i]||(r[h][i]=m);a[i]=function(){var J=
Array.prototype.slice.call(arguments),N=J.shift();return m.apply(N,J)}}function e(i,m,r,h){r[i]=m;h.push(i);h.length>1E3&&delete r[h.shift()];return m}function d(i,m){if(i in m)return m[i];return false}function c(){var i=this.valueOf();return i<0?~~i-1:~~i}function k(i,m){return this<m?i>this?i:this:m}function j(i,m){var r=this.valueOf()+"";return Array(i-r.length+1).join(m||"0")+r}if(!window.Element)window.Element={};for(var f=document,l=Array.prototype,p=!window.HTMLElement?{}:HTMLElement.prototype,
s=!window.NodeList?{}:NodeList.prototype,g=Number.prototype,u=String.prototype,y=window,v={},w=[],z="Boolean Number String Function Array Date RegExp Object".split(" "),q=[],C=0,D=z.length;C<D;C++)q["[object "+z[C]+"]"]=z[C].toLowerCase();a.type=function(i){return i==null?String(i):q[Object.prototype.toString.call(i)]||"object"};a.isArray=function(i){return a.type(i)==="array"};a.emptyFunction=function(){};a.clone=function(i){var m=a.isArray(i)?[]:{};for(C in i)if(C!=="clone")m[C]=i[C]&&a.type(i[C])===
"object"?a.clone(i[C]):i[C];return m};a.addEventListener=function(i,m,r){window.addEventListener?i.addEventListener(m,r,false):i.attachEvent("on"+m,r)};a.removeEventListener=function(i,m,r){window.removeEventListener?i.removeEventListener(m,r,false):i.detachEvent("on"+m,r)};a.findKey=function(i,m){for(var r in m)if(m.hasOwnProperty(r)&&m[r]===i)return r;return false};a.fibonacci=function(i){var m=Math.sqrt(5);return(1/m*Math.pow((1+m)/2,i)-1/m*Math.pow((1-m)/2,i)).round()};a.withinElement=function(i,
m){var r=m.relatedTarget;try{if(r&&r!==document&&!r.parentNode)return true;for(;r&&r!==i;)r=r.parentNode;if(r!==i)return false}catch(h){}return true};b("abs",function(){var i=this.valueOf();return i<0?-i:i},g);b("addClass",function(i){if(this.length&&this.forEach)this.forEach(function(m){a.addClass(m,i)});else if(!a.hasClass(this,i))this.className=this.className.split(" ").concat(i).unique().join(" ").trim();return this},[p,s]);b("attr",function(i,m){if(a.type(i)==="object"){for(prop in i)this.setAttribute(prop,
i[prop]);return this}if(m===void 0)return this.getAttribute(i);m===null||m===""?this.removeAttribute(i):this.setAttribute(i,m);return this},p);b("ceil",function(){return c.call(this.valueOf()+1)},g);b("clamp",function(i,m,r){function h(){if(checkCount>200)return false;if(F.innerText!=i||F[property]==0){checkCount++;setTimeout(h,1)}else a:if(!(F[property]<=r)){for(;F[property]>r;){F.innerText=F.innerText.substr(0,F.innerText.length-1);if(F.innerText==""||F.innerText.length==0)break a}F.innerText=F.innerText.substr(0,
F.innerText.length-3)+"..."}}var F=this;F.innerHTML=i;property=m=="height"?"clientHeight":"clientWidth";checkCount=0;h();return F},p);b("clear",function(){this.childNodes.forEach(function(i){i.remove&&i.remove()});return this},p);b("computeStyle",function(i){if(!y.getComputedStyle)y.getComputedStyle=function(m){this.el=m;this.getPropertyValue=function(r){var h=/(\-([a-z]){1})/g;if(r=="float")r="styleFloat";if(h.test(r))r=r.replace(h,function(F,J,N){return N.toUpperCase()});return m.currentStyle&&
m.currentStyle[r]?m.currentStyle[r]:null};return this};return y.getComputedStyle(this,null).getPropertyValue(i)},p);b("contains",function(i){return this.indexOf(i)!==-1},[l,u]);b("css",function(i,m){if(a.type(i)==="object"){for(prop in i)this.style[prop]=i[prop];return this}if(m===void 0)return this.style[i];this.style[i]=m===null||m===""?"":m;return this},p);b("floor",c,g);b("forEach",function(i,m){if(a.type(i)==="function")for(var r=this.length>>>0,h=0;h<r;h++)h in this&&i.call(m,this[h],h,this)},
[l,s]);b("getElementsByClassName",function(i){var m=[],r=0,h,F,J;if(document.evaluate){h=".//*[contains(concat(' ', @class, ' '), ' "+i+" ')]";for(F=document.evaluate(h,this,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);J=F.snapshotItem(r++);)m[m.length]=J}else{h=RegExp("(^|\\s)"+i+"(\\s|$)");F=this.getElementsByTagName("*");r=0;for(var N=F.length;r<N;r++){J=F[r];if(J.className===i||h.test(J.className))m[m.length]=J}}return m},f);b("hasAncestor",function(i){if(i===this)return true;for(var m=this.parentNode;m;){if(m===
i)return true;m=m.parentNode}return false},p);b("hasClass",function(i){if(i.splice){for(var m=this.className.split(" "),r=0,h=m.length;r<h;r++)if(i.contains(m[r]))return true;return false}return RegExp("(?:^|\\s+)"+i+"(?:\\s+|$)").test(this.className)},p);b("hex2rgb",function(){if(cached=d(this,v))return cached;var i=parseInt(this.replace("#",""),16);i=[(i&16711680)>>16,(i&65280)>>8,i&255];return e(this,"rgb("+i.join(",")+")",v,w)},u);b("html",function(i){if(i===void 0)return this.innerHTML;this.innerHTML=
i;return this},p);b("indexOf",function(i){for(var m=0,r=this.length;m<r;m++)if(this[m]==i)return m;return-1},l);b("innerHeight",function(){for(var i=0,m,r=0,h=this.childNodes.length;r<h;r++){m=this.childNodes[r];if(m.style)i+=m.clientHeight+(a.toInt(a.computeStyle(m,"margin-top"),10)||0)+(a.toInt(a.computeStyle(m,"margin-bottom",10))||0)}return i},p);b("limit",k,g);b("map",function(i,m){for(var r=this.length>>>0,h=Array(r),F=0;F<r;F++)if(F in this)h[F]=i.call(m,this[F],F,this);return h},l);b("max",
function(){return Math.max.apply(Math,this)},l);b("min",function(){return Math.min.apply(Math,this)},l);b("pad",j,[u,g]);b("position",function(){var i=0,m=0,r=this;if(r.offsetParent){do{i+=r.offsetLeft;m+=r.offsetTop}while(r=r.offsetParent)}return{x:i,y:m}},p);b("prependChild",function(i){return this.insertBefore(i,this.firstChild)},p);b("q",function(i){return this.querySelector(i)},[f,p]);b("qa",function(i){return this.querySelectorAll(i)},[f,p]);b("remove",function(){if(this.length)this.forEach(function(i){i.parentNode&&
i.parentNode.removeChild(i)});else this.parentNode&&this.parentNode.removeChild(this)},[p,s]);b("removeClass",function(i){if(this.length&&this.forEach)this.forEach(function(m){a.removeClass(m,i)});else if(a.hasClass(this,i))this.className=this.className.replace(RegExp("(?:^|\\s+)"+i+"(?:\\s+|$)","g")," ").trim();return this},[p,s]);b("rgb2hex",function(){if(cached=d(this,v))return cached;var i=this.match(/\d{1,3}/g).slice(0,3);i=i.map(function(m){return j.call(k.call(parseInt(m,10),0,255).toString(16),
2)});return e(this,i.join(""),v,w)},u);b("round",function(){return c.call(this.valueOf()+0.5)},g);b("toInt",function(i){return parseInt(this.valueOf?this.valueOf():this,i||10)},[u,g]);b("toFloat",function(i){return parseFloat(this.valueOf(),i||10)},[u,g]);b("trim",function(){return this.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},u);b("ucfirst",function(){return this.charAt(0).toUpperCase()+this.slice(1)},u);b("unique",function(){var i=[],m=0,r=this.length;a:for(;m<r;m++){for(var h=0,F=i.length;h<
F;h++)if(i[h]===this[m])continue a;i[i.length]=this[m]}return i},l);b("wrap",function(i,m){var r=this,h=a.addClass(document.createElement(i),m||"");r.length||(r=Array(this));r.forEach(function(F,J){J===0&&F.parentNode.replaceChild(h,F);h.appendChild(F)});return h},[p,s])})($m);EventManager=function(){function a(d){if(!b[d]){var c=document.createElement("a");c.id="Event:"+d;e.appendChild(c);b[d]=c}return b[d]}var b={},e=document.createElement("div");
e.id="events"+(new Date).getTime();document.body.appendChild(e);this.bind=function(d,c){var k=a(d);window.addEventListener?k.addEventListener("click",c,false):k.attachEvent("onclick",c);return this};this.unbind=function(d,c){var k=a(d);window.removeEventListener?k.removeEventListener("click",c,false):k.detachEvent("onclick",c);return this};this.fire=function(d,c){var k,j=a(d);if(document.createEvent){k=document.createEvent("HTMLEvents");k.initEvent("click",false,true);k.name=d;k.data=c;return j.dispatchEvent(k)}else{try{c=
JSON.stringify(c)}catch(f){}k=document.createEventObject();k.name=d;k.data=c;return j.fireEvent("onclick",k)}}};window.EventManager=EventManager;var vb="ming",wb="moogaloop",gc="noplayer",rc="nomobile",ab="mobile",fc="touch",Xb="desktop",Ec="html",
Dc="flash",ga="noplayer",sa="hd",Ma="sd",Ia="mobile",Gc=[sa,Ma,Ia],ed="pl_volume",Ac="hd_preference",Hb="onwebkittransitionend"in window?"webkitTransitionEnd":"transitionEnd",Gb=8,fd=250,Bc=140,Cc=200,gd=265;ga=200;var Nb=7,ic=1.5,Hc=2E3,Fc=1500,Fa=1,Ra=2,Tb=3,ka=4,va=5,Ea=6,Vb=7,zb=8,hb=9,hd=10,id=11,Ic=12,Jc=13,Ob=14,Jb=15,nb=16,Kc=17,lc=18,mc=19,Yb=20,Lc=21,nc=22,oc=23,ea=24,wa=25,xb=26,Sa=27,Ub=28,la=29,Ib=30,Mc=31,Va=32,Wa=33,Xa=34,Ya=35,kb="loadProgress",lb="playProgress",jb="play",ib="pause",
yb="finish",mb="seek",sb="ready",cd="error",hc="addEventListener()",sc="removeEventListener()",pb="play()",ob="pause()",qb="seekTo()",rb="unload()",Na="setColor()",Za="setLoop()",$a="setVolume()",Aa="getDuration()",za="getCurrentTime()",Oa="getVolume()",tc="getColor()",Ab="getLoop()",uc="getVideoUrl()",vc="getVideoEmbedCode()",Ta="getVideoWidth()",Ua="getVideoHeight()",Ga="paused()",Da="a",Wb="ab",Lb="ap",dc="ar",Z="bj",X="r",kc="bd",Sb="ae",Zc="c",$c="j",ad="k",bd="l";ga="ag";ga="b";ga="c";ga="g";
var Nc="ax",jd="o";ga="al";ga="cj";var Eb="x",Fb="w",fb="aa",Ha="k",Mb="v",La="j",cc="bf",ec="bb",Vc="cm",Wc="z",bc="bx",Xc="as",gb="bw",ac="cu",kd="ay",ra="b",wc="h",xc="an";ga="by";var Oc="i",ld="bl",md="az",Pb="ak";ga="cv";var nd="af",od="m";ga="at";var yc="s",pd="am",qd="aj",Ba="e",qa="d",Qb="ah",Rb="cg",jc="bs",Pc="bh",rd="p",sd="videos",td="au",Pa="q",ud="bk",Qc="bi",ja="l",zc="n",vd="bn",Rc="ai",wd="y";ga="dd";var Sc="ch",Tc="bm",xd="bz",Uc="bt";ga="d";var Yc="br",dd="cc";if(window.$){$=$;$$=$$}var x=MingClass.extend({init:function(a,b,e){function d(){if(!ICanHas.video)return false;if(l.ie)return false;if(l.safari&&l.safari<4)return false;for(var p in c.config.video.files)if(ICanHas.video[p])return true;return false}var c=this,k=b.assets,j,f;j=navigator;
f=j.userAgent.toLowerCase();j=j.platform.toLowerCase();var l={webkit:"webkitAppearance"in document.documentElement.style?parseFloat(f.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,firefox:/firefox/.test(f)?f.replace(/^.*firefox\/(\d+\.\d+\.\d+).*$/,"$1"):false,safari:/safari/.test(f)?parseFloat(f.replace(/^.*version\/(\d+)\.(\d+)?.*$/,"$1.$2")):false,ie:navigator.appName=="Microsoft Internet Explorer",opera:window.opera&&{}.toString.call(window.opera)=="[object Opera]"||false,win:j?/win/.test(j):
/win/.test(f),mac:/mac/.test(j||f)?parseFloat(f.replace(/^.* ((\d+)(_|\.)?(\d+)?).*$/,"$2.$4")):false,linux:j?/linux/.test(j):/linux/.test(f),android:/android/.test(f)?parseFloat(f.replace(/^.* android (\d+)\.(\d+).*$/,"$1.$2")):false,playBook:/playbook/.test(f)};c.element=a;c.config=b.config;c.playerType=null;c.playerMode=null;c.playableFiles=null;c.thumbs=b.thumbs;c.api=false;c.ua=l;c.uniqueId=b.uniqueId;x.cookieDomain=c.config.request.cookie_domain;c.playerMode=function(){if(c.playerMode)return c.playerMode;
var p=Xb;if(Math.min(screen.width,screen.height)<=480||x.getCookie("test_mobiloop")=="1"||l.android&&l.android<3)p=ab;else if(ICanHas.orientation)p=fc;return p}();c.playableFiles=function(){var p=c.config.video,s=p.files,g={hd:false,sd:false,mobile:false};for(codec in s)if(ICanHas.video[codec]){if(c.playerMode===ab){if($m.contains(s[codec],Ia))g.mobile=codec;else if(x.mobileCanPlaySD()&&$m.contains(s[codec],Ma))g.sd=codec;break}for(var u=0,y=s[codec].length;u<y;u++){var v=s[codec][u];if(v===sa&&!g.hd)g.hd=
codec;else if(v===Ma&&!g.sd)g.sd=codec;else if(v===Ia&&!g.mobile)g.mobile=codec}}if(!c.config.security.hd_embed)g.hd=false;if(c.playerMode===fc)if(p.height*p.width>921600){P.info("Can't play HD version on iPad: too big");g.hd=false;c.config.video.hd=false}return g}();c.playerType=function(p){var s=gc;switch(p){case Dc:s=FlashDetect.installed&&FlashDetect.major>=10?wb:d()?vb:s;break;case Ec:s=c.playerMode!==ab&&!c.playableFiles.hd&&!c.playableFiles.sd?FlashDetect.installed&&FlashDetect.major>=10?wb:
c.playableFiles.mobile?vb:s:d()?vb:FlashDetect.installed&&FlashDetect.major>=10?wb:s;break}if(c.playerMode===ab&&!c.playableFiles.mobile){a:{p=c.config.video.files;for(codec in p)if($m.contains(p[codec],Ia)){p=true;break a}p=false}s=p?gc:x.mobileCanPlaySD()&&c.playableFiles.sd?vb:rc}return s}(c.config.user.preferences.html===1?Ec:Dc);f=c.playerType===wb?k.moogaloop:k.ming[c.playerMode].js;j=c.playerType===wb?[]:k.ming[c.playerMode].css;P.info("Player Type:",c.playerType);P.info("Player Mode:",c.playerMode,
Math.min(screen.width,screen.height));P.info("Screen Size:",screen.width,"x",screen.height);P.info("Can play:",ICanHas.video.h264?"h264":"");P.info("Playable Files:",c.playableFiles.hd?"hd":"",c.playableFiles.sd?"sd":"",c.playableFiles.mobile?"mobile":"");c.setThumb();$m.forEach(j,function(p){var s=document.createElement("link");$m.attr(s,{rel:"stylesheet",href:k.css_path+p+(!k.cache?(p.indexOf("?")>-1?"&":"?")+(new Date).getTime():"")});document.getElementsByTagName("head")[0].appendChild(s)});j=
$LAB.setOptions({AlwaysPreserveOrder:true,BasePath:k.js_path});k.cache||(f=$m.map(f,function(p){return p+(p.indexOf("?")>-1?"&":"?")+(new Date).getTime()}));j.script(f).wait(function(){c.api=new x.API(c.config);playerElement=a.getElementsByTagName("div")[0];$m.addClass(playerElement,c.playerType===wb?Yc:Da);c.player=new (c.playerType===wb?x.Moogaloop:c.playerType===gc||c.playerType===rc?x.NoPlayer:x.Ming)(playerElement,b.options[c.playerType===rc?gc:c.playerType],c);e&&e.call(c)});P.info("Reticulating splines...")},
getConfig:function(){return this.config},setConfig:function(a){this.config=a},setThumb:function(){var a=this.element.getElementsByTagName("div")[0].getElementsByTagName("div")[0],b=a.getAttribute("data-thumb"),e=this.thumbs[640];for(var d in this.thumbs)if(this.thumbs.hasOwnProperty(d))if(this.element.clientWidth>=d-100||this.element.clientWidth>=940){e=this.thumbs[d];break}this.config.video.thumbnail=e;if(b!==e&&this.playerType===vb){a.style.backgroundImage="url("+e+")";a.setAttribute("data-thumb",
e)}}});x.setCookie=function(a,b,e,d){var c=document.getElementById(Zc),k="";e=e||87600;d=d||x.cookieDomain;if(c){document.getElementById($c).value=a;document.getElementById(ad).value=b;document.getElementById(bd).value=e;window.addEventListener("message",function(j){j.data=="refresh"&&x.xhrRefresh()},false);c.submit()}else{if(e){c=new Date;c.setTime(c.getTime()+e*60*60*1E3);k="; expires="+c.toGMTString()}d="; domain="+d;document.cookie=a+"="+b+k+"; path=/"+d}};x.getCookie=function(a){var b=document.cookie;
a=a+"=";var e;if(b&&b!==""){b=document.cookie.split(";");for(var d=0,c=b.length;d<c;d++){e=b[d].trim();if(e.indexOf(a)===0)return unescape(e.substr(a.length))}}return null};x.eatCookie=function(a){document.cookie=a+"=; expires=Thu, 01-Jan-70 00:00:01 GMT;"};x.xhrRefresh=function(){var a;(new XHR).get(document.location.href,function(b){a=document.getElementsByTagName("body")[0];a.innerHTML=b;$m.forEach(a.getElementsByTagName("script"),function(e){e.innerHTML&&(new Function(e.innerHTML)).call(window)})})};
x.checkRatio=function(a,b,e){if(!b)return false;e=e.video.width/e.video.height;var d=a.clientWidth/a.clientHeight;if(Math.abs(e-d)<0.02){$m.removeClass(a,Eb);$m.removeClass(a,Fb)}else if(d>e){$m.removeClass(a,Fb);$m.addClass(a,Eb)}else{$m.removeClass(a,Eb);$m.addClass(a,Fb)}$m.removeClass(b,Z)};x.mobileCanPlaySD=function(){return window.devicePixelRatio>=2};if(!x.init)x.init={queue:[],loaderAdded:false,loader:function(){x.init.queue.length>0&&x.init.queue.shift()()}};window.Player=x;x.Moogaloop=MingClass.extend({init:function(a,b,e){function d(t,H,G){P.info("url: ",t);var ba={server:q.request.vimeo_url,player_server:q.request.player_url,cdn_server:q.request.cdn_url,
embed_location:q.request.referrer,force_embed:b.force_embed,force_info:b.force_info,moogaloop_type:L,js_api:1,js_getConfig:b.ref_id+".getConfig",js_setConfig:b.ref_id+".setConfig",clip_id:q.video.id,fullscreen:1},ia={id:H.id,name:H.id,styleclass:X};if(C.ie)t+=(t.indexOf("?")>0?"&":"?")+"time="+(new Date).getTime();for(attr in G)if(G.hasOwnProperty(attr))ba[attr]=G[attr];swfobject.embedSWF(t,H.id,"100%","100%","10.0.0","/assets/flash/expressInstall.swf",ba,{allowscriptaccess:"always",allowfullscreen:"true",
scalemode:"noscale",quality:"high",wmode:"opaque",bgcolor:"#000000"},ia,function(fa){if(C.safari&&C.win){P.debug("Removing invisible from swfobject");$m.removeClass(fa.ref,X)}C.android&&C.android<2.2&&$m.removeClass(fa.ref,X);setTimeout(function(){if($m.hasClass(H,Pa))return t.indexOf(r)===0?z.loverLoaded():z.moogaloopLoaded();else if(B&&$m.hasClass(B,X))return t.indexOf(r)===0?z.loverThumbLoaded(true):z.moogaloopThumbLoaded(true)},2E3)})}function c(){setTimeout(function(){m.fire(sb)},0)}function k(){var t=
"cover"+e.uniqueId;N=document.getElementById(t);if(!N){N=document.createElement("div");N.setAttribute("id",t);$m.addClass(N,dd);a.appendChild(N)}d(r,N,{js_onLoad:b.ref_id+".player.loverLoaded",js_onThumbLoaded:b.ref_id+".player.loverThumbLoaded",js_setupMoog:b.ref_id+".player.loverInitiated"});q.embed.autoplay=1}function j(){var t="player"+e.uniqueId;E=document.getElementById(t);if(!E){E=document.createElement("div");E.setAttribute("id",t);a.appendChild(E)}d(h,E,{js_onLoad:b.ref_id+".player.moogaloopLoaded",
js_onThumbLoaded:b.ref_id+".player.moogaloopThumbLoaded"})}function f(){B&&B.api_pause()}function l(){if(M)z.loverInitiated();else B&&B.api_play()}function p(t){B&&B.api_seekTo(t.data)}function s(){B&&B.api_unload()}function g(t){q.embed.color=t.data;B&&B.api_changeColor(t.data)}function u(t){q.embed.loop=!!t.data;B&&B.api_setLoop(q.embed.loop)}function y(t){if(B){t=t.data;if(q.embed.api.version<2)t*=100;B.api_setVolume(t)}}function v(t){var H=false;switch(t.name){case za:H=B?B.api_getCurrentTime().toFixed(3):
0;break;case Aa:H=B?B.api_getDuration().toFixed(3):q.video.duration;break;case Oa:H=B?B.api_getVolume().toFixed(3):q.user.preferences.volume/100;break;case Ga:H=B?!!B.api_paused():true;break}i.sendBack(t.name,H)}function w(t){try{t.data=JSON.parse(t.data)}catch(H){}var G=q.embed.api.version<2?t.data:"on"+t.data.ucfirst();if(B){B.api_addEventListener(t.data,b.ref_id+".player."+G);P.debug("Adding listener",t.data,b.ref_id+".player."+G)}else{P.debug("Queuing listener",t.data,b.ref_id+".player."+G);F.push(["addEventListener",
t.data,b.ref_id+".player."+G])}}P.info("Options:",b);P.info("Config:",e.config);var z=this,q=e.config,C=e.ua,D=e.playerMode===fc?Xb:e.playerMode,i=e.api,m=i.events,r=b.swfs.cover[D],h=b.swfs.player[D+(FlashDetect.major>=10&&FlashDetect.minor>=2&&!C.linux?"_sv":"")],F=[],J,N,E,M,B,L=(D===ab?"mobi":"mooga")+"loop"+(q.embed.on_site?"_local":"");z.config=q;P.info("swfUrl: ",h,"playerMode: ",D);q.embed.api.on&&m.bind(ob,f).bind(pb,l).bind(qb,p).bind(rb,s).bind(Na,g).bind(Za,u).bind($a,y).bind(za,v).bind(Aa,
v).bind(Oa,v).bind(Ga,v).bind(hc,w);z.onProgress=function(t){m.fire(lb,t.toFloat().toFixed(3))};z.onPlayProgress=function(t){m.fire(lb,{seconds:t.seconds.toFloat().toFixed(3),percent:t.percent.toFloat().toFixed(3),duration:t.duration.toFloat().toFixed(3)})};z.onLoading=function(t){m.fire(kb,{bytes:t.bytesLoaded.toInt(),percent:t.percent.toFloat().toFixed(3)})};z.onLoadProgress=function(t){m.fire(kb,{percent:t.percent.toFloat().toFixed(3),bytesLoaded:t.bytesLoaded.toInt(),bytesTotal:t.bytesTotal.toInt(),
duration:t.duration.toFloat().toFixed(3)})};z.onPlay=function(){m.fire(jb)};z.onPause=function(){m.fire(ib)};z.onSeek=function(t){m.fire(mb,q.embed.api.version<2?t.toFloat().toFixed(3):{seconds:t.seconds.toFloat().toFixed(3),percent:t.percent.toFloat().toFixed(3),duration:t.duration.toFloat().toFixed(3)})};z.onFinish=function(){m.fire(yb)};z.loverLoaded=function(){P.info("Lover loaded");$m.removeClass(a,Pa);M=document.getElementById("cover"+e.uniqueId);c();setTimeout(function(){if($m.hasClass(M,X)){P.debug("Removing invisible from loaded timeout");
z.loverThumbLoaded(true)}},Fc)};z.loverThumbLoaded=function(t){P.info("Lover thumbnail loaded?",t);if(!M){M=document.getElementById("cover"+e.uniqueId);c()}$m.removeClass(M,X);$m.addClass(J,Z)};z.loverInitiated=function(){P.debug("Lover play button clicked");j()};z.moogaloopLoaded=function(){$m.removeClass(a,Pa);B=document.getElementById(b.ref_id);if(M){$m.remove(M);$m.removeClass(B,X);M=null}else c();if(q.embed.api.on&&F.length>0)for(;F.length>0;){var t=F.shift(),H="api_"+t.shift();P.debug("Calling",
H,"from queue",t);(new Function("this."+H+'("'+t.join('","')+'")')).call(B)}P.info("Welcome to Moogaloop!");setTimeout(function(){if($m.hasClass(B,X)){P.debug("Removing invisible from loaded timeout");z.moogaloopThumbLoaded(true)}},Fc)};z.moogaloopThumbLoaded=function(t){P.info("Moog thumbnail loaded?",t);B||(B=document.getElementById(b.ref_id));$m.removeClass(B,X);$m.addClass(J,Z)};z.destroy=function(){q.embed.api.on&&m.unbind(ob,f).unbind(pb,l).unbind(qb,p).unbind(rb,s).unbind(Na,g).unbind(Za,u).unbind($a,
y).unbind(za,v).unbind(Aa,v).unbind(Oa,v)};for(J=a.getElementsByTagName("div")[0];J.nextSibling;)a.removeChild(J.nextSibling);!(q.embed.on_site||q.embed.autoplay||q.embed.api.on||C.opera||D===ab||q.security.privacy==="password")?k():j();a.parentNode.api_seekTo=function(t){p({data:t})}}});x.NoPlayer=MingClass.extend({init:function(a,
b,e){function d(){var u=Math.round(a.clientWidth/2-f.clientWidth/2),y=Math.round(a.clientHeight/2-f.clientHeight/2);f.style.left=u+"px";f.style.top=y+"px"}function c(){g.get(cssPath,function(u){s=u;k()})}function k(){var u,y=document.createElement("style");u=p.substring(p.indexOf("<style>"),p.indexOf("</style>")+8);s+=u.replace(/<(\/)?style>/g,"");p.replace(u,"");if(e.ua.ie){y.type="text/css";y.styleSheet.cssText=s}else y.appendChild(document.createTextNode(s));document.getElementsByTagName("head")[0].appendChild(y);
f.innerHTML=p;if(script=f.getElementsByTagName("script")[0])setTimeout(function(){(new Function(script.innerHTML)).call(e.config)},0);setTimeout(function(){j.show()},100)}var j=this,f=a.children[3],l=a.children[4],p,s,g=new XHR;htmlPath=b.html_path+"/ming_overlay_"+e.playerType+".html";cssPath=b.css_path;j.element=a;j.show=function(){var u=f.getElementsByTagName("div")[0];$m.removeClass(f,Z);$m.removeClass(l,Z);d();setTimeout(function(){$m.addClass(u,Rb);$m.addClass(a,qa)},10)};for(window.addEventListener?
window.addEventListener("resize",d,false):window.attachEvent("onresize",d);f.previousSibling;){if(f.previousSibling.className===Wb)break;a.removeChild(f.previousSibling)}$m.removeClass(a,Pa);(function(){g.get(htmlPath+"?"+(new Date).getTime(),function(u){p=u;c()})})()}});x.API=MingClass.extend({init:function(a){function b(q){if(!q||q==="")return false;try{return JSON.parse(q)}catch(C){var D=
{},i,m,r;q.split("&").forEach(function(h){i=h.split("=");m=decodeURIComponent(i[0]);r=decodeURIComponent(i[1]);if(m!=="id"){if(m==="params")m="value";if(r.contains(","))r=r.split(",")[0];D[m]=r}});return D}}function e(q){if($m.type(q)!=="string"){q=(q=q)||{};if(s)q.player_id=s;q.data==="undefined"&&delete q.data;if(p>1&&window.JSON)q=JSON.stringify(q);else{var C="method="+encodeURIComponent(q.method||q.event)+"&params=",D=[];if(q.value)D.push(encodeURIComponent(q.value));else if($m.type(q.data)===
"object")for(var i in q.data)D.push(encodeURIComponent(q.data[i]));else q.data&&q.data!=="undefined"&&D.push(encodeURIComponent(q.data));q.player_id&&D.push(q.player_id);q=C+D.join(",")}}window.parent.postMessage(q,f);P.debug("<- Sent",q)}function d(q){var C=q.name,D=q.data;try{D=JSON.parse(q.data)}catch(i){}if(p<2){C=$m.findKey(C,u);switch(C){case "onSeek":case "onProgress":D.percent&&delete D.percent;case "onLoading":D.duration&&delete D.duration;break}}if(l[C]===true||q.name===sb)e({event:C,data:D})}
function c(q){var C=b(q.data);q=C.method;var D=C.value;if(!C||!q)return false;if(q.substr(0,4)==="api_"){q=q.substr(4);q=w[q]||q;q=q.replace("()","")}C=q+"()";if(C===hc){l[D]=true;z.fire(hc,D);P.debug("-> Now listening for",D)}else if(C===sc){l[D]=false;z.fire(sc,D);P.debug("-> Stop listening for",D)}else if(y.contains(C)){P.debug("-> Received",q,D);switch(C){case $a:D=D.toFloat();if(p<2)D/=100;break;case Za:D=!!D.toInt();break;case Na:if(D.search(/^[A-Fa-f\d]+$/g)===-1||D.length!==3&&D.length!==
6){P.warn("Invalid color value");return}break}z.fire(C,D)}else if(v.contains(C)){P.debug("-> Received request for",q,D);z.fire(C,D)}}function k(q){var C=false;switch(q.name){case tc:C=a.embed.color;break;case uc:C="http://"+a.request.vimeo_url+"/"+a.video.id;break;case vc:C=a.video.embed_code;break}j.sendBack(q.name,C)}if(!a.embed.api.on){this.events=new EventManager;return false}if(!window.postMessage||!window.parent.postMessage||window.location===window.parent.location){P.warn("Player API unavailable because this browser does not support postMessage or is not loaded in an iframe.");
a.embed.api.on=0;this.events=new EventManager;return false}var j=this,f=decodeURIComponent(a.request.referrer),l={},p=a.embed.api.version,s=a.embed.api.player_id,g=[kb,lb,jb,ib,yb,mb,sb,cd],u={onFinish:yb,onLoading:kb,onLoad:sb,onProgress:lb,onPlay:jb,onPause:ib,onSeek:mb},y=[hc,sc,pb,ob,Na,qb,Za,$a,rb],v=[Aa,za,Oa,tc,Ab,uc,vc,Ta,Ua,Ga],w={changeColor:Na},z=new EventManager;j.events=z;j.sendBack=function(q,C){q=q.replace("()","");if(p<2)q="api_"+q;e({method:q,value:C})};j.sendError=function(){P.error("API error")};
j.destroy=function(){window.removeEventListener?window.removeEventListener("message",c,false):window.detachEvent("onmessage",c)};g.forEach(function(q){z.bind(q,d)});z.bind(tc,k).bind(uc,k).bind(vc,k);window.addEventListener?window.addEventListener("message",c,false):window.attachEvent("onmessage",c)}});x.Stats=MingClass.extend({init:function(a,b){var e=b.playerType.ucfirst()+" "+b.playerMode.ucfirst(),d=window._gaq||[],c=null,k=b.playerType===vb?"local":"",j=(b.playerType===vb?"html5_"+b.playerMode:b.playerMode===ab?"mobiloop":"moogaloop")+"_"+(a.embed.on_site?k:"embed");d.push(["pt._setAccount",a.analytics.ga_account]);this.clientLog=function(){var f=new XHR,l="http://"+a.request.player_url+
"/log/client",p=["request_signature="+a.request.signature,"video="+ICanHas.video,"h264="+ICanHas.video.h264,"vp8="+ICanHas.video.vp8,"vp6="+ICanHas.video.vp6,"flash="+FlashDetect.version,"touch="+ICanHas.touch,"screen_width="+screen.width,"screen_height="+screen.height].join("&");f.post(l,p,function(){})};this.googleLog=function(f,l){l=parseInt(Number(l),10);if(isNaN(l))l=undefined;P.log("google analytics:",e,f,a.video.id,l);d.push(["pt._trackEvent",e,f,a.video.id+"",l])};this.partialPlayLog=function(f,
l,p){f=parseInt(f,10);if(f>c){var s=new XHR,g="http://"+a.request.player_url+"/log/partial";l="request_signature="+a.request.signature+"&seconds="+f+"&quality="+l;P.log("vimeo stats:",f,"seconds played");p?s.post(g,l):s.post(g,l,function(){});c=f}};this.vimeoLog=function(f,l,p,s){var g=new XHR,u="http://"+a.request.player_url+"/log/"+f+"/"+a.video.id,y="?embed_location="+a.request.referrer+"&request_signature="+a.request.signature;y+="&type="+j;if(l)y+="&quality="+l;if(p)y+="&percent="+p;P.log("vimeo stats:",
f,l,p);s?g.post(u,y):g.post(u,y,function(){})}}});if(!x.UI)x.UI={};x.UI.CanvasElement=MingClass.extend({init:function(a){if(!a)return false;this.element=a;this.origWidth=a.getAttribute("width");this.origHeight=a.getAttribute("height");this.width=this.origWidth*Gb;this.height=this.origHeight*Gb},draw:function(a,b,e,d,c){this.setData(a).setTranslation(b).setScale(e).setColor(d).setShadow(c);this.refresh();return this},setData:function(a){this.data=a;return this},setTranslation:function(a){this.translation=
a;return this},setScale:function(a){this.scale=a;return this},setColor:function(a){this.color=a;return this},setShadow:function(a){this.shadow=a;return this},refresh:function(){var a=this.data,b=this.shadow;try{if(!a||!this.element.getContext)return false}catch(e){return false}var d=this.scale||1,c=this.translation?$m.clone(this.translation):{x:0,y:0},k=this.color||"ffffff";this.element.attr({width:this.width,height:this.height});d*=Gb;c.x*=Gb;c.y*=Gb;var j=this.element.getContext("2d"),f;j.clearRect(0,
0,this.width,this.height);j.save();j.translate(c.x,c.y);j.scale(d,d);j.fillStyle=j.strokeStyle="#"+k;if(b){j.shadowOffsetX=j.shadowOffsetY=0;j.shadowBlur=10*Gb;j.shadowColor="rgba(0,0,0,0.5)"}d=0;for(c=a.length;d<c;d++)for(f in a[d])if(b=a[d][f])if($m.isArray(b))j[f].apply(j,b);else j[f]=b;else j[f].apply(j);j.restore();return this}});x.ContextMenu=MingClass.extend({init:function(a,b,e){function d(g){(g.target.hasAncestor?!g.target.hasAncestor(f):true)&&!c.isHidden&&c.hide()}var c=this,k=window,j=document,f=document.createElement("div"),l=[],p=!!e.win,s=!!e.mac;c.element=f;c.items=l;c.isHidden=true;c.add=function(g,u){var y=new x.ContextMenu.Item(g,c);u||(u=f);u.appendChild(y.element);l.push(y);g.type=="info"&&u.addClass(Tc)};c.remove=function(g){l.slice(g,1)};c.show=function(){c.refresh();
var g=event.pageX,u=event.pageY,y=j.width,v=j.height;if(g+f.clientWidth>y)g=y-f.clientWidth-5;if(u+f.clientHeight>v)u=v-f.clientHeight-5;f.attr("style","left: "+g+"px; top: "+u+"px;");f.removeClass(X);c.isHidden=false};c.hide=function(){f.addClass(X);c.isHidden=true};k.addEventListener("contextmenu",d,false);k.addEventListener("contextmenu",function(g){if(!(p?g&&g.ctrlKey:g&&g.metaKey)&&g.target.hasAncestor(a)){c.show();if(g.returnValue)g.returnValue=false;else if(g.preventDefault)g.preventDefault();
else return false}else c.isHidden||c.hide()},false);k.addEventListener("click",d,false);k.addEventListener("blur",d,false);k.addEventListener("mousedown",function(g){var u=g.target.hasAncestor?!g.target.hasAncestor(a):false,y=s?g&&g.metaKey:g&&g.ctrlKey;if(!c.isHidden||g&&g.button>0&&!u&&!y){g.stopPropagation&&g.stopPropagation();g.preventDefault&&g.preventDefault();g.preventCapture&&g.preventCapture()}k.focus()},false);b&&c.setData(b).refresh();f.addClass(wd);c.hide();j.getElementsByTagName("body")[0].appendChild(f)},
setData:function(a){this.data=a;return this},refresh:function(){function a(){var j=document.createElement("ul");d.appendChild(j);j.addClass("index"+k);k++;return j}function b(j,f){j.forEach(function(l){if($m.isArray(l)){c=c.children.length==0?c:a();b(l,c)}else e.add(l,f)})}var e=this,d=e.element,c,k=0;e.element.innerHTML="";c=a();b(e.data,c);return this}});x.ContextMenu.Item=MingClass.extend({init:function(a,b){this.element=document.createElement("li");this.controller=b;a&&this.setData(a).refresh()},
setData:function(a){this.data=a;return this},refresh:function(){function a(){j.addClass(Sc);j.addEventListener("click",function(){window.open(c.url)},false)}function b(){j.addClass(zc);j.innerHTML="<span>"+j.innerHTML+"</span>";var f=$m.type(c.active)==="function"?c.active.call():c.active;f&&j.addClass(gb);j.addEventListener("click",function(){(f=$m.type(c.active)==="function"?c.active.call():!c.active)?j.addClass(gb):j.removeClass(gb)},false)}function e(){j.addClass(Sc);j.addEventListener("click",
function(){var f=Array.prototype.slice.call(arguments);k=="toggle"&&f.push(c.active);d.controller.hide();c.action.apply(this,f)},false)}var d=this,c=d.data,k=d.data.type,j=d.element;j.innerHTML=$m.type(c.text)==="function"?c.text.call():c.text;if(k=="toggle")b();else if(k=="link")a();else k=="info"&&j.addClass(Tc);c.action&&e();return d}});
