/*1305016210,169776319*/

if (window.CavalryLogger) { CavalryLogger.start_js(["JYXUq"]); }

!function(){function a(b){return function(){if(this===window)throw new TypeError();return b.apply(this,arguments);};}copy_properties(Array.prototype,{map:function(c,b){if(this===window||typeof c!='function')throw new TypeError();var d;var e=this.length;var f=new Array(e);for(d=0;d<e;++d)if(d in this)f[d]=c.call(b,this[d],d,this);return f;},forEach:function(c,b){this.map(c,b);return this;},filter:function(c,b){c=c||function(h){return h;};if(this===window||typeof c!='function')throw new TypeError();var d,g,e=this.length,f=[];for(d=0;d<e;++d)if(d in this){g=this[d];if(c.call(b,g,d,this))f.push(g);}return f;},every:function(d,c){var b=this.filter(function(){return 1;});return (this.filter(d,c).length==b.length);},some:function(c,b){return (this.filter(c,b).length>0);},reduce:null,reduceRight:null,sort:a(Array.prototype.sort),reverse:a(Array.prototype.reverse),concat:a(Array.prototype.concat),slice:a(Array.prototype.slice),indexOf:a(Array.prototype.indexOf||function(d,b){var c=this.length;b|=0;if(b<0)b+=c;for(;b<c;b++)if(b in this&&this[b]===d)return b;return -1;}),contains:function(b){return this.indexOf(b)!=-1;},remove:function(c){var b=this.indexOf(c);if(b!=-1)this.splice(b,1);}});Array.prototype.each=Array.prototype.forEach;Array.prototype.clone=Array.prototype.slice;}();
window.onloadRegister=function(a){window.loaded?_runHook(a):_addHook('onloadhooks',a);};function onafterloadRegister(a){window.afterloaded?setTimeout(function(){_runHook(a);},0):_addHook('onafterloadhooks',a);}function _onloadHook(){!window.loaded&&window.CavalryLogger&&CavalryLogger.getInstance().setTimeStamp('t_prehooks');_runHooks('onloadhooks');!window.loaded&&window.CavalryLogger&&CavalryLogger.getInstance().setTimeStamp('t_hooks');window.loaded=true;Arbiter.inform('uipage_onload',true,Arbiter.BEHAVIOR_STATE);}function _onafterloadHook(){_runHooks('onafterloadhooks');window.afterloaded=true;}function _runHook(b){try{return b();}catch(a){}}function _runHooks(b){var d=b=='onbeforeleavehooks'||b=='onbeforeunloadhooks';var e=null;do{var a=window[b];if(!d)window[b]=null;if(!a)break;for(var c=0;c<a.length;c++)if(d){e=e||_runHook(a[c]);}else _runHook(a[c]);if(d)break;}while(window[b]);if(d&&e)return e;}function keep_window_set_as_loaded(){if(window.loaded==false){window.loaded=true;_runHooks('onloadhooks');}if(window.afterloaded==false){window.afterloaded=true;_runHooks('onafterloadhooks');}}Arbiter.registerCallback(_onloadHook,[OnloadEvent.ONLOAD_DOMCONTENT_CALLBACK,InitialJSLoader.INITIAL_JS_READY]);Arbiter.registerCallback(_onafterloadHook,[OnloadEvent.ONLOAD_DOMCONTENT_CALLBACK,OnloadEvent.ONLOAD_CALLBACK,InitialJSLoader.INITIAL_JS_READY]);Arbiter.subscribe(OnloadEvent.ONBEFOREUNLOAD,function(b,a){a.warn=_runHooks('onbeforeleavehooks')||_runHooks('onbeforeunloadhooks');if(!a.warn){window.loaded=false;window.afterloaded=false;}},Arbiter.SUBSCRIBE_NEW);Arbiter.subscribe(OnloadEvent.ONUNLOAD,function(b,a){_runHooks('onunloadhooks');},Arbiter.SUBSCRIBE_NEW);
function chain(d,e){var b,a=[];for(var c=0;c<arguments.length;c++)a.push(arguments[c]);b=function(event){event=event||window.event;for(var f=0;f<a.length;f++)if(a[f]&&a[f].apply(this,arguments)===false){return false;}else if(event&&event.cancelBubble)return true;return true;};b.toString=function(){return chain._toString(a);};return b;}if(!chain._toString)chain._toString=function(b){var d='chained fns',a=b.filter();for(var c=0;c<b.length;c++)d+='\n'+b[c].toString();return d;};
void(0);
String.prototype.trim=function(){if(this==window)return null;return this.replace(/^\s*|\s*$/g,'');};function trim(b){try{return String(b.toString()).trim();}catch(a){return '';}}String.prototype.startsWith=function(a){if(this==window)return null;return this.substring(0,a.length)==a;};String.prototype.endsWith=function(a){if(this==window)return null;return this.length>=a.length&&this.substring(this.length-a.length)==a;};String.prototype.hash32=function(){var a=2166136261;for(var b=0,c=this.length;b<c;++b)a=(a^this.charCodeAt(b))*16777619;a+=a<<13;a^=a>>7;a+=a<<3;a^=a>>17;a+=a<<5;return (a|0)+2147483648;};String.prototype.split=(function(a){return function(h,e){var b="";if(h===null||e===null){return [];}else if(typeof h=='string'){return a.call(this,h,e);}else if(h===undefined){return [this.toString()];}else if(h instanceof RegExp){if(!h._2||!h._1){b=h.toString().replace(/^[\S\s]+\//,"");if(!h._1)if(!h.global){h._1=new RegExp(h.source,"g"+b);}else h._1=1;}separator1=h._1===1?h:h._1;var i=(h._2?h._2:h._2=new RegExp("^"+separator1.source+"$",b));if(e===undefined||e<0){e=false;}else{e=Math.floor(e);if(!e)return [];}var f,g=[],d=0,c=0;while((e?c++<=e:true)&&(f=separator1.exec(this))){if((f[0].length===0)&&(separator1.lastIndex>f.index))separator1.lastIndex--;if(separator1.lastIndex>d){if(f.length>1)f[0].replace(i,function(){for(var j=1;j<arguments.length-2;j++)if(arguments[j]===undefined)f[j]=undefined;});g=g.concat(this.substring(d,f.index),(f.index===this.length?[]:f.slice(1)));d=separator1.lastIndex;}if(f[0].length===0)separator1.lastIndex++;}return (d===this.length)?(separator1.test("")?g:g.concat("")):(e?g:g.concat(this.substring(d)));}else return a.call(this,h,e);};})(String.prototype.split);
add_properties('CSS',{shown:function(a){return !CSS.hasClass(a,'hidden_elem');},toggle:function(a){CSS.conditionShow(a,!CSS.shown(a));},setClass:function(b,a){$(b).className=a||'';return b;},setStyle:function(a,b,d){switch(b){case 'opacity':var c=(d==1);a.style.opacity=c?'':''+d;a.style.filter=c?'':'alpha(opacity='+d*100+')';break;case 'float':a.style.cssFloat=a.style.styleFloat=d;break;default:b=b.replace(/-(.)/g,function(e,f){return f.toUpperCase();});a.style[b]=d;}return a;},getStyle:function(b,d){b=$(b);function c(e){return e.replace(/([A-Z])/g,'-$1').toLowerCase();}if(window.getComputedStyle){var a=window.getComputedStyle(b,null);if(a)return a.getPropertyValue(c(d));}if(document.defaultView&&document.defaultView.getComputedStyle){var a=document.defaultView.getComputedStyle(b,null);if(a)return a.getPropertyValue(c(d));if(d=="display")return "none";}if(b.currentStyle)return b.currentStyle[d];return b.style[d];},getOpacity:function(a){a=$(a);var b=CSS.getStyle(a,'filter');var c=null;if(b&&(c=/(\d+(?:\.\d+)?)/.exec(b))){return parseFloat(c.pop())/100;}else if(b=CSS.getStyle(a,'opacity')){return parseFloat(b);}else return 1;}});
function animation(a){if(a==undefined)return;if(this==window){return new animation(a);}else{this.obj=a;this._reset_state();this.queue=[];this.last_attr=null;}}animation.resolution=20;animation.offset=0;animation.prototype._reset_state=function(){this.state={attrs:{},duration:500};};animation.prototype.stop=function(){this._reset_state();this.queue=[];return this;};animation.prototype._build_container=function(){if(this.container_div){this._refresh_container();return;}if(this.obj.firstChild&&this.obj.firstChild.__animation_refs){this.container_div=this.obj.firstChild;this.container_div.__animation_refs++;this._refresh_container();return;}var b=document.createElement('div');b.style.padding='0px';b.style.margin='0px';b.style.border='0px';b.__animation_refs=1;var a=this.obj.childNodes;while(a.length)b.appendChild(a[0]);this.obj.appendChild(b);this._orig_overflow=this.obj.style.overflow;this.obj.style.overflow='hidden';this.container_div=b;this._refresh_container();};animation.prototype._refresh_container=function(){this.container_div.style.height='auto';this.container_div.style.width='auto';this.container_div.style.height=this.container_div.offsetHeight+'px';this.container_div.style.width=this.container_div.offsetWidth+'px';};animation.prototype._destroy_container=function(){if(!this.container_div)return;if(!--this.container_div.__animation_refs){var a=this.container_div.childNodes;while(a.length)this.obj.appendChild(a[0]);this.obj.removeChild(this.container_div);}this.container_div=null;this.obj.style.overflow=this._orig_overflow;};animation.ATTR_TO=1;animation.ATTR_BY=2;animation.ATTR_FROM=3;animation.prototype._attr=function(a,d,c){a=a.replace(/-[a-z]/gi,function(e){return e.substring(1).toUpperCase();});var b=false;switch(a){case 'background':this._attr('backgroundColor',d,c);return this;case 'margin':d=animation.parse_group(d);this._attr('marginBottom',d[0],c);this._attr('marginLeft',d[1],c);this._attr('marginRight',d[2],c);this._attr('marginTop',d[3],c);return this;case 'padding':d=animation.parse_group(d);this._attr('paddingBottom',d[0],c);this._attr('paddingLeft',d[1],c);this._attr('paddingRight',d[2],c);this._attr('paddingTop',d[3],c);return this;case 'backgroundColor':case 'borderColor':case 'color':d=animation.parse_color(d);break;case 'opacity':d=parseFloat(d,10);break;case 'height':case 'width':if(d=='auto'){b=true;}else d=parseInt(d,10);break;case 'borderWidth':case 'lineHeight':case 'fontSize':case 'marginBottom':case 'marginLeft':case 'marginRight':case 'marginTop':case 'paddingBottom':case 'paddingLeft':case 'paddingRight':case 'paddingTop':case 'bottom':case 'left':case 'right':case 'top':case 'scrollTop':case 'scrollLeft':d=parseInt(d,10);break;default:throw new Error(a+' is not a supported attribute!');}if(this.state.attrs[a]===undefined)this.state.attrs[a]={};if(b)this.state.attrs[a].auto=true;switch(c){case animation.ATTR_FROM:this.state.attrs[a].start=d;break;case animation.ATTR_BY:this.state.attrs[a].by=true;case animation.ATTR_TO:this.state.attrs[a].value=d;break;}};animation._get_box_width=function(c){var d=parseInt(CSS.getStyle(c,'paddingLeft'),10),e=parseInt(CSS.getStyle(c,'paddingRight'),10),a=parseInt(CSS.getStyle(c,'borderLeftWidth'),10),b=parseInt(CSS.getStyle(c,'borderRightWidth'),10);return c.offsetWidth-(d?d:0)-(e?e:0)-(a?a:0)-(b?b:0);};animation._get_box_height=function(c){var e=parseInt(CSS.getStyle(c,'paddingTop'),10),d=parseInt(CSS.getStyle(c,'paddingBottom'),10),a=parseInt(CSS.getStyle(c,'borderTopWidth'),10),b=parseInt(CSS.getStyle(c,'borderBottomWidth'),10);return c.offsetHeight-(e?e:0)-(d?d:0)-(a?a:0)-(b?b:0);};animation.prototype.to=function(a,b){if(b===undefined){this._attr(this.last_attr,a,animation.ATTR_TO);}else{this._attr(a,b,animation.ATTR_TO);this.last_attr=a;}return this;};animation.prototype.by=function(a,b){if(b===undefined){this._attr(this.last_attr,a,animation.ATTR_BY);}else{this._attr(a,b,animation.ATTR_BY);this.last_attr=a;}return this;};animation.prototype.from=function(a,b){if(b===undefined){this._attr(this.last_attr,a,animation.ATTR_FROM);}else{this._attr(a,b,animation.ATTR_FROM);this.last_attr=a;}return this;};animation.prototype.duration=function(a){this.state.duration=a?a:0;return this;};animation.prototype.checkpoint=function(b,a){if(b===undefined)b=1;this.state.checkpoint=b;this.queue.push(this.state);this._reset_state();this.state.checkpointcb=a;return this;};animation.prototype.blind=function(){this.state.blind=true;return this;};animation.prototype.hide=function(){this.state.hide=true;return this;};animation.prototype.show=function(){this.state.show=true;return this;};animation.prototype.ease=function(a){this.state.ease=a;return this;};animation.prototype.go=function(){var b=(new Date()).getTime();this.queue.push(this.state);for(var a=0;a<this.queue.length;a++){this.queue[a].start=b-animation.offset;if(this.queue[a].checkpoint)b+=this.queue[a].checkpoint*this.queue[a].duration;}animation.push(this);return this;};animation.prototype._show=function(){CSS.show(this.obj);};animation.prototype._hide=function(){CSS.hide(this.obj);};animation.prototype._frame=function(l){var d=true;var k=false;var n=false;for(var e=0;e<this.queue.length;e++){var b=this.queue[e];if(b.start>l){d=false;continue;}if(b.checkpointcb){this._callback(b.checkpointcb,l-b.start);b.checkpointcb=null;}if(b.started===undefined){if(b.show)this._show();for(var a in b.attrs){if(b.attrs[a].start!==undefined)continue;switch(a){case 'backgroundColor':case 'borderColor':case 'color':var m=animation.parse_color(CSS.getStyle(this.obj,a=='borderColor'?'borderLeftColor':a));if(b.attrs[a].by){b.attrs[a].value[0]=Math.min(255,Math.max(0,b.attrs[a].value[0]+m[0]));b.attrs[a].value[1]=Math.min(255,Math.max(0,b.attrs[a].value[1]+m[1]));b.attrs[a].value[2]=Math.min(255,Math.max(0,b.attrs[a].value[2]+m[2]));}break;case 'opacity':var m=CSS.getOpacity(this.obj);if(b.attrs[a].by)b.attrs[a].value=Math.min(1,Math.max(0,b.attrs[a].value+m));break;case 'height':var m=animation._get_box_height(this.obj);if(b.attrs[a].by)b.attrs[a].value+=m;break;case 'width':var m=animation._get_box_width(this.obj);if(b.attrs[a].by)b.attrs[a].value+=m;break;case 'scrollLeft':case 'scrollTop':var m=(this.obj==document.body)?(document.documentElement[a]||document.body[a]):this.obj[a];if(b.attrs[a].by)b.attrs[a].value+=m;b['last'+a]=m;break;default:var m=parseInt(CSS.getStyle(this.obj,a),10)||0;if(b.attrs[a].by)b.attrs[a].value+=m;break;}b.attrs[a].start=m;}if((b.attrs.height&&b.attrs.height.auto)||(b.attrs.width&&b.attrs.width.auto)){if(ua.firefox()<3)n=true;this._destroy_container();for(var a in {height:1,width:1,fontSize:1,borderLeftWidth:1,borderRightWidth:1,borderTopWidth:1,borderBottomWidth:1,paddingLeft:1,paddingRight:1,paddingTop:1,paddingBottom:1})if(b.attrs[a])this.obj.style[a]=b.attrs[a].value+(typeof b.attrs[a].value=='number'?'px':'');if(b.attrs.height&&b.attrs.height.auto)b.attrs.height.value=animation._get_box_height(this.obj);if(b.attrs.width&&b.attrs.width.auto)b.attrs.width.value=animation._get_box_width(this.obj);}b.started=true;if(b.blind)this._build_container();}var h=(l-b.start)/b.duration;if(h>=1){h=1;if(b.hide)this._hide();}else d=false;var j=b.ease?b.ease(h):h;if(!k&&h!=1&&b.blind)k=true;if(n&&this.obj.parentNode){var i=this.obj.parentNode;var g=this.obj.nextSibling;i.removeChild(this.obj);}for(var a in b.attrs)switch(a){case 'backgroundColor':case 'borderColor':case 'color':this.obj.style[a]='rgb('+animation.calc_tween(j,b.attrs[a].start[0],b.attrs[a].value[0],true)+','+animation.calc_tween(j,b.attrs[a].start[1],b.attrs[a].value[1],true)+','+animation.calc_tween(j,b.attrs[a].start[2],b.attrs[a].value[2],true)+')';break;case 'opacity':CSS.setStyle(this.obj,'opacity',animation.calc_tween(j,b.attrs[a].start,b.attrs[a].value));break;case 'height':case 'width':this.obj.style[a]=j==1&&b.attrs[a].auto?'auto':animation.calc_tween(j,b.attrs[a].start,b.attrs[a].value,true)+'px';break;case 'scrollLeft':case 'scrollTop':var f=this.obj==document.body;var m=(f)?(document.documentElement[a]||document.body[a]):this.obj[a];if(b['last'+a]!=m){delete b.attrs[a];}else{var c=animation.calc_tween(j,b.attrs[a].start,b.attrs[a].value,true)-m;if(!f){this.obj[a]=c+m;}else if(a=='scrollLeft'){window.scrollBy(c,0);}else window.scrollBy(0,c);b['last'+a]=c+m;}break;default:this.obj.style[a]=animation.calc_tween(j,b.attrs[a].start,b.attrs[a].value,true)+'px';break;}if(h==1){this.queue.splice(e--,1);this._callback(b.ondone,l-b.start-b.duration);}}if(n)i[g?'insertBefore':'appendChild'](this.obj,g);if(!k&&this.container_div)this._destroy_container();return !d;};animation.prototype.ondone=function(a){this.state.ondone=a;return this;};animation.prototype._callback=function(a,b){if(a){animation.offset=b;a.call(this);animation.offset=0;}};animation.calc_tween=function(a,b,c,d){return (d?parseInt:parseFloat)((c-b)*a+b,10);};animation.parse_color=function(a){var b=/^#([a-f0-9]{1,2})([a-f0-9]{1,2})([a-f0-9]{1,2})$/i.exec(a);if(b){return [parseInt(b[1].length==1?b[1]+b[1]:b[1],16),parseInt(b[2].length==1?b[2]+b[2]:b[2],16),parseInt(b[3].length==1?b[3]+b[3]:b[3],16)];}else{var c=/^rgba? *\(([0-9]+), *([0-9]+), *([0-9]+)(?:, *([0-9]+))?\)$/.exec(a);if(c){if(c[4]==='0'){return [255,255,255];}else return [parseInt(c[1],10),parseInt(c[2],10),parseInt(c[3],10)];}else if(a=='transparent'){return [255,255,255];}else throw 'Named color attributes are not supported.';}};animation.parse_group=function(a){var a=trim(a).split(/ +/);if(a.length==4){return a;}else if(a.length==3){return [a[0],a[1],a[2],a[1]];}else if(a.length==2){return [a[0],a[1],a[0],a[1]];}else return [a[0],a[0],a[0],a[0]];};animation.push=function(a){if(!animation.active)animation.active=[];animation.active.push(a);if(!animation.timeout)animation.timeout=setInterval(animation.animate.bind(animation),animation.resolution,false);animation.animate(true);};animation.animate=function(c){var d=(new Date()).getTime();for(var b=c===true?animation.active.length-1:0;b<animation.active.length;b++)try{if(!animation.active[b]._frame(d))animation.active.splice(b--,1);}catch(a){animation.active.splice(b--,1);}if(animation.active.length==0){clearInterval(animation.timeout);animation.timeout=null;}};animation.ease={};animation.ease.begin=function(a){return Math.sin(Math.PI/2*(a-1))+1;};animation.ease.end=function(a){return Math.sin(.5*Math.PI*a);};animation.ease.both=function(a){return .5*Math.sin(Math.PI*(a-.5))+.5;};animation.prependInsert=function(b,a){animation.insert(b,a,DOM.prependContent);};animation.appendInsert=function(b,a){animation.insert(b,a,DOM.appendContent);};animation.insert=function(c,a,b){CSS.setStyle(a,'opacity',0);b(c,a);animation(a).from('opacity',0).to('opacity',1).duration(400).go();};
var XD={_callbacks:[],_opts:{autoResize:false,allowShrink:true,channelUrl:null,hideOverflow:false,newResizeMethod:false,resizeTimeout:100,resizeWidth:false,expectResizeAck:false,resizeAckTimeout:6000},_lastResizeAckId:0,_resizeCount:0,_resizeTimestamp:0,init:function(a){this._opts=copy_properties(copy_properties({},this._opts),a);if(this._opts.autoResize)this._startResizeMonitor();Arbiter.subscribe('Connect.Unsafe.resize.ack',function(c,b){if(!b.id)b.id=this._resizeCount;if(b.id>this._lastResizeAckId)this._lastResizeAckId=b.id;}.bind(this),Arbiter.BEHAVIOUR_PERSISTANT);},send:function(b,a){a=a||this._opts.channelUrl;if(!a)return;if(a.substr(0,4)!='http')return;var h=a+'&'+URI.implodeQuery(b),d='f'+(Math.random()*(1<<30)).toString(16).replace('.',''),c=document.body.appendChild(document.createElement('div')),g=false;c.style.position='absolute';c.style.top='-10000px';c.style.width='1px';c.style.height='1px';XD._callbacks[d]=function(){if(g){(function(){c.parentNode.removeChild(c);}).defer(3000);delete XD._callbacks[d];}};if(ua.ie()){var e=('<iframe '+' src="'+h+'"'+' onload="XD._callbacks.'+d+'()"'+'></iframe>');c.innerHTML='<iframe src="javascript:false"></iframe>';g=true;(function(){c.innerHTML=e;}).defer();}else{var f=document.createElement('iframe');f.onload=XD._callbacks[d];c.appendChild(f);g=true;f.src=h;}},_computeSize:function(){var a=document.body,e=document.documentElement,h=0,f;if(this._opts.newResizeMethod){f=Math.max(Math.max(a.offsetHeight,a.scrollHeight)+a.offsetTop,Math.max(e.offsetHeight,e.scrollHeight)+e.offsetTop);}else{if(ua.ie()){f=Math.max(a.offsetHeight,a.scrollHeight)+a.offsetTop;}else f=e.offsetHeight+e.offsetTop;if(window.Dialog)f=Math.max(f,Dialog.max_bottom);}if(this._opts.resizeWidth){if(a.offsetWidth<a.scrollWidth){h=a.scrollWidth+a.offsetLeft;}else{var d=a.childNodes;for(var g=0;g<d.length;g++){var b=d[g];var c=b.offsetWidth+b.offsetLeft;if(c>h)h=c;}}if(XD.forced_min_width)h=Math.max(h,XD.forced_min_width);if(e.clientLeft>0)h+=(e.clientLeft*2);if(e.clientTop>0)f+=(e.clientTop*2);}return {width:h,height:f};},_startResizeMonitor:function(){var b,a=document.documentElement;if(this._opts.hideOverflow){a.style.overflow='hidden';document.body.style.overflow='hidden';}(function(){var f=this._computeSize();var g=new Date().getTime();var c=this._lastResizeAckId<this._resizeCount&&(g-this._resizeTimestamp)>this._opts.resizeAckTimeout;if(!b||(this._opts.expectResizeAck&&c)||(this._opts.allowShrink&&b.width!=f.width)||(!this._opts.allowShrink&&b.width<f.width)||(this._opts.allowShrink&&b.height!=f.height)||(!this._opts.allowShrink&&b.height<f.height)){b=f;this._resizeCount++;this._resizeTimestamp=g;var e={type:'resize',height:f.height,ackData:{id:this._resizeCount}};if(f.width&&f.width!=0)e.width=f.width;try{if(URI(document.referrer).isFacebookURI()&&window.parent!=window&&window.name&&window.parent.location&&URI(window.parent.location).isFacebookURI()){var iframes=window.parent.document.getElementsByTagName('iframe');for(var i=0;i<iframes.length;i=i+1)if(iframes[i].name==window.name){if(this._opts.resizeWidth)iframes[i].style.width=e.width+'px';iframes[i].style.height=e.height+'px';}}this.send(e);}catch(d){this.send(e);}}}).bind(this).recur(this._opts.resizeTimeout);}};var UnverifiedXD=copy_properties({},XD);
WidgetArbiter={_findSiblings:function(){if(WidgetArbiter._siblings)return;WidgetArbiter._siblings=[];for(var b=parent.frames.length-1;b>=0;b--)try{if(parent.frames[b]&&parent.frames[b].Arbiter&&parent.frames[b].Arbiter.inform)WidgetArbiter._siblings.push(parent.frames[b].Arbiter);}catch(a){}},inform:function(){WidgetArbiter._findSiblings();var a=$A(arguments);WidgetArbiter._siblings.each(function(b){b.inform.apply(b,a);});}};
function intl_locale_is_rtl(){return ('rtl'==CSS.getStyle(document.body,'direction'));}
var Button=(function(){var a='uiButtonDisabled';var c='button:blocker';var b='href';function d(i,h){var g=DataStore.get(i,c);if(h){if(g){g.remove();DataStore.remove(i,c);}}else if(!g)DataStore.set(i,c,Event.listen(i,'click',bagof(false),Event.Priority.URGENT));}function e(g){var h=Parent.byClass(g,'uiButton');if(!h)throw new Error('invalid use case');return h;}function f(g){return DOM.isNode(g,'a');}return {getInputElement:function(g){g=e(g);if(f(g))throw new Error('invalid use case');return DOM.find(g,'input');},isEnabled:function(g){return !CSS.hasClass(e(g),a);},setEnabled:function(j,g){j=e(j);CSS.conditionClass(j,a,!g);if(f(j)){var h=j.href;var k=DataStore.get(j,b,'#');if(g){if(!h)j.href=k;}else{if(h&&h!==k)DataStore.set(j,b,h);j.removeAttribute('href');}d(j,g);}else{var i=Button.getInputElement(j);i.disabled=!g;d(i,g);}},setLabel:function(h,g){h=e(h);if(f(h)){var i=DOM.find(h,'span.uiButtonText');DOM.setContent(i,g);}else Button.getInputElement(h).value=g;CSS.conditionClass(h,'uiButtonNoText',!g);},setIcon:function(h,g){if(!DOM.isNode(g))return;CSS.addClass(g,'customimg');h=e(h);var i=DOM.scry(h,'.img')[0];if(i){DOM.replace(i,g);}else DOM.prependContent(h,g);}};})();
var PopupResizer={_opts:{allowShrink:true,timeout:100},init:function(a){copy_properties(PopupResizer._opts,a);PopupResizer._resizeCheck.recur(PopupResizer._opts.timeout);},_resizeCheck:function(){var e=Vector2.getViewportDimensions(),a=PopupResizer._getDocumentSize(),c=a.y-e.y,d=a.x-e.x;if(d<0)d=0;if(!PopupResizer._opts.allowShrink&&c<0)c=0;if(c||d)try{window.resizeBy(d,c);if(d)window.moveBy(d/-2,0);}catch(b){}},_getDocumentSize:function(){var a={x:ua.firefox()?document.documentElement.scrollWidth:document.body.scrollWidth,y:document.body.scrollHeight};if(a.x<=0||a.x>document.documentElement.scrollWidth)a.x=document.documentElement.scrollWidth;if(a.y<=0||a.y>document.documentElement.scrollHeight)a.y=document.documentElement.scrollHeight;if(window.Dialog&&Dialog.max_bottom&&Dialog.max_bottom>a.y)a.y=Dialog.max_bottom;return a;},open:function(i,b,j){var f=typeof window.screenX!='undefined'?window.screenX:window.screenLeft,g=typeof window.screenY!='undefined'?window.screenY:window.screenTop,e=typeof window.outerWidth!='undefined'?window.outerWidth:document.body.clientWidth,d=typeof window.outerHeight!='undefined'?window.outerHeight:(document.body.clientHeight-22),c=parseInt(f+((e-j)/2),10),h=parseInt(g+((d-b)/2.5),10),a=('width='+j+',height='+b+',left='+c+',top='+h);return window.open(i,'_blank',a);}};
var PlatformOptInPopup=function(){};copy_properties(PlatformOptInPopup,{DIALOG_URL:'/connect/uiserver.php',DIALOG_WIDTH:420,DIALOG_HEIGHT:450,APP_ID:127760087237610,open:function(d,c,a){if(!d)d='generic';if(!c)c='opt.in';var b=new URI(PlatformOptInPopup.DIALOG_URL);b.addQueryData({social_plugin:d,method:c,display:'popup',secure:URI.getRequestURI().isSecure(),app_id:PlatformOptInPopup.APP_ID});if(a)b.addQueryData(a);return PopupResizer.open(b.toString(),PlatformOptInPopup.DIALOG_WIDTH,PlatformOptInPopup.DIALOG_HEIGHT);}});
var ExternalNodeConnectWidget=function(h){copy_properties(this,{scrapeWasAllowed:h.scrapeWasAllowed,widgetID:h.widgetID,widget:$(h.widgetID),viewerID:h.viewer,nodeType:h.nodeType,viewerIsAdmin:h.viewerIsAdmin&&!h.userOptedOut,adminUrl:h.adminUrl,popupOptInParams:{locale:h.locale},nodeUri:new URI(h.nodeURL),externalUrl:h.externalURL,pageId:h.pageId,layout:h.layout,edgeType:h.edgeType,error:h.error,errorURI:new URI('/home.php'),alreadyConnected:h.alreadyConnected,usingConnectLibrary:!!h.channelURL,commentWidgetMarkup:h.commentWidgetMarkup,commentWidgetOpen:false,commentWidgetVisible:false,userProfile:null,connectStoryFbid:0,isAmbiguousText:h.isAmbiguousText,socialBar:h.socialbar,useDisconnectLink:h.useDisconnectLink,showError:h.showError,showConfirm:h.showConfirm,showFaces:h.showFaces,connectText:h.connectText,ref:h.ref,userOptedOut:h.userOptedOut,usingInlineCommenting:h.usingInlineCommenting,supportCommenting:!!h.channelURL||h.usingInlineCommenting,inlineCommentListenersInitialized:false,forceCommentHooks:h.forceCommentHooks,nux:h.nux,iframeReferer:h.iframeReferer,isBlocked:h.isBlocked,isPersonalized:h.isPersonalized,confirmedConnect:h.confirmedConnect,hasSend:h.send,colorScheme:h.colorScheme,grayOut:h.grayOut});if(this.usingConnectLibrary)UnverifiedXD.init({autoResize:h.autoResize,channelUrl:h.channelURL,resizeWidth:h.autoResize&&h.layout!==ExternalNodeConnectWidget.STANDARD_LAYOUT});this.unwrappedMarkup=[];this.connectButtonSlider=DOM.scry(this.widget,'div.connect_button_slider');this.connectButtonContainer=null;if(this.connectButtonSlider.length){this.connectButtonSlider=this.connectButtonSlider[0];this.connectButtonContainer=DOM.find(this.connectButtonSlider,'div.connect_button_container');}else this.connectButtonSlider=null;this.connectButton=DOM.find(this.widget,'a.connect_widget_like_button');if(this.grayOut)this.tombstoneCross=DOM.find(this.widget,'.tombstone_cross');this.connectedMessage=DOM.scry(this.widget,'span.connect_widget_connected_text');this.connectedMessage=this.connectedMessage.length?this.connectedMessage[0]:null;this.notConnectedMessage=DOM.scry(this.widget,'span.connect_widget_not_connected_text');this.notConnectedMessage=this.notConnectedMessage.length?this.notConnectedMessage[0]:null;this.adminSpans=DOM.scry(this.widget,'span.connect_widget_admin_span');if(this.adminSpans.length>0){this.adminLinks=[];for(var a=0;a<this.adminSpans.length;a++)this.adminLinks[a]=DOM.find(this.adminSpans[a],'a.connect_widget_admin_option');}if(this.layout==ExternalNodeConnectWidget.STANDARD_LAYOUT){this.confirmationCell=DOM.find(this.widget,'div.connect_confirmation_cell');this.userActionTextSpan=DOM.find(this.confirmationCell,'span.connect_widget_user_action');this.summaryTextSpan=DOM.find(this.confirmationCell,'span.connect_widget_summary');this.summaryText=DOM.find(this.confirmationCell,'div.connect_widget_text_summary');var i=DOM.scry(this.widget,'div.connect_widget_sample_connections');this.sampleConnections=i.length>0?i[0]:null;if(h.showFaces&&h.viewer>0)this.loggedInUserPhotoDiv=DOM.find(this.widget,'div.connect_widget_logged_in_user');}if(this.layout===ExternalNodeConnectWidget.SIMPLE_LAYOUT){this.originalButtonWidth=this.computeButtonDimensions().width;this.summaryIncluding=DOM.find(this.widget,'td.connect_widget_simple_including');this.supportCommenting=false;this.usingInlineCommenting=false;}this.setQueryData();if(this.pageId)copy_properties(this.popupOptInParams,{connect_id:this.pageId});this.errorSpans=DOM.scry(this.widget,'span.connect_widget_error_span');if(this.errorSpans.length>0){this.errorLinks=[];for(var b=0;b<this.errorSpans.length;b++)this.errorLinks[b]=DOM.find(this.errorSpans[b],'a.connect_widget_error_text');}this.confirmSpans=DOM.scry(this.widget,'span.connect_widget_confirm_span');if(this.confirmSpans.length>0){this.confirmLinks=[];for(var d=0;d<this.confirmSpans.length;d++)this.confirmLinks[d]=DOM.find(this.confirmSpans[d],'a.connect_widget_confirm_link');}this.unlikeSpans=DOM.scry(this.widget,'span.unlike_span');this.unlikeLinks=[];for(var c=0;c<this.unlikeSpans.length;c++){this.unlikeLinks[c]=DOM.find(this.unlikeSpans[c],'a.connect_widget_unlike_link');Event.listen(this.unlikeLinks[c],'click',this.connectToNodeOnClick.bind(this));}var g=DOM.scry(this.widget,'div.connect_widget_number_cloud');if(g.length==1){this.numberCloud=g[0];this.numberCloudNub=DOM.find(this.widget,'div.connect_widget_number_cloud_nub');this.numberCloudExtension=DOM.find(this.numberCloud,'div.connect_widget_number_cloud_extension');this.sizeNumberCloud();this.numberCloudUnlikeSpan=DOM.find(this.numberCloudExtension,'span.unlike_span');this.numberCloudReminderSpan=DOM.find(this.numberCloudExtension,'span.like_reminder');this.inAnimation=false;this.reminderIsVisible=CSS.hasClass(this.numberCloudUnlikeSpan,'hidden_elem');Event.listen(this.numberCloud,'mouseleave',this.restoreReminderSpan.bind(this));Event.listen(this.numberCloudExtension,'mouseleave',this.restoreReminderSpan.bind(this));Event.listen(this.numberCloudExtension,'mouseenter',this.exposeUnlikeSpan.bind(this));Event.listen(this.numberCloud,'mouseenter',this.exposeUnlikeSpan.bind(this));Event.listen(this.numberCloudExtension,'mouseleave',function(event){this.requiresMouseLeaveEvent=false;}.bind(this));}if(this.usingInlineCommenting&&!this.showFaces){this.shareCommentSpans=DOM.scry(this.widget,'span.connect_widget_share_comment_span');for(var e=0;e<this.shareCommentSpans.length;e++){var j=DOM.find(this.shareCommentSpans[e],'a.connect_widget_share_comment_option');Event.listen(j,'click',function(event){for(var k=0;k<this.shareCommentSpans.length;k++)CSS.addClass(this.shareCommentSpans[k],'hidden_elem');this.presentCommentingOption();}.bind(this));}}if(this.layout===ExternalNodeConnectWidget.BUTTON_COUNT_LAYOUT){XD.forced_min_width=this.getButtonCountWidgetWidth();this.numberExcluding=DOM.find(this.widget,'td.connect_widget_button_count_excluding');this.summaryIncluding=DOM.find(this.widget,'td.connect_widget_button_count_including');this.thumbsUpIcon=DOM.find(this.summaryIncluding,'div.thumbs_up');this.undoRegion=DOM.find(this.summaryIncluding,'div.undo');this.originalButtonWidth=this.computeButtonDimensions().width;Event.listen(this.thumbsUpIcon,'mouseenter',function(event){this.unwrapMarkup('undo-wrap');this.undoButton=DOM.find(this.undoRegion,'label.undo_button input');Event.listen(this.undoButton,'click',this.connectToNodeOnClick.bind(this));CSS.addClass(this.thumbsUpIcon,'hidden_elem');CSS.removeClass(this.undoRegion,'hidden_elem');}.bind(this));Event.listen(this.undoRegion,'mouseleave',function(event){CSS.removeClass(this.thumbsUpIcon,'hidden_elem');CSS.addClass(this.undoRegion,'hidden_elem');}.bind(this));}this.confirmationText&&!this.isAmbiguousText&&!this.usingConnectLibrary;if(!this.isBlocked){Event.listen(this.connectButton,'click',this.primaryLikeButtonOnClick.bind(this));if(this.grayOut)Event.listen(this.tombstoneCross,'click',this.connectToNodeOnClick.bind(this));}if(this.adminLinks)for(var a=0;a<this.adminLinks.length;a++)Event.listen(this.adminLinks[a],'click',this.presentAdminPage.bind(this));if(this.errorLinks)for(var a=0;a<this.errorLinks.length;a++)Event.listen(this.errorLinks[a],'click',this.presentErrorDialog.bind(this));if(this.confirmLinks)for(var f=0;f<this.confirmLinks.length;f++)Event.listen(this.confirmLinks[f],'click',this.presentConfirmDialog.bind(this));if(h.showCaptcha){this.showCaptcha=true;this.connectToNode(true);}if(this.forceCommentHooks)this.setupCommentHooks($(this.forceCommentHooks));this.textInputMarginWithButton=5;this.widthSyncArbiter=Arbiter.subscribe('platform/socialplugins/send/resize',this.syncSendWidgetWidth.bind(this));Arbiter.inform('platform/socialplugins/like/resize',{button_width:this.computeButtonDimensionsWithPadding().width,widget_width:Vector2.getElementDimensions(this.widget).x,layout:this.layout},Arbiter.BEHAVIOR_STATE);Arbiter.subscribe('platform/socialplugins/dialog',function(l,k){if(k.controllerID!==this.widgetID)this.otherCommentWidgetOpen=(k.event=='open');}.bind(this));this.subscribeToSync(h);};copy_properties(ExternalNodeConnectWidget,{STANDARD_LAYOUT:'standard',BOX_COUNT_LAYOUT:'box_count',BUTTON_COUNT_LAYOUT:'button_count',SIMPLE_LAYOUT:'simple',COLOR_DARK:0,COLOR_LIGHT:1,OPT_IN_FACEBOOK_APP_ID:'127760087237610',updateLoggedInUser:function(b){var a=ExternalNodeConnectWidget.controllerManagingLogin;a.setLoggedIn(b);a.connectToNode(true);a.userOptedOut=false;delete ExternalNodeConnectWidget.controllerManagingLogin;Arbiter.inform('platform/socialplugins/login',{user:b.user},Arbiter.BEHAVIOR_STATE);WidgetArbiter.inform('platform/socialplugins/login',{user:b.user},Arbiter.BEHAVIOR_STATE);},onCommentWidgetLoaded:function(a){var b=ExternalNodeConnectWidget.self;delete ExternalNodeConnectWidget.self;b.injectCommentWidgetMarkup(a);}});copy_properties(ExternalNodeConnectWidget.prototype,{getSyncEndpointName:function(){},getConnectionEndpointName:function(){},getPluginName:function(){},subscribeToSync:function(a){Arbiter.subscribe('platform/socialplugins/login',function(c,b){if(this.viewerID&&b.user!==this.viewerID)document.location.reload();}.bind(this));Arbiter.subscribe(this.getSyncEndpointName(),function(c,b){if(b.externalUrl==a.externalURL){this.userOptedOut=false;this.updateWidget(b.opts,true);}}.bind(this));},setQueryData:function(){copy_properties(this.popupOptInParams,{protocol:window.location.protocol,external_page_url:this.externalUrl});if(this.nux)copy_properties(this.popupOptInParams,{nux:this.nux,referer:this.iframeReferer});},updateWidget:function(e,d,b){var a=(this.alreadyConnected!=e.nowConnected)||(this.showConfirm!=e.showConfirm);if(!d)Arbiter.inform(this.getConnectionEndpointName(),e,Arbiter.BEHAVIOR_STATE);this.alreadyConnected=e.nowConnected;this.viewerIsAdmin=e.isAdmin;this.showError=e.showError;this.showConfirm=e.showConfirm;this.adminUrl=e.adminUrl;this.userProfile=e.userProfile;this.connectStoryFbid=e.connectStoryFbid;this.error=e.error;if(!e.nowConnected)this.closeCommentWidget();if(a&&!d||b){var c=e.nowConnected?'edgeCreated':'edgeRemoved';UnverifiedXD.send({type:c});}if(a||this.error)this.syncWidgetDisplay();if(!d||b)WidgetArbiter.inform(this.getSyncEndpointName(),{externalUrl:this.externalUrl,opts:e},Arbiter.BEHAVIOR_STATE);},presentOptIn:function(){ExternalNodeConnectWidget.controllerManagingLogin=this;PlatformOptInPopup.open(this.getPluginName(),'opt.inlike',this.popupOptInParams);UnverifiedXD.send({type:'authPrompted'});},setLoggedIn:function(a){this.viewerID=a.user;this.newProfilePic=a.profilePic;this.placeFormUserCheck(a.formUserCheck,a.fbDtsg);},placeFormUserCheck:function(b,a){window.Env.fb_dtsg=a;if(ge('post_form_id')){DOM.replace($('post_form_id'),HTML(b));}else DOM.appendContent(DOM.find(document,'body'),HTML(b));},syncWidgetWithServer:function(c){var b=c.getPayload();if(b.requires_login){this.updateWidget({nowConnected:false,isAdmin:false},false);this.presentOptIn();return;}var a={nowConnected:b.success&&b.already_connected,isAdmin:b.is_admin,showError:b.show_error,showConfirm:b.show_confirm,adminUrl:b.admin_url,userProfile:b.user_profile,connectStoryFbid:b.story_fbid,error:b.error_info};this.updateWidget(a,!b.success,b.success);if(b.success&&this.showCaptcha){window.opener.location.reload();window.close();}},getButtonCountWidgetWidth:function(){var a=DOM.find(this.widget,'table.connect_widget_interactive_area');var b=CSS.getStyle(a,'width');return parseInt(b,10);},sizeNumberCloud:function(){this.collapsedNumberCloudHeight=this.getCollapsedNumberCloudHeight();this.expandedNumberCloudHeight=this.collapsedNumberCloudHeight+this.getNumberCloudExtensionHeight();if(this.alreadyConnected)CSS.setStyle(this.numberCloud,'height',this.expandedNumberCloudHeight+'px');Bootloader.loadComponents(['vector'],bind(this,function(){var a=this.computeButtonDimensionsWithPadding().width;XD.forced_min_width=a;var b=intl_locale_is_rtl();a-=2;CSS.setStyle(this.numberCloud,'width',a+'px');CSS.setStyle(this.numberCloud,'visibility','visible');animation(this.numberCloud).from('opacity',0).to('opacity',1).duration(100).go();}));},getCollapsedNumberCloudHeight:function(){var b=Vector2.getElementDimensions(this.numberCloud).y;var d=parseInt(CSS.getStyle(this.numberCloud,'paddingTop'),10);var c=parseInt(CSS.getStyle(this.numberCloud,'paddingBottom'),10);var a=parseInt(CSS.getStyle(this.numberCloud,'border'),10);return b-d-c-2;},getNumberCloudExtensionHeight:function(){CSS.addClass(this.numberCloudExtension,'connect_widget_offscreen');if(!this.alreadyConnected)CSS.removeClass(this.numberCloudExtension,'hidden_elem');var a=Vector2.getElementDimensions(this.numberCloudExtension).y;if(!this.alreadyConnected)CSS.addClass(this.numberCloudExtension,'hidden_elem');CSS.removeClass(this.numberCloudExtension,'connect_widget_offscreen');return a;},restoreReminderSpan:function(event){if(this.reminderIsVisible||this.inAnimation)return;this.animateReminderSpanReappearance();},animateReminderSpanReappearance:function(){if(this.reminderIsVisible||this.inAnimation)return;this.inAnimation=true;CSS.addClass(this.numberCloudUnlikeSpan,'hidden_elem');CSS.setStyle(this.numberCloudReminderSpan,'opacity',0);CSS.removeClass(this.numberCloudReminderSpan,'hidden_elem');animation(this.numberCloudReminderSpan).to('opacity',1).duration(100).ondone(function(){this.inAnimation=false;this.reminderIsVisible=true;}.bind(this)).go();},exposeUnlikeSpan:function(event){if(!this.alreadyConnected||this.requiresMouseLeaveEvent||!this.reminderIsVisible||this.inAnimation)return;this.inAnimation=true;CSS.addClass(this.numberCloudReminderSpan,'hidden_elem');CSS.setStyle(this.numberCloudUnlikeSpan,'opacity',0);CSS.removeClass(this.numberCloudUnlikeSpan,'hidden_elem');animation(this.numberCloudUnlikeSpan).to('opacity',1).duration(100).ondone(function(){this.inAnimation=false;this.reminderIsVisible=false;}.bind(this)).go();},conditionallyActivateButton:function(event){this.commentButtonIsActive=this.inlineCommentInput.value.trim().length>0;},updateConnectionWithComment:function(event){Event.kill(event);if(this.commentButtonIsActive){this.postInlineComment();this.resetInlineComment();this.closeInlineComment();}},postInlineComment:function(){this.postUserComment(this.inlineCommentInput.value.trim());},resetInlineComment:function(){this.concealCommentButton();var a=this.inlineCommentInput.getAttribute('placeholder');this.inlineCommentInput.value=a;},showInlineComment:function(event){Event.kill(event);if(!this.inlineCommentFlyoutOpen||this.inlineCommentFlyoutVisible||this.showConfirm||this.error)return;this.inlineCommentFlyoutVisible=true;CSS.show(this.inlineCommentFlyout);},hideInlineComment:function(event){Event.kill(event);if(!this.inlineCommentFlyoutOpen||!this.inlineCommentFlyoutVisible)return;if(DOM.contains(this.inlineCommentFlyout,event.getRelatedTarget()))return;var b=this.inlineCommentInput.value.trim();var a=this.inlineCommentInput.getAttribute('placeholder');if(b.length>0&&b!=a)return;this.inlineCommentFlyoutVisible=false;CSS.hide(this.inlineCommentFlyout);},closeInlineComment:function(){this.inlineCommentFlyoutVisible=false;this.inlineCommentFlyoutOpen=false;CSS.hide(this.inlineCommentFlyout);this.resetInlineComment();},concealCommentButton:function(){CSS.addClass(this.inlineCommentButton,'hidden_elem');CSS.setStyle(this.inlineCommentInput,'width',this.textInputWidthWithoutButton+'px');CSS.setStyle(this.inlineCommentInput,'margin-right',0);},positionInlineCommentFlyout:function(){CSS.addClass(this.inlineCommentFlyout,'comment_widget_offscreen');CSS.removeClass(this.inlineCommentFlyout,'hidden_elem');var b=0;var a=this.computeButtonDimensions();var e=a.height;var d=this.grayOut?b:b+20;var g=intl_locale_is_rtl()?'right':'left';if(this.showFaces){var k=DOM.scry(this.widget,'span.connect_widget_text')[0];var h=intl_locale_is_rtl()?'paddingRight':'paddingLeft';var l=CSS.getStyle(k,h);d=this.grayOut?b:b+parseInt(l,10);var i=Vector2.getElementDimensions(this.sampleConnections).y;e=i-3;}var j=Vector2.getElementDimensions(this.summaryText).y;if(j>15)e+=2;CSS.setStyle(this.inlineCommentFlyout,g,d+'px');CSS.setStyle(this.inlineCommentFlyout,'top',(-e)+'px');var n=Vector2.getElementPosition(this.widget,'document').x;var m=Vector2.getElementDimensions(this.widget).x;var o=n+m-d-5;CSS.setStyle(this.inlineCommentFlyout,'width',o+'px');CSS.removeClass(this.inlineCommentButton,'hidden_elem');var f=Vector2.getElementDimensions(this.inlineCommentButton).x;CSS.addClass(this.inlineCommentButton,'hidden_elem');var c=(this.inlineCommentClose)?15:0;this.textInputWidthWithoutButton=o-24-c;this.textInputWidthWithButton=this.textInputWidthWithoutButton-f-this.textInputMarginWithButton-1;CSS.setStyle(this.inlineCommentInput,'width',this.textInputWidthWithoutButton+'px');CSS.setStyle(this.inlineCommentInput,'margin-right',0);CSS.removeClass(this.inlineCommentFlyout,'comment_widget_offscreen');CSS.addClass(this.inlineCommentFlyout,'hidden_elem');},postUserComment:function(a){var b={href:this.externalUrl,node_type:this.nodeType,edge_type:this.edgeType,page_id:this.pageId,connect_text:this.connectText,story_fbid:this.connectStoryFbid,comment:a};Bootloader.loadComponents(['async','async-postlude'],function(){new AsyncRequest().setURI(this.getCommentAjaxEndpoint()).setData(b).setNectarModuleDataSafe().setNectarImpressionIdSafe().send();}.bind(this));this.closeCommentWidget();},closeCommentWidget:function(){if(this.commentWidgetOpen){delete this.inGracePeriod;delete this.commentWidgetIsExpanded;this.commentWidgetVisible=false;this.commentWidgetOpen=false;UnverifiedXD.send({type:'dismissEdgeCommentDialog'});}},presentAdminPage:function(){var a='_blank';window.open(this.adminUrl.toString(),a);},presentErrorDialog:function(){var c='_blank';var b='toolbar=0, status=0, width=960, height=300';var a=new URI('/connect/connect_to_node_error.php');a.addQueryData({title:this.error.brief,body:this.error.full});window.open(a.toString(),c,b);},presentConfirmDialog:function(){var b='_blank';var a='toolbar=0,status=0,width=450,height=200,scrollbars=0,location=0,menubar=0';if(!window.confirmDialogReturn)window.confirmDialogReturn={};window.confirmDialogReturn[this.widgetID]=this;var c=this.getConfirmURL();window.open(c,b,a);},returnFromConfirmDialog:function(a){if(a){this.showConfirm=null;this.confirmedConnect=a;this.connectToNode(!this.alreadyConnected);}else this.updateWidget({nowConnected:this.alreadyConnected,showConfirm:null,isAdmin:this.viewerIsAdmin},false);},syncWidgetDisplay:function(){var a=this.alreadyConnected;this.setButtonState(a);this.showElementIf(this.connectedMessage,a);this.showElementIf(this.notConnectedMessage,!a);if(this.adminSpans)for(var b=0;b<this.adminSpans.length;b++)this.showElementIf(this.adminSpans[b],this.viewerIsAdmin);if(this.errorSpans)for(var c=0;c<this.errorSpans.length;c++)this.showElementIf(this.errorSpans[c],this.error&&(this.viewerIsAdmin||this.showError));for(var f=0;f<this.confirmSpans.length;f++)this.showElementIf(this.confirmSpans[f],!this.alreadyConnected&&this.showConfirm);for(var d=0;d<this.unlikeSpans.length;d++)this.showElementIf(this.unlikeSpans[d],this.alreadyConnected);if(this.shareCommentSpans)for(var e=0;e<this.shareCommentSpans.length;e++)this.showElementIf(this.shareCommentSpans[e],a);if(this.layout!==ExternalNodeConnectWidget.BOX_COUNT_LAYOUT)this.showElementIf(this.connectButton,(!this.useDisconnectLink||!a)&&!this.showConfirm);if(this.layout===ExternalNodeConnectWidget.BOX_COUNT_LAYOUT){this.manageBoxCountButtonAnimation(a);}else if(this.layout===ExternalNodeConnectWidget.BUTTON_COUNT_LAYOUT){this.manageButtonCountButtonAnimation(a);}else if(this.layout===ExternalNodeConnectWidget.SIMPLE_LAYOUT){this.manageSimpleButtonAnimation(a);}else this.manageStandardButtonAnimation(a);if(!this.loggedInUserPhotoDiv)return;if(a){this.slideUserPhotoIn(this.loggedInUserPhotoDiv);}else this.slideUserPhotoOut(this.loggedInUserPhotoDiv);},manageStandardButtonAnimation:function(a){if(this.grayOut)return;if(this.alreadyConnected||this.showConfirm){this.hideButton(true);}else this.hideButton(false);},setButtonState:function(a){if(a){CSS.removeClass(this.connectButton,'like_button_no_like');CSS.addClass(this.connectButton,'like_button_like');this.fixIEButtonDoubleLineBug();}else{CSS.addClass(this.connectButton,'like_button_no_like');CSS.removeClass(this.connectButton,'like_button_like');}},fixIEButtonDoubleLineBug:function(){if(this.layout===ExternalNodeConnectWidget.STANDARD_LAYOUT&&ua.ie()<=7&&!this.hasBeenFixed){var a=this.computeButtonDimensionsWithPadding();CSS.setStyle(this.connectButton,'width',a.width+1);this.hasBeenFixed=true;}},hideButton:function(a){if(this.layout!=='standard')return;if(this.oAnimateBlind)this.oAnimateBlind.stop();this.oAnimateBlind=animation(this.connectButtonSlider).duration(150);var c=1,b=intl_locale_is_rtl(),d=b?'marginRight':'marginLeft',e=b?'marginLeft':'marginRight';if(a){CSS.addClass(this.connectButtonContainer,'hidden');this.oAnimateBlind.ondone(function(){CSS.setStyle(this.connectButtonContainer,d,'2px');CSS.setStyle(this.connectButtonContainer,'visibility','hidden');CSS.addClass(this.confirmationCell,'connect_confirmation_cell_like');CSS.removeClass(this.confirmationCell,'connect_confirmation_cell_no_like');this.oAnimateBlind=null;}.bind(this));}else{CSS.setStyle(this.connectButtonContainer,d,'0px');c=Vector2.getElementDimensions(this.connectButton).x;this.oAnimateBlind.ondone(function(){CSS.setStyle(this.connectButtonSlider,'overflow','visible');CSS.setStyle(this.connectButtonSlider,'width','auto');CSS.removeClass(this.confirmationCell,'connect_confirmation_cell_like');CSS.addClass(this.confirmationCell,'connect_confirmation_cell_no_like');CSS.setStyle(this.connectButtonContainer,'visibility','visible');CSS.removeClass(this.connectButtonContainer,'hidden');this.oAnimateBlind=null;}.bind(this));}this.oAnimateBlind.to('width',c).blind().go();},showElementIf:function(a,b){if(!a)return;if(b){CSS.show(a);}else CSS.hide(a);},slideUserPhotoIn:function(b){if(!CSS.hasClass(b,'connect_widget_user_not_connected'))return;var a=CSS.getStyle(b,'width');CSS.setStyle(b,'width',0);CSS.setStyle(b,'opacity',0);CSS.removeClass(b,'connect_widget_user_not_connected');animation(b).to('width',a).duration(100).checkpoint().to('opacity',1).duration(400).go();},slideUserPhotoOut:function(a){if(CSS.hasClass(a,'connect_widget_user_not_connected'))return;animation(a).to('opacity',0).duration(100).checkpoint(.25).to('width',0).duration(100).ondone(function(){CSS.addClass(a,'connect_widget_user_not_connected');CSS.setStyle(a,'width',null);}).go();},primaryLikeButtonOnClick:function(event){if(this.grayOut&&this.alreadyConnected)return;this.connectToNodeOnClick(event);},_clickLocked:false,connectToNodeOnClick:function(event){Event.kill(event);if(!this._clickLocked){this._clickLocked=true;setTimeout(function(){this._clickLocked=false;}.bind(this),1000);if(this.viewerID==0||this.userOptedOut){this.presentOptIn();}else this.connectToNode(!this.alreadyConnected);}},connectToNode:function(d){if(!d){if(this.layout===ExternalNodeConnectWidget.SIMPLE_LAYOUT)return;if(this.layout===ExternalNodeConnectWidget.STANDARD_LAYOUT&&!this.usingConnectLibrary){CSS.addClass(this.userActionTextSpan,'hidden_elem');CSS.removeClass(this.summaryTextSpan,'hidden_elem');CSS.setStyle(this.summaryTextSpan,'opacity',1);}if(this.shareCommentSpans)for(var b=0;b<this.shareCommentSpans.length;b++)CSS.addClass(this.shareCommentSpans[b],'hidden_elem');if(this.commentWidgetOpen){this.closeCommentWidget();}else if(this.inlineCommentFlyoutOpen)this.closeInlineComment();}this.updateWidget({nowConnected:!this.alreadyConnected,isAdmin:this.viewerIsAdmin},true);var a={href:this.externalUrl,node_type:this.nodeType,edge_type:this.edgeType,page_id:this.pageId,layout:this.layout,is_personalized:this.isPersonalized,show_captcha:this.showCaptcha,connect_text:this.connectText,ref:this.ref,now_connected:d,post_form_id:$('post_form_id').value,iframe_referer:this.iframeReferer,scrape_was_allowed:this.scrapeWasAllowed};if(this.confirmedConnect)a.confirm=1;Bootloader.loadComponents(['async','async-postlude'],function(){new AsyncRequest().setURI(this.getAjaxEndpoint()).setHandler(this.syncWidgetWithServer.bind(this)).setData(a).setNectarModuleDataSafe().setNectarImpressionIdSafe().send();}.bind(this));if(d){if(this.layout===ExternalNodeConnectWidget.BOX_COUNT_LAYOUT)this.requiresMouseLeaveEvent=true;if(this.layout===ExternalNodeConnectWidget.STANDARD_LAYOUT&&!this.usingConnectLibrary){CSS.setStyle(this.userActionTextSpan,'opacity',1);CSS.removeClass(this.userActionTextSpan,'hidden_elem');CSS.addClass(this.summaryTextSpan,'hidden_elem');Event.listen(this.widget,'mouseleave',this.transitionBetweenMessages.bind(this));}if(this.shareCommentSpans){for(var c=0;c<this.shareCommentSpans;c++)CSS.removeClass(this.shareCommentSpans[c],'hidden_elem');}else if(this.supportCommenting)this.presentCommentingOption();this.repositionFacepileVertically();}},transitionBetweenMessages:function(event){if(!this.alreadyConnected||CSS.hasClass(this.userActionTextSpan,'hidden_elem'))return;animation(this.userActionTextSpan).to('opacity',0).duration(500).ondone(function(){CSS.addClass(this.userActionTextSpan,'hidden_elem');CSS.setStyle(this.summaryTextSpan,'opacity',0);CSS.removeClass(this.summaryTextSpan,'hidden_elem');animation(this.summaryTextSpan).to('opacity',1).duration(500).ondone(function(){this.repositionFacepileVertically();}.bind(this)).go();this.positionInlineCommentFlyout();}.bind(this)).go();},presentCommentingOption:function(){Arbiter.inform('platform/socialplugins/dialog',{controllerID:this.widgetID,event:'open'});if(this.usingConnectLibrary){ExternalNodeConnectWidget.self=this;var a={type:'presentEdgeCommentDialog',masterFrameName:window.name,version:2};if(this.layout==ExternalNodeConnectWidget.BOX_COUNT_LAYOUT){a.preComputedWidthOffset=this.computeButtonDimensionsWithPadding().width;if(!intl_locale_is_rtl())a.preComputedWidthOffset+=8;}if(this.socialBar){a.left=parseInt(CSS.getStyle(document.getElementById('profile'),'width'),10)+1;}else if(this.hasSend&&this.layout==ExternalNodeConnectWidget.STANDARD_LAYOUT)a.preComputedWidthOffset=this.invertedButtons?0:65;UnverifiedXD.send(a);this.commentWidgetOpen=true;this.commentWidgetVisible=true;this.commentWidgetExpanded=true;}else if(this.usingInlineCommenting)if(!this.inlineCommentListenersInitialized){this.unwrapMarkup('connect-widget-comment-box-markup');this.initializeInlineCommentListeners();this.openInlineCommentFlyout();this.positionInlineCommentFlyout();this.inlineCommentListenersInitialized=true;}else{this.positionInlineCommentFlyout();this.openInlineCommentFlyout();}},unwrapMarkup:function(a){if(this.unwrappedMarkup[a])return;var c=$(a),b=c.innerHTML;b=b.substr(4,b.length-7);c.innerHTML=b;this.unwrappedMarkup[a]=true;},initializeInlineCommentListeners:function(){this.inlineCommentFlyout=DOM.find(this.widget,'.connect_widget_comment_box');this.inlineCommentInput=DOM.find(this.inlineCommentFlyout,'.connect_widget_comment_textinput');this.inlineCommentButton=DOM.find(this.inlineCommentFlyout,'.connect_widget_comment_button');this.inlineCommentClose=DOM.scry(this.inlineCommentFlyout,'.connect_widget_comment_close_button');if(this.inlineCommentClose.length>0)this.inlineCommentClose=this.inlineCommentClose[0];this.commentButtonIsActive=false;Event.listen(this.inlineCommentInput,'keyup',this.conditionallyActivateButton.bind(this));Event.listen(this.inlineCommentInput,'focus',this.exposeCommentButton.bind(this));Event.listen(this.inlineCommentButton,'click',this.updateConnectionWithComment.bind(this));Event.listen(this.widget,'mouseout',this.hideInlineComment.bind(this));Event.listen(this.widget,'mouseover',this.showInlineComment.bind(this));if(this.inlineCommentClose)Event.listen(this.inlineCommentClose,'click',function(event){for(var a=0;a<this.shareCommentSpans.length;a++)CSS.removeClass(this.shareCommentSpans[a],'hidden_elem');this.closeInlineComment();}.bind(this));},exposeCommentButton:function(event){if(!CSS.hasClass(this.inlineCommentButton,'hidden_elem'))return;CSS.removeClass(this.inlineCommentButton,'hidden_elem');CSS.setStyle(this.inlineCommentInput,'width',this.textInputWidthWithButton+'px');CSS.setStyle(this.inlineCommentInput,'margin-right',this.textInputMarginWithButton+'px');},openInlineCommentFlyout:function(){CSS.show(this.inlineCommentFlyout);this.inlineCommentFlyoutOpen=true;this.inlineCommentFlyoutVisible=true;},manageBoxCountButtonAnimation:function(a){if(a&&!this.showConfirm){this.animateBoxCountButtonDisappearance();}else this.animateBoxCountButtonReappearance();},animateBoxCountButtonDisappearance:function(){if(this.grayOut)return;CSS.addClass(this.connectButton,'hidden_elem');CSS.setStyle(this.numberCloudExtension,'opacity',0);CSS.removeClass(this.numberCloudExtension,'hidden_elem');CSS.addClass(this.numberCloudNub,'hidden_elem');CSS.addClass(this.numberCloudUnlikeSpan,'hidden_elem');CSS.removeClass(this.numberCloudReminderSpan,'hidden_elem');animation(this.numberCloud).to('height',this.expandedNumberCloudHeight).duration(100).ondone(function(){animation(this.numberCloudExtension).from('opacity',0).to('opacity',1).duration(100).go();}.bind(this)).go();},animateBoxCountButtonReappearance:function(){CSS.addClass(this.numberCloudExtension,'hidden_elem');animation(this.numberCloud).to('height',this.collapsedNumberCloudHeight).duration(75).ondone(function(){if(this.showConfirm){for(var a=0;a<this.confirmSpans.length;a++)CSS.removeClass(this.confirmSpans[a],'hidden_elem');}else{CSS.setStyle(this.connectButton,'opacity',0);CSS.removeClass(this.connectButton,'hidden_elem');animation(this.connectButton).from('opacity',0).to('opacity',1).duration(75).ondone(function(){CSS.setStyle(this.numberCloudNub,'opacity',0);CSS.removeClass(this.numberCloudNub,'hidden_elem');animation(this.numberCloudNub).from('opacity',0).to('opacity',1).duration(50).go();}.bind(this)).go();}}.bind(this)).go();},manageButtonCountButtonAnimation:function(a){if(a&&!this.showConfirm){this.animateButtonCountButtonDisappearance();}else this.animateButtonCountButtonReappearance();if(!this.grayOut){CSS.removeClass(this.thumbsUpIcon,'hidden_elem');CSS.addClass(this.undoRegion,'hidden_elem');}},manageSimpleButtonAnimation:function(a){if(this.grayOut)return;if(a&&!this.showConfirm){this.animateSimpleButtonDisappearance();}else this.animateSimpleButtonReappearance();},animateButtonCountButtonDisappearance:function(){if(!this.grayOut)animation(this.connectButton).from('opacity',1).to('opacity',0).from('width',this.originalButtonWidth).to('width','0px').ondone(function(){CSS.addClass(this.connectButton,'hidden_elem');}.bind(this)).duration(100).go();animation(this.numberExcluding).from('opacity',1).to('opacity',0).duration(100).ondone(function(){CSS.addClass(this.numberExcluding,'hidden_elem');CSS.setStyle(this.summaryIncluding,'opacity',0);CSS.removeClass(this.summaryIncluding,'hidden_elem');animation(this.summaryIncluding).from('opacity',0).to('opacity',1).duration(100).go();}.bind(this)).go();for(var a=0;a<this.confirmSpans.length;a++)CSS.addClass(this.confirmSpans[a],'hidden_elem');if(this.grayOut)CSS.removeClass(this.connectButton,'hidden_elem');},animateSimpleButtonDisappearance:function(){animation(this.connectButton).from('opacity',1).to('opacity',0).from('width',this.originalButtonWidth).to('width','0px').ondone(function(){CSS.addClass(this.connectButton,'hidden_elem');CSS.setStyle(this.summaryIncluding,'opacity',0);CSS.removeClass(this.summaryIncluding,'hidden_elem');animation(this.summaryIncluding).from('opacity',0).to('opacity',1).duration(100).go();}.bind(this)).duration(50).go();for(var a=0;a<this.confirmSpans.length;a++)CSS.addClass(this.confirmSpans[a],'hidden_elem');if(this.grayOut)CSS.removeClass(this.connectButton,'hidden_elem');},computeButtonDimensions:function(){var c=CSS.hasClass(this.connectButton,'hidden_elem');if(c){CSS.addClass(this.connectButton,'connect_widget_offscreen');CSS.removeClass(this.connectButton,'hidden_elem');}var a=Vector2.getElementDimensions(this.connectButton);var d=a.x;var b=a.y;var f=parseInt(CSS.getStyle(this.connectButton,'paddingLeft'),10);var g=parseInt(CSS.getStyle(this.connectButton,'paddingRight'),10);var h=parseInt(CSS.getStyle(this.connectButton,'paddingTop'),10);var e=parseInt(CSS.getStyle(this.connectButton,'paddingBottom'),10);if(c){CSS.addClass(this.connectButton,'hidden_elem');CSS.removeClass(this.connectButton,'connect_widget_offscreen');}return {width:d-f-g-2,height:b};},computeButtonDimensionsWithPadding:function(){var c=CSS.hasClass(this.connectButton,'hidden_elem');if(c){CSS.addClass(this.connectButton,'connect_widget_offscreen');CSS.removeClass(this.connectButton,'hidden_elem');}var a=Vector2.getElementDimensions(this.connectButton);var d=a.x;var b=a.y;if(ua.ie())d+=3;if(c){CSS.addClass(this.connectButton,'hidden_elem');CSS.removeClass(this.connectButton,'connect_widget_offscreen');}return {width:d,height:b};},animateButtonCountButtonReappearance:function(){if(this.showConfirm){for(var a=0;a<this.confirmSpans.length;a++)CSS.removeClass(this.confirmSpans[a],'hidden_elem');}else if(!this.grayOut){CSS.removeClass(this.connectButton,'hidden_elem');animation(this.connectButton).from('width','0px').to('width',this.originalButtonWidth).from('opacity',0).to('opacity',1).duration(100).go();}CSS.setStyle(this.summaryIncluding,'opacity',1);animation(this.summaryIncluding).from('opacity',1).to('opacity',0).duration(100).ondone(function(){CSS.addClass(this.summaryIncluding,'hidden_elem');CSS.setStyle(this.numberExcluding,'opacity',0);CSS.removeClass(this.numberExcluding,'hidden_elem');animation(this.numberExcluding).from('opacity',0).to('opacity',1).duration(100).go();}.bind(this)).go();},animateSimpleButtonReappearance:function(){if(this.showConfirm){for(var a=0;a<this.confirmSpans.length;a++)CSS.removeClass(this.confirmSpans[a],'hidden_elem');}else{CSS.removeClass(this.connectButton,'hidden_elem');animation(this.connectButton).from('width','0px').to('width',this.originalButtonWidth).from('opacity',0).to('opacity',1).duration(100).go();}CSS.setStyle(this.summaryIncluding,'opacity',1);animation(this.summaryIncluding).from('opacity',1).to('opacity',0).duration(100).ondone(function(){CSS.addClass(this.summaryIncluding,'hidden_elem');}.bind(this)).go();},injectCommentWidgetMarkup:function(a){this.commentDocument=a;this.commentDocument.body.innerHTML=this.commentWidgetMarkup;this.transferCSSStyles();if(this.newProfilePic){var c=DOM.find(this.commentDocument,'img.connect_comment_widget_user_pic');c.src=this.newProfilePic;delete this.newProfilePic;}if(ua.ie()){var f=DOM.scry(this.commentDocument,'.connect_comment_share_preview_pic');if(f.length>0){f=f[0];var e=50;var d=Vector2.getElementDimensions(f);var g=e/d.x;if(g<1){CSS.setStyle(f,'width',e);CSS.setStyle(f,'height',d.y*g);}}}this.setupCommentHooks(this.commentDocument);this.commentWidgetIsExpanded=!this.inlineUnlikeLink;var b=this.getCommentActivatingComponent();b.onmouseout=this.hideCommentWidget.bind(this);b.onmouseover=this.showCommentWidget.bind(this);this.commentDocument.body.onmouseout=this.hideCommentWidget.bind(this);this.commentDocument.body.onmouseover=this.showCommentWidget.bind(this);this.inGracePeriod=false;},setupCommentHooks:function(a){this.placeholderInputRegion=DOM.find(a,'div.connect_comment_widget_placeholder_input_region');this.placeholderInput=DOM.find(this.placeholderInputRegion,'input.connect_comment_widget_placeholder_input');this.fullInputRegion=DOM.find(a,'div.connect_comment_widget_full_input_region');this.fullInputTextarea=DOM.find(this.fullInputRegion,'textarea.connect_comment_widget_full_input_textarea');this.widgetButtonRegion=DOM.find(a,'div.connect_comment_widget_button_region');this.postToFacebookButton=DOM.find(this.widgetButtonRegion,'.connect_comment_widget_post_button input');this.inlineUnlikeLink=DOM.scry(a,'a.connect_comment_widget_unlike_link');if(this.inlineUnlikeLink.length>0)this.inlineUnlikeLink=this.inlineUnlikeLink[0];this.defaultInputText=this.placeholderInput.value;this.placeholderInput.onfocus=this.transitionToFullInputMode.bind(this);this.fullInputTextarea.onfocus=this.removePlaceholderText.bind(this);this.fullInputTextarea.onblur=this.restorePlaceholderText.bind(this);this.postToFacebookButton.onclick=this.updateUserComment.bind(this);if(this.inlineUnlikeLink)this.inlineUnlikeLink.onclick=this.connectToNodeOnClick.bind(this);},getCommentActivatingComponent:function(){if(this.layout===ExternalNodeConnectWidget.BOX_COUNT_LAYOUT||this.layout===ExternalNodeConnectWidget.BUTTON_COUNT_LAYOUT){return this.widget;}else if(this.layout===ExternalNodeConnectWidget.SIMPLE_LAYOUT){return this.widget;}else if(this.grayOut){return DOM.find(this.widget,'table.connect_widget_interactive_area');}else return this.confirmationCell;},showCommentWidget:function(event){if(this.otherCommentWidgetOpen)return false;this.inGracePeriod=true;this.killCloseThread();if(this.commentWidgetOpen&&!this.commentWidgetVisible){this.commentWidgetVisible=true;CSS.show(this.commentDocument.body);UnverifiedXD.send({type:'showEdgeCommentDialog'});}return false;},hideCommentWidget:function(event){if(this.otherCommentWidgetOpen)return false;this.inGracePeriod=false;if(this.commentWidgetOpen&&this.commentWidgetVisible){var a=function(){if(!this.inGracePeriod&&this.shouldHideExpandedWidget()){this.fullInputTextarea.blur();this.commentWidgetVisible=false;if(!this.socialBar)CSS.hide(this.commentDocument.body);UnverifiedXD.send({type:'hideEdgeCommentDialog'});}this.inGracePeriod=false;this.killCloseThread();}.bind(this);this.closeThreadID=setTimeout(a,100);}return false;},shouldHideExpandedWidget:function(){return !this.commentWidgetIsExpanded||this.fullInputTextarea.value===''||this.fullInputTextarea.value===this.defaultInputText;},killCloseThread:function(){if(this.closeThreadID){clearTimeout(this.closeThreadID);delete this.closeThreadID;}},transferCSSStyles:function(){var d=DOM.scry(window.document,'link');var e=DOM.scry(window.document,'style');var c=DOM.find(window.document,'html');var g=DOM.find(this.commentDocument,'html');var f=DOM.find(this.commentDocument,'head');for(var a=0;a<d.length;a++)if(d[a].rel=='stylesheet'){var b=this.commentDocument.createElement('link');b.rel=d[a].rel;b.href=d[a].href;b.type=d[a].type;f.appendChild(b);}if(window.ResourceBundler)ResourceBundler.applyCSSToDocument(this.commentDocument);g.id=c.id;g.className=c.className;this.commentDocument.body.className=window.document.body.className;},transitionToFullInputMode:function(event){this.commentWidgetIsExpanded=true;CSS.hide(this.placeholderInputRegion);CSS.show(this.fullInputRegion);CSS.show(this.widgetButtonRegion);this.fullInputTextarea.focus();return false;},removePlaceholderText:function(event){if(CSS.hasClass(this.fullInputTextarea,'connect_comment_widget_disabled')){CSS.removeClass(this.fullInputTextarea,'connect_comment_widget_disabled');this.fullInputTextarea.value='';}return false;},restorePlaceholderText:function(event){if(this.fullInputTextarea.value.trim()==''){this.fullInputTextarea.value=this.defaultInputText;CSS.addClass(this.fullInputTextarea,'connect_comment_widget_disabled');}return false;},updateUserComment:function(event){var a=this.fullInputTextarea.value.trim();if(a!=''&&a!=this.defaultInputText)this.postUserComment(a);return false;},dismissCommentWidget:function(event){this.closeCommentWidget();return false;},getAjaxEndpoint:function(){return '/ajax/connect/external_node_connect.php';},getCommentAjaxEndpoint:function(){return '/ajax/connect/external_edge_comment.php';},getConfirmURL:function(){var a={href:this.externalUrl,page_id:this.pageId,node_type:this.nodeType,edge_type:this.edgeType,widget_id:this.widgetID};if(this.ref)a.ref=this.ref;return URI('/plugins/like_confirm.php').addQueryData(a).toString();},updateLoggedInUser:function(b,a){ExternalNodeConnectWidget.updateLoggedInUser(b,a);},syncSendWidgetWidth:function(i,b){var a=this.computeButtonDimensionsWithPadding().width;var c=b.button_width-a;if(this.layout===ExternalNodeConnectWidget.BOX_COUNT_LAYOUT&&c>0&&c<=5){CSS.setStyle(this.connectButton,'width',(b.button_width-parseInt(CSS.getStyle(this.connectButton,'paddingLeft'))-parseInt(CSS.getStyle(this.connectButton,'paddingRight'))-parseInt(CSS.getStyle(this.connectButton,'borderLeftWidth'))-parseInt(CSS.getStyle(this.connectButton,'borderRightWidth')))+'px');this.sizeNumberCloud();}if(this.layout===ExternalNodeConnectWidget.STANDARD_LAYOUT){var d=Vector2.getElementDimensions(this.widget).y;CSS.setStyle(this.widget,'height',(d+5)+'px');var e=ua.firefox();var f=ua.ie();var g=intl_locale_is_rtl();var h=g?'right':'left';if(f&&f<9){CSS.setStyle(this.connectButton,'position','absolute');CSS.setStyle(this.connectButton,h,-(b.button_width+10)+'px');}else{CSS.setStyle(this.connectButton,'position','fixed');CSS.setStyle(this.connectButton,h,'0px');}if(f&&this.connectButtonSlider){CSS.setStyle(this.connectButtonSlider,h,b.button_width+'px');if(f<=7)this.fixIEButtonDoubleLineBug();}CSS.setStyle(this.confirmationCell,'position','absolute');CSS.setStyle(this.confirmationCell,h,(b.button_width+a+5)+'px');CSS.setStyle(this.confirmationCell,'top','5px');if(this.sampleConnections){CSS.setStyle(this.sampleConnections,'position','fixed');CSS.setStyle(this.sampleConnections,h,'0');}this.invertedButtons=true;this.repositionFacepileVertically();}},repositionFacepileVertically:function(){if(this.invertedButtons&&this.sampleConnections){var a=Vector2.getElementDimensions(this.summaryText).y;CSS.setStyle(this.sampleConnections,'margin-top',(5+a+5)+'px');}}});
var ExternalPageLikeWidget=function(a){a.edgeType='like';this.parent.construct(this,a);this.unactionLink=DOM.scry(this.widget,'span.unlike_link')[0];if(this.unactionLink)Event.listen(this.unactionLink,'click',this.connectToNodeOnClick.bind(this));this.hasShowedInsights=false;this.showInsights();};ExternalPageLikeWidget.extend('ExternalNodeConnectWidget');copy_properties(ExternalPageLikeWidget.prototype,{getSyncEndpointName:function(){return 'platform/like/sync';},getConnectionEndpointName:function(){return 'platform/like/connection';},getPluginName:function(){return 'like';},presentInsightsPage:function(){var a=this.adminUrl.split('/');var b=a[a.length-1];window.open('/insights/?sk=po_'+b,'_blank');},showInsights:function(){if(this.hasShowedInsights)return;var b=DOM.scry(this.widget,'a.connect_widget_insights_link');if(b)for(var a=0;a<b.length;a++){CSS.show(b[a].parentNode);Event.listen(b[a],'click',this.presentInsightsPage.bind(this));}this.hasShowedInsights=true;},repositionFacepileVertically:function(){this.showInsights();this.parent.repositionFacepileVertically();}});
function DOMControl(a){this.root=$(a);this.updating=false;DataStore.set(a,'DOMControl',this);}DOMControl.prototype={getRoot:function(){return this.root;},beginUpdate:function(){if(this.updating)return false;this.updating=true;return true;},endUpdate:function(){this.updating=false;},update:function(a){if(!this.beginUpdate())return this;this.onupdate(a);this.endUpdate();}};DOMControl.getInstance=function(a){return DataStore.get(a,'DOMControl');};
add_properties('Input',{focus:function(a){try{a.focus();}catch(b){}},isEmpty:function(a){return !(/\S/).test(a.value||'')||CSS.hasClass(a,'DOMControl_placeholder');},getValue:function(a){return Input.isEmpty(a)?'':a.value;},setValue:function(b,c){CSS.removeClass(b,'DOMControl_placeholder');b.value=c;var a=DOMControl.getInstance(b);a&&a.resetHeight&&a.resetHeight();},setPlaceholder:function(a,b){a.setAttribute('title',b);a.setAttribute('placeholder',b);if(a==document.activeElement)return;if(Input.isEmpty(a)){CSS.conditionClass(a,'DOMControl_placeholder',b);a.value=b;}},reset:function(a){Input.setValue(a,'');var b=a.getAttribute('placeholder');b&&Input.setPlaceholder(a,b);a.style.height='';},setSubmitOnEnter:function(a,b){CSS.conditionClass(a,'enter_submit',b);},getSubmitOnEnter:function(a){return CSS.hasClass(a,'enter_submit');}});
onloadRegister(function(){Event.listen(document.documentElement,'submit',function(b){var a=b.getTarget().getElementsByTagName('*');for(var c=0;c<a.length;c++)if(a[c].getAttribute('placeholder')&&Input.isEmpty(a[c]))a[c].value='';});});