News={allArticlesViewed:false,adWait:true,init:function(a){News.container=$("news-articles");Event.observe(News.container,"click",Event.delegate({".article-toggle":function(d){var c=Event.element(d);if(c&&c.id&&c.hasClassName("article-toggle")){Event.stop(d);var b=News.parseItem(c);if(b.el){News.toggleItems(b.link,b.el,b.id)
}}},"a.bbcode-home-link":function(b){Event.stop(b);HabbletLoader.openLink(Event.element(b))},"a.bbcode-home-link *":function(b){Event.stop(b);HabbletLoader.openLink(Event.element(b))},"a.bbcode-group-link":function(b){Event.stop(b);HabbletLoader.openLink(Event.element(b))},"a.bbcode-group-link *":function(b){Event.stop(b);
HabbletLoader.openLink(Event.element(b))},"a.bbcode-url-link":function(b){Event.stop(b);HabbletLoader.openLink(Event.element(b))},"a.bbcode-url-link *":function(b){Event.stop(b);HabbletLoader.openLink(Event.element(b))},"a.article-link":function(b){Event.stop(b);HabbletLoader.openLink(Event.element(b))
}}));Event.observe("news-articles","scroll",function(b){var c=Event.element(b);if(c.scrollTop+c.offsetHeight==c.scrollHeight){if(!News.allArticlesViewed){News.allArticlesViewed=true;FlashExternalInterface.legacyTrack("habblet","news","all_articles_viewed")}}});if(a){News.adWaitTimeout=window.setTimeout(News.showArticleListWithoutAd,5000)
}else{News.showArticleListWithoutAd()}},showArticleListWithoutAd:function(){News.adWait=false;if(!!$("news-ad")){$("news-ad").hide()}if(!!$("news-articlelist")){$("news-articlelist").style.display="block"}},parseItem:function(b){var c=b.id.split("-").last();var a=$("article-body-text-"+c);return{link:b,el:a,id:c}
},toggleItems:function(c,b,d){var a=this.openedItem;if(a){$("article-title-"+a.id).removeClassName("selected");a.el.hide();this.openedItem=null;$("article-title-"+a.id).innerHTML=L10N.get("news.promo.readmore")}if(!a||(a&&a.id!=d)){$("article-title-"+d).addClassName("selected");b.show();this.openedItem={link:c,el:b,id:d};
$("article-title-"+d).innerHTML=L10N.get("news.promo.close")}},checkAd:function(){if(News.adWait){window.clearTimeout(News.adWaitTimeout)}var a;if($("iframe-news-ad").contentDocument){a=News.getIFrameYScroll($("iframe-news-ad").contentDocument)}else{a=News.getIFrameYScroll(document.frames["iframe-news-ad"].document)
}if(a>50){$("ad-message-text").style.display="block";$("iframe-news-ad").height=250}else{$("news-ad").hide()}$("news-articlelist").style.display="block"},getIFrameYScroll:function(b){var a;if(b.innerHeight&&b.scrollMaxY){a=b.innerHeight+b.scrollMaxY}else{if(b.body.scrollHeight>b.body.offsetHeight){a=b.body.scrollHeight
}else{a=b.body.offsetHeight}}return a}};__news__defined__=true;