var debug=!1,editorsList,liveblogID,publicationID,jsonPath,defaultEditorsPic,editorsListWidget,_count,liveblog_container,userCommentIndicator;!function(){function e(){$("div.body").css({border:"0px"}),debug?$("body").prepend(editorsListWidget):$("div.body").parent().prepend(editorsListWidget),$.each(editorsList,function(e,t){var i=t.name,o=n(t.displayName);"advertisement"!=i&&"stoiximan"!=i&&"sxolioanagnosti"!=i&&"tag37"!=i&&"popcode-oscar"!=i&&"popcode-oscar-comments"!=i&&$("ul.editors").append("
"+o+"
")}),popcode_liveblog=$(".editorsList").scrollable(),setTimeout(function(){document.getElementsByClassName("liveblogEditorsList")[0].style.opacity="1"},4500)}function t(){var e=$("#liveblog-usercommentform .button.sendButton, #liveblog-usercommentform label, div.buttonContainer div, a#liveblogging-more-button");$.each(e,function(t,i){var o=$(i).text();o=n(o),$(e[t]).text(o)})}function i(){$("div.counter").insertAfter("input.userName + label"),$("χαρακτήρες
").insertAfter("div.counter")}function n(e){return e=e.replace(/ά/g,"α"),e=e.replace(/Ά/g,"Α"),e=e.replace(/έ/g,"ε"),e=e.replace(/Έ/g,"Ε"),e=e.replace(/ή/g,"η"),e=e.replace(/Ή/g,"Η"),e=e.replace(/ί|ΐ|ϊ/g,"ι"),e=e.replace(/Ί|Ϊ/g,"Ι"),e=e.replace(/ό/g,"ο"),e=e.replace(/Ό/g,"Ο"),e=e.replace(/ύ|ΰ|ϋ/g,"υ"),e=e.replace(/Ύ|Ϋ/g,"Υ"),e=e.replace(/ώ/g,"ω"),e=e.replace(/Ώ/g,"Ω")}function o(){liveblog_container.removeEventListener("DOMSubtreeModified",o,!1);var e,t=$(".comment").first()[0],i=$(t).attr("data-comment-id"),s=$(t).children(".commentContent"),a=n($(t).children(".commentContent").text());a.substr(0,a.indexOf(":")+1);elemClass_arr=$(s).parent().attr("class"),elemClass_arr=void 0!=elemClass_arr?elemClass_arr.split(" "):[],$.each(editorsList,function(t,o){var s=o.name,r=n(o.displayName);""!=o.picture?o.picture:defaultEditorsPic;if(s===elemClass_arr[1]&&"popcode-oscar"!=elemClass_arr[1]&&"popcode-oscar-comments"!=elemClass_arr[1])e=""+r.split(" ")[0]+": ",$("#livecomment"+i+" .commentContent").prepend(e);else if("sxolioanagnosti"===elemClass_arr[1]||"tag37"===elemClass_arr[1]){var c=a.indexOf(":");e=""+a.substr(0,c).trim()+": ",$("div[data-comment-id='"+i+"'][class~='sxolioanagnosti'] > .social").append(userCommentIndicator)}});$("div[data-comment-id='"+i+"'] .commentContent");setTimeout(function(){liveblog_container.addEventListener("DOMSubtreeModified",o,!1)},400)}function s(){$(".comment.sxolioanagnosti > .social").append(userCommentIndicator),$(".comment ").each(function(){_count=0,_comment=$(this);var t;$(_comment).find(".commentContent").text().split(":").pop();$(this).attr("class").split(" ").length>0&&(t=$(this).attr("class").split(" ")[1]),$(".editorsList li").each(function(){var e=$(this),i=$(e).attr("class").split(" ")[1],o=$(e).find("p").text().split(" ")[0];if(o=n(o),i==t&&_count"+o+": "),_count++)});else if(0===_count){var s=$(_comment).find(".commentContent").text().split(":").pop(),a=$(_comment).find(".commentContent").text(),r=a.indexOf(":");a=a.substr(0,r).trim(),a=n(a),_newUserName=r>=0?""+a+": ":" ",$(_comment).find(".commentContent").html(_newUserName+s),_count++}})})}liveblog_container=document.getElementById("commentContainer"),liveblogID=config.liveBlogID,publicationID=config.publicationID,jsonPath="http://live.24media.gr/service/liveblog/"+liveblogID+"/comments/?accept=json&pId="+publicationID+"&test=1",editorsListWidget="",userCommentIndicator="ΣΧΟΛΙΟ ΑΝΑΓΝΩΣΤΗ
",$.ajax({type:"GET",dataType:"jsonp",jsonpCallback:"staticCallback",url:jsonPath,success:function(t){editorsList=t[0].comment.liveBlog.tagSet.tags,editorsList.splice(0,2),e()}}),setTimeout(function(){s(),setTimeout(function(){liveblog_container.addEventListener("DOMSubtreeModified",o,!1)},5e3)},4500),t(),i()}();