(function(){var e=this,aa=function(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";
else if("function"==b&&"undefined"==typeof a.call)return"object";return b},g=function(a){return"string"==typeof a},h=function(a){return"boolean"==typeof a},k=function(a){return"number"==typeof a},m=function(a){var b=typeof a;return"object"==b&&null!=a||"function"==b},ba=function(a,b,c){return a.call.apply(a.bind,arguments)},ca=function(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,
d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}},n=function(a,b,c){n=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ba:ca;return n.apply(null,arguments)},p=function(a,b){var c=a.split("."),d=e;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var f;c.length&&(f=c.shift());)c.length||void 0===b?d[f]?d=d[f]:d=d[f]={}:d[f]=b},q=function(a,b){function c(){}c.prototype=b.prototype;a.P=b.prototype;a.prototype=new c;a.O=function(a,c,l){for(var d=
Array(arguments.length-2),f=2;f<arguments.length;f++)d[f-2]=arguments[f];return b.prototype[c].apply(a,d)}};var da=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},r=function(a,b){return a<b?-1:a>b?1:0};var u=function(a,b,c,d){this.j=a;this.g=b;this.a=c;this.f=d},v=function(a){return new u(a.j,a.g,a.a,a.f)};var ea=function(a){return/^\s*$/.test(a)?!1:/^[\],:{}\s\u2028\u2029]*$/.test(a.replace(/\\["\\\/bfnrtu]/g,"@").replace(/(?:"[^"\\\n\r\u2028\u2029\x00-\x08\x0a-\x1f]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)[\s\u2028\u2029]*(?=:|,|]|}|$)/g,"]").replace(/(?:^|:|,)(?:[\s\u2028\u2029]*\[)+/g,""))},w=function(a){a=String(a);if(ea(a))try{return eval("("+a+")")}catch(b){}throw Error("Invalid JSON string: "+a);},y=function(a){return(new fa(void 0)).o(a)},fa=function(a){this.a=a};
fa.prototype.o=function(a){var b=[];z(this,a,b);return b.join("")};
var z=function(a,b,c){if(null==b)c.push("null");else{if("object"==typeof b){if("array"==aa(b)){var d=b;b=d.length;c.push("[");for(var f="",l=0;l<b;l++)c.push(f),f=d[l],z(a,a.a?a.a.call(d,String(l),f):f,c),f=",";c.push("]");return}if(b instanceof String||b instanceof Number||b instanceof Boolean)b=b.valueOf();else{c.push("{");l="";for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&(f=b[d],"function"!=typeof f&&(c.push(l),ga(d,c),c.push(":"),z(a,a.a?a.a.call(b,d,f):f,c),l=","));c.push("}");return}}switch(typeof b){case "string":ga(b,
c);break;case "number":c.push(isFinite(b)&&!isNaN(b)?String(b):"null");break;case "boolean":c.push(String(b));break;case "function":c.push("null");break;default:throw Error("Unknown type: "+typeof b);}}},ha={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},ia=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g,ga=function(a,b){b.push('"',a.replace(ia,function(a){var b=ha[a];b||(b="\\u"+(a.charCodeAt(0)|65536).toString(16).substr(1),
ha[a]=b);return b}),'"')};var A;a:{var ja=e.navigator;if(ja){var ka=ja.userAgent;if(ka){A=ka;break a}}A=""};var la=function(){var a=document.body.offsetHeight;this.f=document.body.offsetWidth;this.a=a};var na=function(a,b){var c=ma;Object.prototype.hasOwnProperty.call(c,a)||(c[a]=b(a))};var oa=-1!=A.indexOf("Opera"),B=-1!=A.indexOf("Trident")||-1!=A.indexOf("MSIE"),pa=-1!=A.indexOf("Edge"),C=-1!=A.indexOf("Gecko")&&!(-1!=A.toLowerCase().indexOf("webkit")&&-1==A.indexOf("Edge"))&&!(-1!=A.indexOf("Trident")||-1!=A.indexOf("MSIE"))&&-1==A.indexOf("Edge"),qa=-1!=A.toLowerCase().indexOf("webkit")&&-1==A.indexOf("Edge"),ra=function(){var a=e.document;return a?a.documentMode:void 0},D;
a:{var E="",F=function(){var a=A;if(C)return/rv\:([^\);]+)(\)|;)/.exec(a);if(pa)return/Edge\/([\d\.]+)/.exec(a);if(B)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(qa)return/WebKit\/(\S+)/.exec(a);if(oa)return/(?:Version)[ \/]?(\S+)/.exec(a)}();F&&(E=F?F[1]:"");if(B){var G=ra();if(null!=G&&G>parseFloat(E)){D=String(G);break a}}D=E}
var sa=D,ma={},ta=function(a){na(a,function(){for(var b=0,c=da(String(sa)).split("."),d=da(String(a)).split("."),f=Math.max(c.length,d.length),l=0;0==b&&l<f;l++){var t=c[l]||"",x=d[l]||"";do{t=/(\d*)(\D*)(.*)/.exec(t)||["","","",""];x=/(\d*)(\D*)(.*)/.exec(x)||["","","",""];if(0==t[0].length&&0==x[0].length)break;b=r(0==t[1].length?0:parseInt(t[1],10),0==x[1].length?0:parseInt(x[1],10))||r(0==t[2].length,0==x[2].length)||r(t[2],x[2]);t=t[3];x=x[3]}while(0==b)}return 0<=b})},ua;var va=e.document;
ua=va&&B?ra()||("CSS1Compat"==va.compatMode?parseInt(sa,10):5):void 0;var H;if(!(H=!C&&!B)){var I;if(I=B)I=9<=Number(ua);H=I}H||C&&ta("1.9.1");B&&ta("9");var wa=function(a,b,c,d,f,l){this.f=v(a);this.a=v(b);this.u=c;this.g=v(d);this.j=f;this.m=l},J=function(a){a=w(a);if(!(m(a)&&k(a.windowCoords_t)&&k(a.windowCoords_r)&&k(a.windowCoords_b)&&k(a.windowCoords_l)&&k(a.frameCoords_t)&&k(a.frameCoords_r)&&k(a.frameCoords_b)&&k(a.frameCoords_l)&&g(a.styleZIndex)&&k(a.allowedExpansion_t)&&k(a.allowedExpansion_r)&&k(a.allowedExpansion_b)&&k(a.allowedExpansion_l)&&k(a.xInView)&&0<=a.xInView&&1>=a.xInView&&k(a.yInView)&&0<=a.yInView&&1>=a.yInView))throw Error("Cannot parse JSON geometry");
return new wa(new u(a.windowCoords_t,a.windowCoords_r,a.windowCoords_b,a.windowCoords_l),new u(a.frameCoords_t,a.frameCoords_r,a.frameCoords_b,a.frameCoords_l),a.styleZIndex,new u(a.allowedExpansion_t,a.allowedExpansion_r,a.allowedExpansion_b,a.allowedExpansion_l),a.xInView,a.yInView)};
wa.prototype.o=function(){return y({windowCoords_t:this.f.j,windowCoords_r:this.f.g,windowCoords_b:this.f.a,windowCoords_l:this.f.f,frameCoords_t:this.a.j,frameCoords_r:this.a.g,frameCoords_b:this.a.a,frameCoords_l:this.a.f,styleZIndex:this.u,allowedExpansion_t:this.g.j,allowedExpansion_r:this.g.g,allowedExpansion_b:this.g.a,allowedExpansion_l:this.g.f,xInView:this.j,yInView:this.m})};var K=!1,L=function(a){if(a=a.match(/[\d]+/g))a.length=3};
(function(){if(navigator.plugins&&navigator.plugins.length){var a=navigator.plugins["Shockwave Flash"];if(a&&(K=!0,a.description)){L(a.description);return}if(navigator.plugins["Shockwave Flash 2.0"]){K=!0;return}}if(navigator.mimeTypes&&navigator.mimeTypes.length&&(a=navigator.mimeTypes["application/x-shockwave-flash"],K=!(!a||!a.enabledPlugin))){L(a.enabledPlugin.description);return}try{var b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");K=!0;L(b.GetVariable("$version"));return}catch(c){}try{b=
new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");K=!0;return}catch(c){}try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash"),K=!0,L(b.GetVariable("$version"))}catch(c){}})();var xa=function(a){this.a=a};xa.prototype.o=function(){return y(this.a)};var ya=function(a,b,c,d){this.a=a;this.f=b;this.g=c;this.j=d};ya.prototype.o=function(){return y({expandByOverlay:this.a,expandByPush:this.f,readCookie:this.g,writeCookie:this.j})};var za=function(a,b,c,d,f,l,t){this.u=a;this.a=b;this.f=c;this.m=d;this.g=f;this.A=l;this.j=t};za.prototype.o=function(){var a={uid:this.u,hostPeerName:this.a,initialGeometry:this.f.o(),permissions:this.m.o(),metadata:this.g.o(),reportCreativeGeometry:this.A,isDifferentSourceWindow:this.j};return y(a)};var Aa=/^([^;]+);(?:e:([\d,]*);)?(\d+);([\s\S]*)$/;var Ba=function(){this.A=this.A;this.F=this.F};Ba.prototype.A=!1;var Ca=function(a,b){var c=window;c.addEventListener?c.addEventListener(a,b,!1):c.attachEvent&&c.attachEvent("on"+a,b)};var M=function(a,b,c,d,f){Ba.call(this);this.m=a;this.status=1;this.g=b;this.u=c;this.H=d;this.D=!!f;this.j=Math.random();this.a={};this.f=null;this.C=n(this.G,this)};q(M,Ba);M.prototype.G=function(a){if(a.origin===this.u&&(this.D||a.source==this.g)){var b=null;try{b=w(a.data)}catch(c){}if(m(b)&&(a=b.i,b.c===this.m&&a!=this.j&&(2!==this.status&&(this.status=2,Da(this),this.f&&(this.f(),this.f=null)),a=b.s,b=b.p,g(a)&&(g(b)||m(b))&&this.a.hasOwnProperty(a))))this.a[a](b)}};
var Da=function(a){var b={};b.c=a.m;b.i=a.j;a.g.postMessage(y(b),a.u)};M.prototype.B=function(){if(1===this.status){try{this.g.postMessage&&Da(this)}catch(a){}window.setTimeout(n(this.B,this),50)}};M.prototype.connect=function(a){a&&(this.f=a);Ca("message",this.C);this.H&&this.B()};var Ea=function(a,b,c){var d={};d.c=a.m;d.i=a.j;d.s=b;d.p=c;a.g.postMessage(y(d),a.u)};var Fa=function(a){this.f=a;this.j=null;this.a=this.status=0;this.g=null;this.J="sfchannel"+a},N=function(a){return 1==a.status||2==a.status};var O=function(a){this.a=a};O.prototype.o=function(){throw Error("unimplemented abstract method");};var Ga=function(a,b){this.a=a;this.version=b};q(Ga,O);Ga.prototype.o=function(){return y({uid:this.a,version:this.version})};var Ha=function(a,b,c){this.a=a;this.g=b;this.f=c};q(Ha,O);Ha.prototype.o=function(){return y({uid:this.a,initialWidth:this.g,initialHeight:this.f})};var Ia=function(a,b){this.a=a;this.f=b};q(Ia,O);Ia.prototype.o=function(){return y({uid:this.a,description:this.f})};
var Ja=function(a,b,c){this.a=a;this.f=b;this.g=c};q(Ja,O);Ja.prototype.o=function(){return y({uid:this.a,expand_t:this.f.j,expand_r:this.f.g,expand_b:this.f.a,expand_l:this.f.f,push:this.g})};var Ka=function(a){this.a=a};q(Ka,O);Ka.prototype.o=function(){return y({uid:this.a})};var P=function(a,b){this.a=a;this.g=b};q(P,O);var La=function(a){a=w(a);if(!(m(a)&&k(a.uid)&&g(a.newGeometry)))throw Error("Cannot parse JSON message");var b=J(a.newGeometry);return new P(a.uid,b)};
P.prototype.o=function(){var a={uid:this.a,newGeometry:this.g.o()};return y(a)};var Ma=function(a,b,c,d,f){P.call(this,a,c);this.m=b;this.f=d;this.j=f};q(Ma,P);Ma.prototype.o=function(){var a={uid:this.a,success:this.m,newGeometry:this.g.o(),expand_t:this.f.j,expand_r:this.f.g,expand_b:this.f.a,expand_l:this.f.f,push:this.j};return y(a)};var Na=function(a,b,c){this.a=a;this.g=b;this.f=c};q(Na,O);Na.prototype.o=function(){return y({uid:this.a,width:this.g,height:this.f})};var R=function(a){Fa.call(this,a.u);this.A=a.m;this.I=a.g;this.B=null;this.u=[];this.m=0;this.j=a.f;this.g=new M(this.J,window.parent,a.a,!0,a.j);var b=n(this.G,this);this.g.a.expand_response=b;b=n(this.C,this);this.g.a.collapse_response=b;b=n(this.H,this);this.g.a.geometry_update=b;this.g.connect(n(this.K,this));this.status=1;Q(this,"init_done",new Ga(this.f,"1-0-5"));a.A&&(a=n(R.prototype.F,this),Ca("load",a),Ca("resize",a))};q(R,Fa);var S=function(a,b){Q(a,"report_error",new Ia(a.f,b))};
R.prototype.K=function(){for(var a=0;a<this.u.length;a++)Ea(this.g,this.u[a].type,this.u[a].message.o())};
R.prototype.G=function(a){try{if(2!=this.status)throw Error("Container is not registered");if(3!=this.a)throw Error("Container is not expanding");if(!g(a))throw Error("Could not parse serialized message");var b,c=w(a);if(!(m(c)&&k(c.uid)&&h(c.success)&&g(c.newGeometry)&&k(c.expand_t)&&k(c.expand_r)&&k(c.expand_b)&&k(c.expand_l)&&h(c.push)))throw Error("Cannot parse JSON message");var d=J(c.newGeometry);b=new Ma(c.uid,c.success,d,new u(c.expand_t,c.expand_r,c.expand_b,c.expand_l),c.push);if(this.f!=
b.a)throw Error("Wrong source container");this.a=b.m?2:0;this.j=b.g;T(this,b.m?"expanded":"failed",b.j?"exp-push":"exp-ovr","",{t:b.f.j,r:b.f.g,b:b.f.a,l:b.f.f,push:b.j})}catch(f){}};
R.prototype.C=function(a){try{if(2!=this.status)throw Error("Container is not registered");if(1!=this.a)throw Error("Container is not collapsing");if(!g(a))throw Error("Could not parse serialized message");var b=La(a);if(this.f!=b.a)throw Error("Wrong source container");this.a=0;this.j=b.g;T(this,"collapsed","collapse","",void 0)}catch(c){}};
R.prototype.H=function(a){try{if(!N(this))throw Error("Container is not initialized or registered");if(!g(a))throw Error("Could not parse serialized message");var b=La(a);if(this.f!=b.a)throw Error("Wrong source container");this.j=b.g;T(this,"geom-update","","",void 0)}catch(c){}};
var T=function(a,b,c,d,f){if(null!==a.B)try{a.B(b,{cmd:c,reason:d,info:f})}catch(l){S(a,"Could not manage to call user-supplied callback")}},Oa=function(a,b,c){setTimeout(n(function(){T(this,"failed",a,b,c)},U),0)},Q=function(a,b,c){2===a.g.status?Ea(a.g,b,c.o()):a.u.push({type:b,message:c})},Pa=function(a){var b=new la;Q(a,"creative_geometry_update",new Na(a.f,b.f,b.a))};R.prototype.D=function(){2==this.m&&Pa(this);this.m=0};
R.prototype.F=function(){switch(this.m){case 0:Pa(this);setTimeout(n(this.D,this),200);this.m=1;break;case 1:this.m=2}};var Qa=function(a,b,c){if(2==U.status)S(U,"Called register multiple times");else if(!k(a)||0>=a)S(U,"Invalid initial width");else if(!k(b)||0>=b)S(U,"Invalid initial height");else{var d=null;if(null!=c){if("function"!=aa(c)){S(U,"Invalid callback function");return}d=c}c=U;c.status=2;c.B=d;Q(c,"register_done",new Ha(c.f,a,b))}},Ra=function(){return N(U)?{"exp-ovr":U.A.a,"exp-push":U.A.f,"read-cookie":U.A.g,"write-cookie":U.A.j}:(S(U,"Called supports on bad container"),null)},Sa=function(){if(!N(U))return S(U,
"Called geom on bad container"),null;var a=U.j;return{win:{t:a.f.j,r:a.f.g,b:a.f.a,l:a.f.f,w:a.f.g-a.f.f,h:a.f.a-a.f.j},self:{t:a.a.j,r:a.a.g,b:a.a.a,l:a.a.f,w:a.a.g-a.a.f,h:a.a.a-a.a.j,z:parseInt(a.u,10),xiv:a.j,yiv:a.m,iv:a.j*a.m},exp:{t:a.g.j,r:a.g.g,b:a.g.a,l:a.g.f,xs:!1,yx:!1}}},Ta=function(){if(!N(U))return S(U,"Called inViewPercentage on bad container"),null;var a=U.j;return a.j*a.m*100},Ua=function(){if(!N(U))return S(U,"Called status on bad container"),null;switch(U.a){case 0:return"collapsed";
case 1:return"collapsing";case 2:return"expanded";case 3:return"expanding";default:return null}},Va=function(a,b){if(!N(U))return S(U,"Called meta on bad container"),null;if(!g(a)||/^[\s\xa0]*$/.test(null==a?"":String(a)))return S(U,"Invalid property name"),null;var c="shared";if(null!=b){if(!g(b)||/^[\s\xa0]*$/.test(null==b?"":String(b)))return S(U,"Invalid owner key"),null;c=b}var d=U.I;return null!=d.a[c]&&null!=d.a[c][a]?d.a[c][a]:null},Wa=function(a,b){if(2==U.status)if(!g(a)||/^[\s\xa0]*$/.test(a))S(U,
"Invalid cookie name");else{if(null!=b){var c;!(c=!m(b)||!g(b.info))&&(c=null!=b.expires)&&(c=b.expires,c=!(m(c)&&"function"==typeof c.getFullYear));if(c){Oa("write-cookie","Invalid $sf.ext.cookie arguments",b);S(U,"Invalid cookie data");return}}Oa(null!=b?"write-cookie":"read-cookie","$sf.ext.cookie is not supported",b);S(U,"Used unsupported cookie operations")}else S(U,"Called cookie on unregistered container")},Xa=function(a){if(2==U.status)if(0==U.a)if(m(a)&&(null!=a.t||null!=a.r||null!=a.b||
null!=a.l)&&(null==a.t||k(a.t)&&0<=a.t)&&(null==a.r||k(a.r)&&0<=a.r)&&(null==a.b||k(a.b)&&0<=a.b)&&(null==a.l||k(a.l)&&0<=a.l)&&(null==a.push||h(a.push))){var b=new u(a.t||0,a.r||0,a.b||0,a.l||0);a=a.push||!1;var c=U;c.a=3;Q(c,"expand_request",new Ja(c.f,b,a))}else Oa(m(a)&&h(a.push)&&1==a.push?"exp-push":"exp-ovr","Invalid $sf.ext.expand arguments",a),S(U,"Invalid expand data");else S(U,"Called expand on uncollapsed container");else S(U,"Called expand on unregistered container")},Ya=function(){if(2==
U.status)if(2==U.a){var a=U;a.a=1;Q(a,"collapse_request",new Ka(a.f))}else S(U,"Called collapse on unexpanded container");else S(U,"Called collapse on unregistered container")},Za;var $a=null,V=window;
if(V!=V.parent&&V.parent==V.top){try{var ab,bb;if(e.sf_)ab=e.sf_.cfg,bb=e.sf_.v;else{var cb,W=Aa.exec(window.name);if(null===W)throw Error("Cannot parse serialized data");for(var db={},eb=W[2]?W[2].split(","):[],fb=0;fb<eb.length;fb++)db[eb[fb]]=!0;var gb=+W[3],hb=W[4];if(gb>hb.length)throw Error("Cannot parse serialized data");cb={M:W[1],N:db,content:hb.substr(0,gb),L:hb.substr(gb)};ab=cb.L;bb=cb.M}var ib=ab;if("1-0-5"!=bb)throw Error("Host has different version from ext container");var X=w(ib);
if(!(m(X)&&k(X.uid)&&g(X.hostPeerName)&&g(X.initialGeometry)&&g(X.permissions)&&g(X.metadata)&&h(X.reportCreativeGeometry)&&h(X.isDifferentSourceWindow)))throw Error("Cannot parse JSON config");var jb=J(X.initialGeometry),kb,Y=w(X.permissions);if(!(m(Y)&&h(Y.expandByOverlay)&&h(Y.expandByPush)&&h(Y.readCookie)&&h(Y.writeCookie)))throw Error("Cannot parse JSON permissions");kb=new ya(Y.expandByOverlay,Y.expandByPush,Y.readCookie,Y.writeCookie);var Z=w(X.metadata);if(!(m(Z)&&m(Z.shared)&&g(Z.shared.sf_ver)&&
k(Z.shared.ck_on)&&g(Z.shared.flash_ver)))throw Error("Cannot parse JSON metadata");$a=new R(new za(X.uid,X.hostPeerName,jb,kb,new xa({shared:{sf_ver:Z.shared.sf_ver,ck_on:Z.shared.ck_on,flash_ver:Z.shared.flash_ver}}),X.reportCreativeGeometry,X.isDifferentSourceWindow));p("$sf.ext.register",Qa);p("$sf.ext.supports",Ra);p("$sf.ext.geom",Sa);p("$sf.ext.inViewPercentage",Ta);p("$sf.ext.status",Ua);p("$sf.ext.meta",Va);p("$sf.ext.cookie",Wa);p("$sf.ext.expand",Xa);p("$sf.ext.collapse",Ya)}catch(a){}e.sf_=
void 0;window.name="";Za=$a}else Za=null;var U=Za;})();
