var outbrain_nm_version="5.2.0",outbrain_nm_template_object=typeof outbrain_nm_template_object=="function"?outbrain_nm_template_object:function(o,p,q,r,s){var i=this;outbrain_nm_template_object.baseConstructor.call(this,o,p,q,r,s);outbrain_template_manager.isAdMarking=true;this.imagesPreload=function(){};this.adUlElementId="outbrain_nm_ad_ul";this.adUlClassNM="outbrain_nm_ad_ul_class";this.regUlClassNM="outbrain_nm_reg_ul_class";this.isAdRecOnTop=typeof OB_adMarkingOnTop=="boolean"?OB_adMarkingOnTop:
true;this.buildDomAdRecommendation=function(a){return'  \t<ul id="'+this.adUlElementId+'_$INDEX_$POSITION" class="'+this.adUlClassNM+" "+a+'" style="display:none;">  \t</ul>'};this.buildDomRecommendations=function(){var a='<fieldset style="display:none;$FIELDSET_STYLE" id="$FIELDSET_ID_$INDEX_$POSITION" class="$FIELDSET_CLASS" >      <div id="$RECOMMENDATIONS_WAIT_ID_outer_$INDEX" class="$RECOMMENDATIONS_WAIT_CLASS_outer" style="display:none;"><div class="$RECOMMENDATIONS_WAIT_CLASS_inner">               <p><img style="border:0px !important"/></p>       </div></div>  <legend class="$RECOMMENDATIONS_LEGEND_CLASS"></legend>';
if(this.isAdRecOnTop==true)a+=this.buildDomAdRecommendation("outbrain_ul_ad_top");a+='  \t<ul id="$RECOMMENDATIONS_UL_ID_$INDEX_$POSITION" class="'+this.regUlClassNM+' $RECOMMENDATIONS_UL_CLASS" style="display:none">  \t</ul>';if(this.isAdRecOnTop!=true)a+=this.buildDomAdRecommendation("outbrain_ul_ad_top");a+='</fieldset><table id="$RECOMMENDATIONS_STATUS_ID_$INDEX_$POSITION" class="$RECOMMENDATIONS_STATUS_TABLE_CLASS" style="display:none;"><tr><td>\t<div id="$RECOMMENDATIONS_PC_LEGEND_$INDEX_$POSITION" class="$RECOMMENDATIONS_PC_LEGENED_CLS" style="display:none;"></div></td><td>\t<div id="$RECOMMENDATIONS_MORE_DIV_ID_$INDEX_$POSITION" class="$RECOMMENDATIONS_MORE_LINK_DIV_CLASS" style="display:none;"></div></td></tr></table>';
return a};this.showRecommendations=function(a,c){var b=c.recTitle,d=c.jsonObj;b=this.changeStarsTextToImage(b,c.rankInfo.vote,true);if(!this.all_user_elements[this.positionRec])return false;if(this.recommendationsShowBefore(a))this.recommendationsLegendUpdate(a,b);else{c=this.getElementWithFullName(this.constants.recommendationsUlId,a);var f=this.getElementWithFullName(this.adUlElementId,a);this.recommendationsLegendUpdate(a,b);b=outbrain_template_manager.getRecommendationsPerDoc(outbrain_template_manager.DATA_REC_AD_ONLY,
d.response.documents.doc,null,null);var e=outbrain_template_manager.getRecommendationsPerDoc(outbrain_template_manager.DATA_REC_REGULAR_ONLY,d.response.documents.doc,null,null),h=outbrain_template_manager.isAllSameSource(d.response.documents),g=e.length,l=b.length,m=outbrain_settings.rater.recommendations.defaultRecNumber,n=g-(m<=g?m:g),t=c&&typeof c.opened=="boolean"&&c.opened==true;typeof OB_user_mode=="number"&&OB_user_mode==1&&this.clearRecommendations(a,n);for(var k=0;k<l;k++){var u=this.getCampType(a,
d.response.documents);this.renderTitleAdRecommendation(a,f,k,d,g>0,u);this.renderOneRecommendation(a,f,b[k],j,h,true);if(f)f.style.display="block"}if(l==0&&g>0)OB_voterWidgetObjArray[a].SecLineOn=false;for(var j=0;j<g;j++){this.renderTitleRegRecommendation(a,c,j,d,l>0);this.renderOneRecommendation(a,c,e[j],j,h,j<m?true:false);if(c)c.style.display="block"}n>0&&this.checkIfMoreRecs(a,n,t);this.showHideRecsElements(a,d);this.enableBlogExternalElements(a);this.checkBottomTableWrapper(a)}};this.renderTitleAdRecommendation=
function(a,c,b,d,f,e){if(b==0){b=document.createElement("li");b.className="outbrain_ad_title_li";var h='<a class="outbrain_ad_title_A" href="javascript:void(0)" onClick="javascript:'+this.callForToolTip("this")+'" onmouseout="javascript:this.className=\'outbrain_ad_title_A\'" onmouseover="javascript:this.className=\'\'">$AD_TEXT</a>';d=this.getpcName(a,d.response.documents);var g="";g=e!=null&&e==2&&typeof outbrain_language_manager.getPiLegendText=="function"?outbrain_language_manager.getPiLegendText(i.languageName,
d)+":":outbrain_language_manager.getPcLegendText(i.languageName,d)+":";h=h.replace(/\$AD_TEXT/g,g);b.innerHTML=h;c&&c.appendChild(b);if(!f){if(c=this.getElementWithFullName(this.adUlElementId,a))c.className="outbrain_nm_ad_no_reg_ul_class";this.removeLegend(a)}}};this.renderTitleRegRecommendation=function(a,c,b,d,f){if(b==0){b=document.createElement("li");b.className="outbrain_reg_title_li";this.callForToolTip("this");var e="$AD_TEXT";this.getpcName(a,d.response.documents);d=outbrain_language_manager.languages_list[i.languageName].MIGHT_ALSO_LIKE+
":";if(f){e=e.replace(/\$AD_TEXT/g,d);b.innerHTML=e;c&&c.appendChild(b);this.removeLegend(a)}else{if(currElement=this.getElementWithFullName(this.constants.fieldsetId,a)){currElement.style.paddingLeft="8px";currElement.style.paddingright="8px"}this.getElementWithFullName(this.constants.recommendationsUlId,a).className="outbrain_nm_no_ad_ul_class"}}};this.removeLegend=function(a){if(a=this.getElementWithFullName(this.constants.fieldsetId,a)){var c=a.getElementsByTagName("legend")[0];c&&a.removeChild(c)}};
this.toggleMoreRecommendations=function(a){var c=this.getElementWithFullName(this.constants.recommendationsMoreDivId,a).getElementsByTagName("a")[0],b=outbrain_template_manager.isDocGotAds(a)?1:0,d=this.getElementWithFullName(this.constants.recommendationsUlId,a),f=d.getElementsByTagName("li"),e=f?f.length:0,h=e>0?e-b:0;this.getElementWithFullName(this.adUlElementId,a).getElementsByTagName("li");var g=outbrain_settings.rater.recommendations.defaultRecNumber;if(typeof d.opened=="boolean"&&d.opened){for(b=
g+b;b<e;b++)f[b].style.display="none";d.opened=false;i.dom.setInnerHTML(c,outbrain_language_manager.getMoreRecommendedLinkText(i.languageName,h-g));this.pcVisibilty(a,"none")}else{c.onclick=function(){i.toggleMoreRecommendations(a)};for(b=0;b<e;b++)f[b].style.display="";d.opened=true;i.dom.setInnerHTML(c,outbrain_language_manager.getMoreRecommendedCloseLinkTest(i.languageName,h-g));this.pcVisibilty(a,"block")}this.checkBottomTableWrapper(a)};this.createLinkOfPC=function(){return""};this.resetTemplate=
function(a){if(typeof OB_user_mode=="number"&&OB_user_mode==1){if(currElement=this.getElementWithFullName(this.adUlElementId,a))currElement.style.display="none";if(currElement=this.getElementWithFullName(this.constants.fieldsetId,a))currElement.style.display="none";if(currElement=this.getElementWithFullName(this.constants.recommendationsPcLegendId,a))currElement.style.display="none"}};this.clearRecommendations=function(a,c){var b=this.getElementWithFullName(this.adUlElementId,a);if(b!=null)b.innerHTML=
"";b=this.getElementWithFullName(this.constants.recommendationsUlId,a);if(b!=null)b.innerHTML="";a=this.getElementWithFullName(this.constants.recommendationsMoreDivId,a);if(a!=null&&c<1)a.innerHTML=""};this.showBalloon=false;this.constants.fieldsetStyle=outbrain_browsers.ie?"padding-left:0px;padding-right:0px;":"padding-left:0px;padding-right:0px;"};outbrain_nm_template_object.prototype=outbrain_template_object;outbrain_nm_template_object.prototype.constructor=outbrain_nm_template_object;
outbrain_nm_template_object.baseConstructor=outbrain_template_object;outbrain_template_manager.addTemplate([["nm_template",outbrain_nm_template_object]]);
