var outbrain_nm_version="4.4.5",outbrain_nm_template_object=typeof outbrain_nm_template_object=="function"?outbrain_nm_template_object:function(q,r,s,t,u){var i=this;outbrain_nm_template_object.baseConstructor.call(this,q,r,s,t,u);outbrain_template_manager.isAdMarking=true;this.closeInTooltip="<div class='outbrain_tooltip_close' style='float:right;'><img alt='Close' width='13' height='13' src='"+outbrain_settings.domains.js+"spacer.gif' onclick='javascript:UnTip()' style='background-image:url(http://widgets.outbrain.com/close-frame.gif);background-repeat:no-repeat;background-position:0px 0px;cursor: pointer;'  /></div>";
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.buildDomMainWrapperStart=function(){return str='<div id="$CONTAINER_DIV_ID_$INDEX_$POSITION" class="$GLOBAL_CLASS" style="margin:10px 0 5px;$DIV_WRAPPER_STYLE" >$upperBR<div class="$VOTER_DIV_CLASS" style="display:none;"  id="$VOTER_DIV_NAME_$INDEX_$POSITION"  >'};this.buildDomAdRecommendation=
function(a){return'  \t<ul id="'+this.adUlElementId+'_$INDEX_$POSITION" class="'+this.adUlClassNM+" "+a+'" style="display:none;margin:0.4em 0 0 0;padding-bottom:3px !important;padding-top:3px !important;padding-left:0px !important;padding-right:0px;border-top:1px dashed #999999;border-bottom:1px dashed #999999;">  \t</ul>'};this.buildDomRecommendations=function(){var a='<fieldset style="display:none;margin-bottom:0.48em;border:1px solid #999999 !important;$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 style="color:#999999;font-size:90%;" 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;margin:0.4em 0 0 0;padding-left:0px !important">  \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.createRecommendationLi=function(a,c,b,d,f,e,j,g,l,m,k){var o=outbrain_settings.rater.recommendations.displaySameSiteTitle,h=document.createElement("li");h.className=l?this.constants.recommendationAdsLiClass:this.constants.recommendationLiClass;h.style.display=k?"":"none";h.style.listStyleType="none";h.style.listStylePosition="outside";h.style.margin="0px 8px";h.style.paddingBottom="6px";k=typeof outbrain_settings.rater.recommendations.selfPost=="boolean"&&outbrain_settings.rater.recommendations.selfPost==
true;e="_blank";if(typeof outbrain_settings.rater.recommendations.openNewTab=="boolean"&&!outbrain_settings.rater.recommendations.openNewTab)e="_self";if(b&&o)j='<span style="font-weight:'+(!k&&g?"normal":"bold")+';">'+outbrain_language_manager.getThisSiteString(i.languageName)+"</span>";if(b&&!l)e="_self";o=l&&this.showBalloon?this.createInfoIcon(16,16,"ob_bigInfo_off","ob_bigInfo_on",true,true)+" ":"";k="true";if(typeof m=="string"&&m.length>0&&typeof OB_user_mode=="number"&&OB_user_mode==1)k="outbrain_template_manager.templates["+
i.templateIndex+"].checkWaitStatus()";var p="";if(l&&typeof OB_add_nofollow=="string"&&(OB_add_nofollow==outbrain_settings.rater.recommendations.rel.REL_ALL||OB_add_nofollow==outbrain_settings.rater.recommendations.rel.REL_ADS))p="rel='nofollow'";if(!l&&typeof OB_add_nofollow=="string"&&(OB_add_nofollow==outbrain_settings.rater.recommendations.rel.REL_ALL||OB_add_nofollow==outbrain_settings.rater.recommendations.rel.REL_ORGANIC))p="rel='nofollow'";d=""+o+"<a "+p+' class="rec-link" target="'+e+'" href="'+
d+'" onClick="javascript:return('+k+')">'+f+"</a>";if(!g||typeof OB_same_source_visible=="boolean"&&OB_same_source_visible==true)d+=i.buildLocationString(j,b);if(typeof m=="string"&&m.length>0&&typeof OB_user_mode=="number"&&OB_user_mode==1)d+=i.renderRecCancelation(a,c,m);h.innerHTML=d;return h};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),j=outbrain_template_manager.isAllSameSource(d.response.documents),
g=e.length,l=b.length,m=outbrain_settings.rater.recommendations.defaultRecNumber,k=g-(m<=g?m:g),o=c&&typeof c.opened=="boolean"&&c.opened==true;typeof OB_user_mode=="number"&&OB_user_mode==1&&this.clearRecommendations(a,k);for(var h=0;h<l;h++){var p=this.getCampType(a,d.response.documents);this.renderTitleAdRecommendation(a,f,h,d,g>0,p);this.renderOneRecommendation(a,f,b[h],n,j,true);if(f)f.style.display="block"}if(l==0&&g>0)OB_voterWidgetObjArray[a].SecLineOn=false;for(var n=0;n<g;n++){this.renderTitleRegRecommendation(a,
c,n,d,l>0);this.renderOneRecommendation(a,c,e[n],n,j,n<m?true:false);if(c)c.style.display="block"}k>0&&this.checkIfMoreRecs(a,k,o);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";b.style.listStyleType="none";b.style.listStylePosition="outside";b.style.margin="0px 8px";b.style.paddingBottom="4px";b.style.backgroundImage=
"none";outbrain_rater.loadToolTip();var j='<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=''\" style='color: #999999;font-size:0.9em'>$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)+":";j=j.replace(/\$AD_TEXT/g,g);b.innerHTML=j;c&&c.appendChild(b);if(!f){if(f=this.getElementWithFullName(this.adUlElementId,a)){f.className="outbrain_nm_ad_no_reg_ul_class";c.style.borderBottom="0";c.style.borderTop="0"}this.removeLegend(a)}}};this.renderTitleRegRecommendation=function(a,c,b,d,f){if(b==0){b=document.createElement("li");b.className="outbrain_reg_title_li";b.style.listStyleType="none";b.style.listStylePosition="outside";
b.style.margin="0px 8px";b.style.paddingBottom="4px";this.callForToolTip("this");var e="<span style='color: #999999;font-size:0.9em'>$AD_TEXT</span>";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,j=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,j-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,j-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([["general",outbrain_template_object],["nm_template",outbrain_nm_template_object]]);
