/* From: wfe3-nyc : 20212 */
var CommentsLoader={entry_id:0,page:1,show_mode:1,order_by:0,per_page:15,vertical:'',comment_div:0,load_link_div:0,isBranch:0,isSubtree:0,isWholePage:0,showBadges:(-1!==location.search.indexOf('levels=1')),showPundits:(-1!==location.search.indexOf('pundits_on=1')),load:function(entry_id,page,show_mode,order_by,parent_comment_id,per_page,vertical,comment_id_scroll_to){if(!this.completed)return;this.completed=false;this.entry_id=entry_id;this.page=page;this.show_mode=show_mode;this.order_by=order_by;this.per_page=per_page;this.vertical=vertical;this.comment_div=(parent_comment_id?$('comment_children_'+parent_comment_id):$('comments_'+entry_id));this.load_link_div=(parent_comment_id?$('load_childrens_link_'+parent_comment_id):0);this.isBranch=0;this.isSubtree=(page<0);this.isWholePage=(parent_comment_id==0);if(comment_id_scroll_to)this.commentIdScrollTo=comment_id_scroll_to;this.showSpinner();var co=YAHOO.util.Connect.asyncRequest('GET','/commentsv3/show_comments/'+entry_id+'/?page='+page+'&show_mode='+show_mode
+'&order_by='+order_by+'&comment_id='+parent_comment_id+'&per_page='+per_page+'&vertical='+this.vertical
+(comment_id_scroll_to?'&show_comment_id='+comment_id_scroll_to:'')
+(this.is_fastnews_entry?'&fne=1':'')
+(this.showBadges?'&levels=1':'')
+((location.search.indexOf('sc=')!==-1)?'&sc=1':'')
+(this.showPundits?'&pundits_on=1':''),this);if(CommentPollerV3&&(page==1)){CommentPollerV3.hideAlert();}},reloadCurrentPage:function(){if(!this.entry_id){this.entry_id=HPUtil.GetEntryID();}
if(this.entry_id){this.load(this.entry_id,this.page,this.show_mode,this.order_by,0,this.per_page,this.vertical);}},loadBranch:function(entry_id,page,show_mode,parent_comment_id){if(!this.completed)return;this.completed=false;this.comment_div=$('comment_children_'+parent_comment_id);this.load_link_div=$('load_branch_link_'+parent_comment_id);this.isBranch=1;this.isSubtree=0;this.isWholePage=0;this.showSpinner();var co=YAHOO.util.Connect.asyncRequest('GET','/commentsv3/show_comments/'+entry_id+'/?page='+page+'&show_mode='+show_mode+'&comment_id='+parent_comment_id+(this.is_fastnews_entry?"&fne=1":"")+(this.showBadges?'&levels=1':'')+((location.search.indexOf('sc=')!==-1)?'&sc=1':''),this);},showSpinner:function(){spinner=$('comment_spinner_pager');target_div=((this.isBranch||this.isSubtree)?this.load_link_div:this.comment_div);if(spinner&&target_div){target_div.innerHTML=spinner.innerHTML;return true;}
return false;},success:function(o){if(this.load_link_div)this.load_link_div.style.display='none';this.completed=true;if(this.isBranch){if(this.comment_div)this.comment_div.innerHTML+=o.responseText;}
else{if(this.comment_div)this.comment_div.innerHTML=o.responseText;}
HuffPoUtil.ImageLoader.foldCheck("comments_"+this.entry_id);ReplyBoxCallbacks.showYahooBox('root');ReplyBoxCallbacks.renderFbNamePic('root');if(!HuffCookies.getUserName()){button_logged=$('post_button_for_logged_in');button_not_logged=$('post_button_for_not_logged_in');if(button_logged&&button_not_logged){button_logged.style.display='none';button_not_logged.style.display='block';}
var hover_btn=$("comment_hover_button");var hover_links=$("comment_hover_links");if(hover_btn&&hover_links){E.addListener(hover_btn,"mouseover",QuickLogin.showCommentHoverLinks);E.addListener(hover_links,"mouseover",QuickLogin.showCommentHoverLinks);E.addListener(hover_btn,"mouseout",QuickLogin.hideCommentHoverLinks);E.addListener(hover_links,"mouseout",QuickLogin.hideCommentHoverLinks);}
$('comments_linkedin_placeholder').innerHTML='<div class="cursor_pointer hover_link_linkedin" onclick="linkSocialAccount.checkLoginStatus(\'linkedin\'); return false;"><div class="tiny_hover cmnt_connect_image linkedin_tiny_pic float_left"></div>&nbsp;<span id="cmnt_connect_linkedin">Linkedin Account</span></div><div class="clear"></div>';}
if(!this.isBranch&&!this.isSubtree){if(this.commentIdScrollTo){Comments.scrollToComment(this.commentIdScrollTo);this.commentIdScrollTo=false;}else if(-1!==location.href.indexOf('#comments'))
location.href='#comments';else if(-1!==location.href.indexOf('#postComment'))
location.href='#postComment';}
PunditsComments.init();CommentsSharer.updatePopupBoxes();if(typeof(init_comment_textareas)!='undefined')init_comment_textareas();Comments.trackSponsorComments('in_flow');},failure:function(o){if(this.comment_div)this.comment_div.innerHTML="Sorry, we couldn't load comments for some reason. Try reloading the page.";this.completed=true;},completed:true};function CommentsSharerClass(){this.init=false;this.badge_object=false;this.badge_holder_id=false;this.popup_object=false;this.comment_ids=[];this.comment_share_numbers={};this.hovered_comment_id=false;this.hovered_comment={};this.shared_data_loaded=false;};CommentsSharerClass.prototype={};CommentsSharerClass.prototype.initBadgeBox=function(target_id){if(this.init==true)return;this.popup_object=new PopUp({display_mode:"advanced",place_type:"near_trigger",popup_event_callback:{scope:this,funct:this.registerShareHovering,params:{}},offset:{x:29,y:-43}});if(target_id)this.popup_object.setTarget(target_id);this.init=true;};CommentsSharerClass.prototype.updatePopupBoxes=function(comment_box){if(!this.init)this.initBadgeBox();var trigger_elements=Dom.getElementsByClassName("share_comment_popup_trigger");var len=trigger_elements.length,trigger,tmp;for(var i=0;i<len;i++){trigger=trigger_elements[i];this.popup_object.addTrigger(trigger.id);this.comment_ids.push(trigger.id.replace(/[^\d]*/g,''));}
var len=this.comment_ids.length;for(var i=0;i<len;i++){this.comment_share_numbers[this.comment_ids[i]]={facebook:0,twitter:0,stumble:0};}
E.on("comments_"+HuffPoUtil.GetEntryID(),"mouseover",this.fetchShareNumbers,null,this);};CommentsSharerClass.prototype.registerShareHovering=function(popup_params,my_params){this.hovered_comment_id=popup_params.trigger_id;this.updateBadgeNumbers();return;};CommentsSharerClass.prototype.updateBadgeNumbers=function(){if(!this.hovered_comment_id)return;var comment_id=this.hovered_comment_id.replace(/[^\d]*/,'');var share_numbers=this.comment_share_numbers[comment_id];if(!share_numbers){share_numbers={facebook:0,twitter:0,stumble:0};}
this.badge_object.sliceHandler_facebook_comment_update_numbers(share_numbers.facebook);this.badge_object.userFunc_retweet_comment_share_update_numbers(share_numbers.twitter);this.badge_object.userFunc_stumble_comment_update_numbers(share_numbers.stumble);return;};CommentsSharerClass.prototype.updateHoveredCommentDetails=function(){var comment_link=$(this.hovered_comment_id+"_data_link");var comment_title=$(this.hovered_comment_id+"_data_title");if(!comment_title||!comment_link)return;this.hovered_comment.link=comment_link.innerHTML;this.hovered_comment.title=comment_title.innerHTML;};CommentsSharerClass.prototype.getHoveredCommentDetails=function(params){this.updateHoveredCommentDetails();params.comment_id=this.hovered_comment_id;params.link=this.hovered_comment.link;params.title=this.hovered_comment.title;return params;};CommentsSharerClass.prototype.shareToDigg=function(){this.updateHoveredCommentDetails();Sharer.Digg.digg_it(this.hovered_comment.title,this.hovered_comment.link);};CommentsSharerClass.prototype.shareToStumble=function(){this.updateHoveredCommentDetails();var url="http://www.stumbleupon.com/submit?url="+escape(this.hovered_comment.link)+"&amp;title="+escape(this.hovered_comment.title);window.open(url,"comment_sharer_window","width=650,height=520,status=yes,location=no,left=0,top=0");};CommentsSharerClass.prototype.shareToReddit=function(){this.updateHoveredCommentDetails();var url="http://reddit.com/submit?url="+escape(this.hovered_comment.link)+"&amp;title="+escape(this.hovered_comment.title);window.open(url,"comment_sharer_window","width=650,height=520,status=yes,location=no,left=0,top=0");};CommentsSharerClass.prototype.shareToDelicous=function(){this.updateHoveredCommentDetails();var url="http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url="+escape(this.hovered_comment.link)+"&amp;title="+escape(this.hovered_comment.title);window.open(url,"comment_sharer_window","width=650,height=520,status=yes,location=no,left=0,top=0");};CommentsSharerClass.prototype.fetchShareNumbers=function(){if(this.shared_data_loaded)return true;this.shared_data_loaded=true;var callback={scope:this,success:function(o){var response=JSON.parse(o.responseText);if(typeof(response)=="object"){this.comment_share_numbers=response.share_numbers;this.updateBadgeNumbers();}},failure:function(){}};C.asyncRequest("GET","/commentsv3/get_comment_statistic.php?eid="+HuffPoUtil.GetEntryID()+"&cids="+this.comment_ids.join(","),callback);};var CommentsSharer=new CommentsSharerClass();var CommentPollerV3={check:function(entry_id,first_time){HPTrack.trackPageview('/devy/v3_poll');if(CommentsLoader.completed){if(first_time||!this.openFlag){var conn=YAHOO.util.Connect.asyncRequest('GET','/commentsv3/checkNewComments.php?entry_id='+entry_id+(this.is_fastnews_entry?"&fne=1":""),this);}}
var update_comments=false;if(HPConfig.comments_update_for_all_users===true){update_comments=true;}else{if(HPConfig.comments_update_for_all_users===false&&HuffCookies.getUserName()){update_comments=true;}}
var update_time_interval=180000;if(HPConfig.comments_update_interval||HPConfig.comments_update_interval===0){update_time_interval=HPConfig.comments_update_interval;}
if(update_time_interval>0&&update_comments===true){setTimeout("CommentPollerV3.check("+entry_id+", false);",update_time_interval);}},success:function(o){var nca=$('new_comment_alert');var nca_cnt=$('new_comment_alert_cnt');var newCommentCnt=parseInt(o.responseText);if(!isNaN(newCommentCnt)&&(newCommentCnt>this.lastCommentCnt)){if(!this.lastCommentCnt){this.lastCommentCnt=newCommentCnt;}else if(!this.openFlag){nca_cnt.innerHTML=newCommentCnt-this.lastCommentCnt;nca.style.bottom=0;nca.style.left=0;HuffPoUtil.show(nca);this.openFlag=true;if($("entry_comments_amount")){$("entry_comments_amount").innerHTML=HuffPoUtil.number_format(newCommentCnt);if(typeof(document.badgeCommentAmountIncrease)!=="undefined"){document.badgeCommentAmountIncrease(HuffPoUtil.number_format(newCommentCnt));}
HuffPoUtil.AnimRequestFinished(["entry_comments_amount_wrapper"],'#FFFF33',$("entry_comments_amount").style.color);}
this.lastCommentCnt=newCommentCnt;}}else{this.hideAlert();}},failure:function(o){},hideAlert:function(){if(this.openFlag){this.openFlag=false;var nca=$('new_comment_alert');HuffPoUtil.hide(nca);}},openFlag:false,lastCommentCnt:0};var Comments={moduleSuffix:'',topicName:'',topicDir:'',bFacebookConnected:false,added_comment_id:0,maxWords:250,bInited:false,is_post_completed:true,is_facebook_id_saved:false,is_facebook_checked:false,is_yahoo_checked:false,is_twitter_checked:false,init:function(entry_id){if(this.bInited||!entry_id)return;this.bInited=true;CommentsLoader.entry_id=entry_id;this.is_facebook_checked=((HuffCookies.get('is_post_to_fb_checked')===null)?HPFB.maybeFacebookConnected():parseInt(HuffCookies.get('is_post_to_fb_checked'))&&HPFB.maybeFacebookConnected());this.is_yahoo_checked=((HuffCookies.get('is_post_to_yahoo_checked')===null)?HuffPrefs.get('yahoo'):parseInt(HuffCookies.get('is_post_to_yahoo_checked'))&&HuffPrefs.get('yahoo'));this.is_twitter_checked=((HuffCookies.get('is_post_to_twitter_checked')===null)?HuffPrefs.get('twitter'):parseInt(HuffCookies.get('is_post_to_twitter_checked'))&&HuffPrefs.get('twitter'));var all_modules=new Array();var main_module=$('comments_'+entry_id);if(!main_module)return;all_modules.push(main_module)
var sponsor_module=$('comments_'+entry_id+'_sponsor');if(sponsor_module)all_modules.push(sponsor_module);E.addListener(all_modules,'mousedown',function(e){var el=E.getTarget(e);if(Dom.hasClass(el,'fav_button_left')||Dom.hasClass(el,'button_mid')||Dom.hasClass(el,'button_right')||Dom.hasClass(el,'big_button_left')||Dom.hasClass(el,'big_button_mid')||Dom.hasClass(el,'big_button_right')||Dom.hasClass(el,'flag_button_left')||Dom.hasClass(el,'delete_button')||Dom.hasClass(el,'reply_button')){el=Dom.getAncestorByClassName(el,'comment_button');}
if(Dom.hasClass(el,'comment_button')&&!Dom.hasClass(el,'pressed')&&!Dom.hasClass(el,'disabled')){Dom.addClass(el,'pressed');E.stopPropagation(e);}});E.addListener(all_modules,'mouseup',function(e){var el=E.getTarget(e);if(Dom.hasClass(el,'fav_button_left')||Dom.hasClass(el,'button_mid')||Dom.hasClass(el,'button_right')||Dom.hasClass(el,'big_button_left')||Dom.hasClass(el,'big_button_mid')||Dom.hasClass(el,'big_button_right')||Dom.hasClass(el,'flag_button_left')||Dom.hasClass(el,'delete_button')||Dom.hasClass(el,'reply_button')){el=Dom.getAncestorByClassName(el,'comment_button');}
if(Dom.hasClass(el,'comment_button')&&Dom.hasClass(el,'pressed')){Dom.removeClass(el,'pressed');E.stopPropagation(e);}});E.addListener(all_modules,'keyup',function(e){var el=E.getTarget(e);if((el.nodeName=='TEXTAREA')&&(el.name=='text')){var suffix=el.id.replace(/comment_text/,'');var counter_el=$('words_counter'+suffix);var wordsCnt=Comments.countWords(el.value);counter_el.innerHTML=Comments.maxWords-wordsCnt;if(wordsCnt<=Comments.maxWords){if(Dom.hasClass(counter_el,'over')){Dom.removeClass(counter_el,'over');HuffPoUtil.hide('words_over_warning'+suffix);}}
else{if(!Dom.hasClass(counter_el,'over')){Dom.addClass(counter_el,'over');HuffPoUtil.show('words_over_warning'+suffix);}
$('words_over_warning_count'+suffix).innerHTML=Math.abs(Comments.maxWords-wordsCnt);}
E.stopPropagation(e);}});PunditsComments.init();if(!HuffCookies.getUserName()){Comments.trackSponsorComments('in_flow');}},countWords:function(text){var trimmed_text=String(text);trimmed_text=HuffPoUtil.trim(trimmed_text);if(trimmed_text.length){var words=trimmed_text.split(/[\s_\-*+&?\/\\]+|\S\.(?=\S)/);return words.length;}
return 0;},lengthOkay:function(el){var wordsCnt=this.countWords(el.value);if(wordsCnt>this.maxWords)
return(wordsCnt-this.maxWords);else if(wordsCnt==0)
return-1;else
return 0;},getInputArea:function(id){txt_el=false;if(typeof(nicEditor)=='undefined'){txt_el=$(id);if(txt_el.value==txt_el.defaultValue)txt_el.value='';else txt_el.value=txt_el.value.replace(/<\S[^>]*>/g,'');return txt_el;}else{var rich_el=nicEditors.findEditor(id);if(rich_el){txt_el=rich_el.e;txt_el.value=rich_el.getContent();return txt_el;}}
return txt_el;},setInputArea:function(id,value){if(typeof(nicEditor)=='undefined'){txt_el=$(id);if(txt_el)txt_el.value=value;}else{var rich_el=nicEditors.findEditor(id);if(rich_el)rich_el.setContent(value);}},alertEmpty:function(){alert("Your comment is empty. Please type a comment, then click POST again.");},alertTooLong:function(over){alert("Your comment is too long by "+over+" "+(over==1?'word':'words')+". The maximum length is "+this.maxWords+" words. Please edit your comment and click POST again.");},addComment:function(parent_id,module){if(!HuffCookies.getUserName())
{SNProject.happyJoin.cb=function(){Comments.addComment(parent_id);};SNProject.joinCheckingUserStatus();return;}
if(!this.is_post_completed)return;this.moduleSuffix=((module!='')?'_'+module:'');parent_id_txt=(parent_id?'_'+parent_id:'_root')+this.moduleSuffix;txt_el=this.getInputArea('comment_text'+parent_id_txt);var over=this.lengthOkay(txt_el);if(over==0){var suff=(!parent_id)?"root":parent_id;if($("post_to_twitter_"+suff+this.moduleSuffix).checked&&!(HuffPrefs.get("twitter"))&&!($("post_to_facebook_"+suff+this.moduleSuffix).checked))
{linkSocialAccount.checkLoginStatus('twitter');}
this.is_post_completed=false;Dom.setStyle(txt_el,'height','90px');HuffPoUtil.hide('comment_preview'+parent_id_txt);HuffPoUtil.show('comment_text_and_buttons'+parent_id_txt);HuffPoUtil.hide('post_button'+parent_id_txt);HuffPoUtil.show_inline('post_spinner'+parent_id_txt);YAHOO.util.Connect.setForm('comments_form'+parent_id_txt);var co=YAHOO.util.Connect.asyncRequest('POST','/commentsv3/postComment.php',this);}else if(over>0){this.alertTooLong(over);}else if(over<0){this.alertEmpty();}},deleteComment:function(entry_id,comment_id,parent_id){if(!confirm('Are you sure you want to delete this comment? All comments in response to it will also be deleted.'))return false;this.trackEvent('Delete');var delLinkEl=$('delete_comment_link_'+comment_id);delLinkEl.style.display='none';var co=YAHOO.util.Connect.asyncRequest('POST','/commentsv3/_deleteComment.php',{success:function(o){if(o.responseText.indexOf('success')>=0){var parentEl=$(parent_id?'comment_children_'+parent_id:'comments_inner_'+entry_id);var commentEl=$('comment_'+comment_id);var childrenEl=$('comment_children_'+comment_id);parentEl.removeChild(commentEl);parentEl.removeChild(childrenEl);}
else{delLinkEl.style.display='inline';alert(o.responseText);}},failure:function(o){delLinkEl.style.display='inline';alert('Internal server error. Please try later.');}},'entry_id='+entry_id+'&comment_id='+comment_id);return false;},scrollToComment:function(id){scrollToAnchor('comment_'+id+this.moduleSuffix)},scrollToParent:function(id){this.scrollToComment(id);HuffPoUtil.AnimRequestFinished(['comment_'+id],'#FFFF33','#F7F5F5');},success:function(o){splits=o.responseText.split(':::');new_html=splits[0];cmt_parent_id=parseInt(splits[1]);cmt_id=parseInt(splits[2]);cmt_entry_id=splits[3];this.added_comment_id=cmt_id;bShowReply=((this.moduleSuffix=='')||(this.moduleSuffix=='_sponsor'));var el=0;if(cmt_parent_id){this.trackEvent('Post','Reply');if(bShowReply)el=$('comment_children_'+cmt_parent_id+this.moduleSuffix);HuffPoUtil.show('post_button_'+cmt_parent_id+this.moduleSuffix);HuffPoUtil.hide('post_spinner_'+cmt_parent_id+this.moduleSuffix);if(bShowReply)HuffPoUtil.hide('comment_preview_'+cmt_parent_id+this.moduleSuffix);if(cmt_id){$('reply_ajax_for_'+cmt_parent_id+this.moduleSuffix).innerHTML='';HuffPoUtil.hide('reply_ajax_for_'+cmt_parent_id+this.moduleSuffix);if(el&&(bShowReply)){el.innerHTML=el.innerHTML+new_html;HuffPoUtil.AnimRequestFinished(['comment_'+cmt_id+this.moduleSuffix],'#FFFF33','#F2F2F5');}}
if(typeof LOTCC!='undefined')LOTCC.bcpw("act","reply");}else{this.trackEvent('Post','Comment');var el=$('comments_inner_'+cmt_entry_id);this.setInputArea('comment_text_root','');HuffPoUtil.show('post_button_root');if($('post_spinner_root'))Dom.setStyle('post_spinner_root','display','none');if(cmt_id){el.innerHTML=new_html+el.innerHTML;HuffPoUtil.AnimRequestFinished(['comment_'+cmt_id],'#FFFF33','#F2F2F5');}
HuffPoUtil.hide('comment_preview_root');if(typeof LOTCC!='undefined')LOTCC.bcpw("act","comment");}
this.is_post_completed=true;if(cmt_id&&SNProject)
{SNProject.track(cmt_id,'comment_comment',cmt_entry_id);}
var post_to_facebook=o.responseText.split(":::POST_COMMENT_TO_FACEBOOK:::");var post_to_twitter=o.responseText.split(":::POST_COMMENT_TO_TWITTER:::");var doFacebookPublish=(splits.length>6&&post_to_facebook.length>1);var doTwitterPublish=(splits.length>6&&post_to_twitter.length>1);var params={comment_to_facebook:doFacebookPublish,comment_to_twitter:doTwitterPublish};this.postCommentToNetworks(params,el,splits,post_to_twitter);if(cmt_id&&!doFacebookPublish&&!doTwitterPublish&&el)this.scrollToComment(cmt_id);HuffPoUtil.ImageLoader.foldCheck("comments_"+cmt_entry_id);if(!el&&bShowReply)
{location.href=location.href.replace(/(\?|#).*$/,'')+'?show_comment_id='+cmt_id+'#comment_'+cmt_id;return;}},postCommentToNetworks:function(params,el,splits,post_to_twitter)
{var doFacebookPublish=params.comment_to_facebook;var doTwitterPublish=params.comment_to_twitter;var twitter_func=function(){if(Comments.added_comment_id&&el)
Comments.scrollToComment(Comments.added_comment_id)};if(doTwitterPublish)
{var twitter_func=function()
{if(HuffPrefs.get("twitter"))
{var cb=function(){Modal.hideMask();if(Comments.added_comment_id&&el)
Comments.scrollToComment(Comments.added_comment_id);};var twitter_share_data=post_to_twitter[1].split(":::");var comment=twitter_share_data[0];var comment_url=twitter_share_data[1];Sharer.Twitter.share({tweet_text:comment,links:[{insert_type:"add_to_end",make_short:true,url:comment_url}],on_success_callback:cb});}
else
{var on_link_callback=function()
{var cb=function(){Modal.hideMask();if(Comments.added_comment_id&&el)
Comments.scrollToComment(Comments.added_comment_id);};var twitter_share_data=post_to_twitter[1].split(":::");var comment=twitter_share_data[0];var comment_url=twitter_share_data[1];Sharer.Twitter.share({tweet_text:comment,links:[{insert_type:"add_to_end",make_short:true,url:comment_url}],on_success_callback:cb});};if(PopupManager.popup_window)
{linkSocialAccount.onLinkSuccess=on_link_callback;}
else
{linkSocialAccount.checkLoginStatus('twitter',{onLinkSuccess:on_link_callback});}}};};var facebook_func=function()
{var feedData={"name":splits[7],"href":splits[9],"description":splits[10],"media":[{"type":"image","src":splits[11],"href":splits[9]}]};var feedMessage=splits[8];if(!this.is_facebook_id_saved)
{HPFB.ensureInit(function(){HPFB.waitForSession(function()
{var nFaceBookId=HPFB.session.uid;if(nFaceBookId){YAHOO.util.Connect.asyncRequest('POST','/commentsv3/_saveFacebookId.php',{success:function(){Comments.is_facebook_id_saved=true;}},'facebook_id='+nFaceBookId);HPFB.streamPublish(feedMessage,feedData,null,null,'Your comment is here',twitter_func);}});});}
else{if(!document.getElementById('fb_login_image')){HPFB.waitForSession(function()
{HPFB.streamPublish(feedMessage,feedData,null,null,'Your comment is here',twitter_func);});}
else if(Comments.added_comment_id&&el)Comments.scrollToComment(Comments.added_comment_id);}};if(doFacebookPublish)
{facebook_func();}
else if(doTwitterPublish)
{twitter_func();}
return;},failure:function(o)
{this.is_post_completed=true;},ShareComment:function(comment_id,txt,entry_link)
{entry_link=HPUtil.AddStringToQueryString(entry_link,'show_comment='+comment_id+'#comment_'+comment_id);var me=this,feedData={"name":"Please take a look! Interesting thing!","caption":'{*actor*} found following comment interesting: '+txt,"href":entry_link};HPFB.waitForSession(function()
{HPFB.streamPublish('',feedData);});},displayReplyBox:function(comment_id,entry_id,module){this.moduleSuffix=module?((module!='')?'_'+module:''):'';comment_id_txt=(comment_id?comment_id:'root');el=$('reply_ajax_for_'+comment_id_txt+this.moduleSuffix)||$('reply_ajax_for2_'+comment_id_txt);if(el.style.display=='block'){el.innerHTML='';HuffPoUtil.hide(el);return false;}
HuffPoUtil.show(el);el.innerHTML='<br /><p><img width="16" height="16" src="http://s.huffpost.com/images/v/spinner.gif" alt="loading" /> Loading...</p>';var co=YAHOO.util.Connect.asyncRequest('POST','/commentsv3/commentForm.php',ReplyBoxCallbacks,'entry_id='+entry_id+'&comment_id='+comment_id+'&module='+module+'&topic_name='+this.topicName+'&topic_dir='+this.topicDir+(this.is_fastnews_entry?"&fne=1":""));return false;},previewComment:function(comment_id,module){moduleSuffix=module?((module!='')?'_'+module:''):'';comment_id_txt=(comment_id?comment_id:'root')+moduleSuffix;comment_body=$('comment_preview_inner_'+comment_id_txt);body_text=this.getInputArea('comment_text_'+comment_id_txt).value;body_text=body_text.replace(/\w{20,}/,function(word){var chunk_len=10;var chunks_cnt=Math.ceil(word.length/chunk_len);var new_word='';for(var i=0;i<chunks_cnt;i++){new_word+=word.substr(i*chunk_len,chunk_len)+'<wbr/>';}
return new_word;});body_text=body_text.replace(/\r|\n/g,'<br \/>');comment_body.innerHTML=body_text;HuffPoUtil.hide('comment_text_and_buttons_'+comment_id_txt);HuffPoUtil.show('comment_preview_'+comment_id_txt);},previewEdit:function(comment_id,module){moduleSuffix=module?((module!='')?'_'+module:''):'';suffix=(comment_id?comment_id:'root')+moduleSuffix;Dom.setStyle('comment_text_'+suffix,'height','280px');HuffPoUtil.hide('comment_preview_'+suffix);HuffPoUtil.show('comment_text_and_buttons_'+suffix);$('comment_text_'+suffix).focus();},previewCancel:function(comment_id,module){moduleSuffix=module?((module!='')?'_'+module:''):'';suffix=(comment_id?comment_id:'root')+moduleSuffix;Dom.setStyle('comment_text_'+suffix,'height','90px');HuffPoUtil.hide(comment_id?'reply_ajax_for_'+suffix:'comment_preview_'+suffix);HuffPoUtil.show('comment_text_and_buttons_'+suffix);this.setInputArea('comment_text_'+suffix,'');var counter_el=$('words_counter_'+suffix);if(Dom.hasClass(counter_el,'over'))Dom.removeClass(counter_el,'over');counter_el.innerHTML='';HuffPoUtil.hide('words_over_warning_'+suffix);$('comment_text_'+suffix).focus();},flagComment:function(comment_id,entry_id,blog_id,module){var moduleSuffix=module?((module!='')?'_'+module:''):'';var button_text=$('flag_'+comment_id+moduleSuffix);if(button_text.innerHTML.indexOf('Flagged')==-1){this.trackEvent('Flag');YAHOO.util.Connect.asyncRequest('GET','/include/flagComment.php?type=abuse&blog_id='+blog_id+'&cmt_id='+comment_id+'&entry_id='+entry_id,{success:function(o){result=parseInt(o.responseText);if(!isNaN(result)){if(result<0){button_text.innerHTML='Already Flagged ('+(-result)+')';}
else{button_text.innerHTML='Flagged ('+result+')';}}},failure:function(o)
{HPError.throwError('flagComment ajax error');}});}},favComment:function(comment_id,entry_id,blog_id,module){var moduleSuffix=module?((module!='')?'_'+module:''):'';var isShortened=(module=='sponsor');var button_text=$('best_'+comment_id+moduleSuffix);if((button_text.innerHTML.indexOf('Marked')==-1)&&(button_text.innerHTML.indexOf('Favorited')==-1)){this.trackEvent('Favorite');YAHOO.util.Connect.asyncRequest('GET','/include/flagComment.php?type=best&blog_id='+blog_id+'&cmt_id='+comment_id+'&entry_id='+entry_id,{success:function(o){result=parseInt(o.responseText);if(!isNaN(result)){if(result<0){button_text.innerHTML=(isShortened?'Already Favorited':'Already Marked as Favorite')+' ('+(-result)+')';}
else{button_text.innerHTML=(isShortened?'Favorited':'Marked as Favorite')+' ('+result+')';}
SNProject.track(comment_id,'comment_favored',entry_id);}},failure:function(o)
{HPError.throwError('flagComment ajax error');}});}},onFacebookConnect:function(fb_container_id){if(this.is_facebook_id_saved)return;var newHTML='<table border="0"><tr>'
+'<td>Facebook account: </td>'
+'<td><fb:name uid="loggedinuser" useyou="false" linked="false" /></td>'
+'<td><fb:profile-pic uid="loggedinuser" facebook-logo="true" size="square" linked="false" ></fb:profile-pic></td>'
+'</tr></table>';fb_container_el=$(fb_container_id);if(fb_container_el)fb_container_el.innerHTML=newHTML;fb_root_container_el=$('facebook_data_root');if(fb_root_container_el)fb_root_container_el.innerHTML=newHTML;HPFB.ensureInit(function(){FB.XFBML.parse();if(!HPFB.session)
return false;var nFaceBookId=HPFB.session.uid;if(nFaceBookId){YAHOO.util.Connect.asyncRequest('POST','/commentsv3/_saveFacebookId.php',{success:function(){Comments.is_facebook_id_saved=true;}},'facebook_id='+nFaceBookId);}});},onFacebookPledge:function(pledgeId,pledgeText,pledgeLink,callback){if(!this.is_post_completed)return;this.is_post_completed=false;var feedData={"name":'Take the pledge',"href":location.href,"caption":'{*actor*} '+pledgeText};HPFB.waitForSession(function()
{HPFB.streamPublish('',feedData,null,null,null,callback);});YAHOO.util.Connect.asyncRequest('GET','/commentsv3/fb_pledge_gateway.html?user_joined=1&id='+pledgeId,{success:function(o){Comments.is_post_completed=true;},failure:function(o){Comments.is_post_completed=true;}});},onFacebookVote:function(voteText,permalink,title,callback,img_obj,preview_html){if(!this.is_post_completed)return;this.is_post_completed=false;var feedData={"name":title,"caption":'{*actor*} '+voteText,"href":permalink};HPFB.waitForSession(function()
{HPFB.streamPublish('',feedData,null,null,'Your comment is here',function(post_id,ex){Comments.is_post_completed=true;callback();});});},onFacebookChecked:function(parent_id,module){var moduleSuffix=module?((module!='')?'_'+module:''):'';var suffix=(!parent_id?'root':parent_id)+moduleSuffix;var checkBoxEl=$('post_to_facebook_'+suffix);$('facebook_data_'+suffix).style.display=(checkBoxEl.checked?'block':'none');this.is_facebook_checked=checkBoxEl.checked;if(parent_id){$('facebook_data_root').style.display=(checkBoxEl.checked?'block':'none');$('post_to_facebook_root').checked=checkBoxEl.checked;}
if(HPFB.maybeFacebookConnected()){HuffCookies.set('is_post_to_fb_checked',checkBoxEl.checked?1:0,365*24);}},onYahooChecked:function(parent_id,module){var moduleSuffix=module?((module!='')?'_'+module:''):'';var suffix=(!parent_id?'root':parent_id)+moduleSuffix;var checkBoxEl=$('post_to_yahoo_'+suffix);this.is_yahoo_checked=checkBoxEl.checked;if(parent_id){$('post_to_yahoo_root').checked=checkBoxEl.checked;}
if(HuffPrefs.get('yahoo')){HuffCookies.set('is_post_to_yahoo_checked',checkBoxEl.checked?1:0,365*24);}},onTwitterChecked:function(parent_id,module){var moduleSuffix=module?((module!='')?'_'+module:''):'';var suffix=(!parent_id?'root':parent_id)+moduleSuffix;var checkBoxEl=$('post_to_twitter_'+suffix);this.is_twitter_checked=checkBoxEl.checked;if(parent_id){$('post_to_twitter_root').checked=checkBoxEl.checked;}
if(HuffPrefs.get('twitter')){HuffCookies.set('is_post_to_twitter_checked',checkBoxEl.checked?1:0,365*24);}},removeFan:function(userId,fanId){if(!userId||!fanId)return;if(!confirm("Are you sure you want to remove this relationship?"))return;this.trackEvent('Unfan');YAHOO.util.Connect.asyncRequest('GET','/commentsv3/_removeFan.php?user_id='+userId+'&fan_id='+fanId+(this.is_fastnews_entry?"&fne=1":""),{success:function(o){result=o.responseText.split(':::');if(o.responseText.indexOf('success')>=0){var unfan_divs=Dom.getElementsByClassName('unfan','div');if(unfan_divs.length){for(var i=0,len=unfan_divs.length;i<len;i++){var splitted_id=unfan_divs[i].id.split('_');if(splitted_id[1]!=fanId)continue;Dom.setStyle(unfan_divs[i].id,'display','none');}}
var fan_divs=Dom.getElementsByClassName('becomefan','div');if(fan_divs.length){for(var i=0,len=fan_divs.length;i<len;i++){var splitted_id=fan_divs[i].id.split('_');if(splitted_id[1]!=fanId)continue;Dom.setStyle(fan_divs[i].id,'display','block');}}}
else if(result[0]=='error'){HPError.throwError('removeFan error: '+result[1]);}
else{HPError.throwError('removeFan error');}},failure:function(o)
{HPError.throwError('removeFan ajax error');}});},trackEvent:function(action,label)
{HPTrack.trackEvent('Comments',action,label);},trackSponsorComments:function(scope)
{var els=Dom.getElementsByClassName("comment_sponsor_title","div","comments_inner_"+CommentsLoader.entry_id+((scope=='breakout')?'_sponsor':''),function(el,params){var split=el.lastChild.innerHTML.split('|');if(split.length){var url='/t/a/sponsor/comments/'+split[0]+'/impressions/'+split[1]+'/'+split[2]+'/'+params.comment_scope;HPTrack.trackPageview(url);var cc=Dom.get('comment_children_'+split[2]);if(cc&&cc.childNodes.length>1){HPTrack.trackPageview('/t/a/sponsor/comments/'+split[0]+'/replies/'+split[1]+'/'+split[2]+'/'+params.comment_scope);}}},{comment_scope:scope});},linkProvider:function(provider,suffix)
{if(provider=="twitter")
{var cb=function(){var html="<table border='0'><tr><td class=\"post_to_provider_image\"><img src=\""+linkSocialAccount.twitterInfo.profile_image+"\" /></td><td class=\"post_to_provider_name\">"+linkSocialAccount.twitterInfo.screen_name+"</td></tr></table>";$('twitter_data'+suffix).innerHTML=html;$('twitter_data_root').innerHTML=html;};}
linkSocialAccount.checkLoginStatus(provider,{onLinkSuccess:cb});return;}};var PunditsComments={aIds:[],oPaginator:null,init:function(){if(!$('hp_pundits_comments')||!$('hp_pundits_comments_ids'))return;this.aIds=$('hp_pundits_comments_ids').innerHTML.split(',');if(!this.aIds.length)return;E.purgeElement('hp_pundits_comments_previous_arrow');E.purgeElement('hp_pundits_comments_next_arrow');this.oPaginator=new CommonPaginator({'moduleName':'pundits_comments','maxPage':this.aIds.length,'is_circle':false,'is_ajax_update':true,'create_page_ajax_url':function(page){return PunditsComments.getAjaxUrl(page);}});},getAjaxUrl:function(page){if(page>this.aIds.length)return false;var comment_id=parseInt(this.aIds[page-1]);url='/commentsv3/ajax/_pundits_comments.php?entry_id='+entry_id+'&comment_id='+comment_id+'&page='+page
+(CommentsLoader.is_fastnews_entry?'&fne=1':'')
+(CommentsLoader.showBadges?'&levels=1':'')
+(CommentsLoader.showPundits?'&pundits_on=1':'')
return url;},closeModule:function(entry_id){YAHOO.util.Connect.asyncRequest('GET','/commentsv3/_disableFromPunditsModule.php?entry_id='+entry_id,{success:function(o){HuffPoUtil.hide('pundits_comments');}});}};var SponsorComments={entry_id:0,parent_id:0,completed:true,load:function(entry_id,page,parent_id){var el=$('comments_'+entry_id+'_sponsor');if(!el)return;if(!this.completed)return;this.completed=false;this.entry_id=entry_id;this.parent_id=parent_id;YAHOO.util.Connect.asyncRequest('GET','/commentsv3/ajax/_sponsor_comments.php?entry_id='+entry_id+'&page='+page+'&comment_id='+parent_id
+(CommentsLoader.is_fastnews_entry?'&fne=1':'')
+(CommentsLoader.showBadges?'&levels=1':''),this);},success:function(o){if(o.responseText.length){if(this.parent_id){HuffPoUtil.hide('load_branch_link_'+this.parent_id+'_sponsor');$('comment_children_'+this.parent_id+'_sponsor').innerHTML+=o.responseText;}
else{$('comments_'+this.entry_id+'_sponsor').innerHTML=o.responseText;HuffPoUtil.show('comments_'+this.entry_id+'_sponsor');}
HuffPoUtil.ImageLoader.foldCheck('comments_'+this.entry_id+'_sponsor');}
this.completed=true;Comments.trackSponsorComments('breakout');},failure:function(o)
{this.completed=true;HPError.throwError('sponsor comments ajax error');}};var Blogger={select_el:0,refresh_el:0,is_completed:true,getBlogList:function(comment_parent_id,api){if(!this.is_completed)return;parent_id_txt=(comment_parent_id?'_'+comment_parent_id:'_root');var name_el=$(api+'_name'+parent_id_txt);var pass_el=$(api+'_password'+parent_id_txt);if(!name_el||!name_el.value.length||!pass_el||!pass_el.value.length){alert(api+' username or password not set');return;}
var host_el=$(api+'_host'+parent_id_txt);if(host_el&&!host_el.value.length){alert(api+' hostname not set');return;}
this.is_completed=false;this.select_el=$(api+'_titles'+parent_id_txt);this.refresh_el=$(api+'_refresh_link'+parent_id_txt);if(this.refresh_el)this.refresh_el.innerHTML='<img border="0" width="16" height="16" src="http://s.huffpost.com/images/v/spinner.gif" alt="loading" />';YAHOO.util.Connect.setForm('comments_form'+parent_id_txt);var co=YAHOO.util.Connect.asyncRequest('POST','/commentsv3/'+api+'BlogList.php',this);},success:function(o){if(this.select_el){var aResult=null;eval('aResult = '+o.responseText);if(aResult.bIsError){if(this.refresh_el)this.refresh_el.innerHTML='refresh list';alert('Error: '+aResult.sErrorMessage);}
else{for(var i=0;i<aResult.aOptions.length;i++){var options=this.select_el.options;options[options.length]=new Option(aResult.aOptions[i].title,aResult.aOptions[i].value);}
if(this.refresh_el)Dom.setStyle(this.refresh_el,'display','none');}}
this.is_completed=true;},failure:function(o)
{this.is_completed=true;if(this.refresh_el)this.refresh_el.innerHTML='refresh list';}};var ReplyBoxCallbacks={success:function(o){var splits=o.responseText.split(':::');var new_html=splits[0];var comment_id=parseInt(splits[1]);comment_id_txt=(comment_id?comment_id:'root');var el=$('reply_ajax_for_'+comment_id_txt+Comments.moduleSuffix)||$('reply_ajax_for2_'+comment_id_txt);if(new_html=='login'){ConnectOverview.showBenefits({provider:'signup'});el.innerHTML='';}
else{el.innerHTML=new_html;ReplyBoxCallbacks.showYahooBox(comment_id_txt);ReplyBoxCallbacks.renderFbNamePic(comment_id_txt);if(typeof(init_comment_textareas)!='undefined')init_comment_textareas();}},renderFbNamePic:function(comment_id_txt){if($('field_fb_name'+Comments.moduleSuffix)&&$('field_fb_ppic'+Comments.moduleSuffix))
{if(HuffCookies.getUserName()||HPFB.maybeFacebookConnected())
{var ppic=HuffCookies.getBigAvatar();var uname=HuffCookies.getUserName().replace(/[\+_]/g,' ');if(/facebook/.test(ppic))
{$('field_fb_name'+Comments.moduleSuffix).innerHTML=uname;$('field_fb_ppic'+Comments.moduleSuffix).innerHTML='<img src="'+ppic+'" />';}}
if($('field_fb_name'+Comments.moduleSuffix).innerHTML.length==0&&$('field_fb_ppic'+Comments.moduleSuffix).innerHTML.length==0)
{$('field_fb_name'+Comments.moduleSuffix).innerHTML='<fb:name uid="loggedinuser" useyou="false" linked="false"/>';$('field_fb_ppic'+Comments.moduleSuffix).innerHTML='<fb:profile-pic uid="loggedinuser" facebook-logo="true" size="square" linked="false" >';}}
if(Comments.is_facebook_checked){var checkBox=$('post_to_facebook_'+comment_id_txt+Comments.moduleSuffix);if(checkBox)checkBox.checked=true;var fbDiv=$('facebook_data_'+comment_id_txt+Comments.moduleSuffix);if(fbDiv)fbDiv.style.display='block';}
if($('field_fb_name'+Comments.moduleSuffix)&&$('field_fb_ppic'+Comments.moduleSuffix))
{FB.XFBML.parse();}},showYahooBox:function(comment_id_txt){if(HuffPrefs.get('yahoo')){var el=$('post_to_yahoo_box_'+comment_id_txt+Comments.moduleSuffix);if(el)el.style.display='block';el=$('post_to_yahoo_'+comment_id_txt+Comments.moduleSuffix);if(el)el.checked=Comments.is_yahoo_checked;}}
};var scrollInt;var scrTime,scrSt,scrDist,scrDur,scrInt;function scrollPage(){scrTime+=scrInt;if(scrTime<scrDur){window.scrollTo(0,easeInOut(scrTime,scrSt,scrDist,scrDur));}else{window.scrollTo(0,scrSt+scrDist);clearInterval(scrollInt);}}
function scrollToAnchor(aname){var anchors,i,ele;if(!document.getElementById)
return;anchors=document.getElementsByTagName("div");for(i=0;i<anchors.length;i++){if(anchors[i].id==aname){ele=anchors[i];i=anchors.length;}}
if(!ele)return;if(window.scrollY)
scrSt=window.scrollY;else if(document.documentElement.scrollTop)
scrSt=document.documentElement.scrollTop;else
scrSt=document.body.scrollTop;scrDist=ele.offsetTop-scrSt;scrDur=100;scrTime=0;scrInt=10;clearInterval(scrollInt);scrollInt=setInterval(scrollPage,scrInt);}
function easeInOut(t,b,c,d){return c/2*(1-Math.cos(Math.PI*t/d))+b;}

/* From: wfe3-nyc : 20212 */