var NewsDetails={settings:{},init:function(n){var t=$("#newsOptions").data("marker");$.extend(this.settings,n),$.extend(this.settings,t)},initializeHandler:function(){var t=this,n;for(this.settings.showNews=0,n=0;n<this.settings.moreNews.length;n++)$('<img src="'+this.settings.moreNews[n].imageUrl+'" />').appendTo("body").css("display","none");this.settings.isAuthenticated||$(".locked-hitarea").popover({trigger:"manual",animation:!1,html:!0,placement:"top",container:"body",template:'<div class="popover" onmouseover="$(this).mouseleave(function() {$(this).hide(); });"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"></div><div style="position: absolute; display: block; width: 278px; height: 35px;"></div></div></div>'}).click(function(n){n.preventDefault()}).mouseenter(function(){$(this).popover("show")}),$(".insolvency-widget .news-insolvency table tr td:nth-child(2) div").addClass("table-insolvency-secondColumn"),$("#moreInsolvencies").live("click",function(){t.showMoreInsolvencies(this)}),this.showNews();$("#addAlertForInsolvency").on("click",function(){t.addAlertForInsolvency($("#addAlertForInsolvency").data("publicinsolvencyid"))});window.setInterval(function(){NewsDetails.showNews()},3e4)},showMoreInsolvencies:function(n){var t=$($(n).find("i")[0]);t.hasClass("icon-plus-sign")?(t.removeClass("icon-plus-sign"),t.addClass("icon-minus-sign"),this.showHideInsolvencies($(n).parent().find("div.news-insolvency"),!0)):(t.removeClass("icon-minus-sign"),t.addClass("icon-plus-sign"),this.showHideInsolvencies($(n).parent().find("div.news-insolvency"),!1))},showHideInsolvencies:function(n,t){for(var i=1;i<n.length;i++)t?$(n[i]).fadeIn("fast"):$(n[i]).fadeOut("fast")},showNews:function(){for(var t="<ul>",n=0;n<3;n++)t+='<li><div style="float:left;margin-right:5px;"><img src="'+this.settings.moreNews[this.settings.showNews].imageUrl+'" /></div><div class="news-more"><small><i class="icon-calendar"></i> '+this.settings.moreNews[this.settings.showNews].createDate+'<br/><a href="'+this.settings.moreNews[this.settings.showNews].newsUrl+'">'+this.settings.moreNews[this.settings.showNews].title+'</a></small></div><div style="clear:left;"></div></li>',this.settings.showNews<this.settings.moreNews.length-1?this.settings.showNews++:this.settings.showNews=0;t+="<ul>",$("#moreNewsBlock").fadeOut("fast",function(){$("#moreNewsBlock").html(t),$("#moreNewsBlock").fadeIn("fast")})},addAlertForInsolvency:function(n){n!=null&&$.ajax({type:"POST",url:this.settings.RegisterAlertUrl,dataType:"json",data:{publicInsolvencyId:n},success:function(n){n.success&&$("#addAlertForInsolvency").hide()},error:function(n){n!=null?bootbox.alert(n):bootbox.alert("Ein Fehler ist aufgetreten. Bitte versuchen Sie es erneut.")}})}}