function TH_newComment(url) { TH_widget.view_talkahead(url); } TH_dialog = null; TH_widget = { loadjscssfile: function(filename, filetype){ if (filetype=="js"){ var fileref=document.createElement('script'); fileref.setAttribute("type","text/javascript"); fileref.setAttribute("charset", "utf-8"); fileref.setAttribute("src", filename); } else if (filetype=="css"){ var fileref=document.createElement("link"); fileref.setAttribute("rel", "stylesheet"); fileref.setAttribute("type", "text/css"); fileref.setAttribute("href", filename); } if (typeof fileref!="undefined") document.getElementsByTagName("head")[0].appendChild(fileref) }, filesadded: "", checkloadjscssfile: function checkloadjscssfile(filename, filetype){ if (this.filesadded.indexOf("["+filename+"]")==-1){ this.loadjscssfile(filename, filetype); this.filesadded+="["+filename+"]"; } }, path: "http://server.talkahead.com", loadme: function () { var TH = TH_articles[TH_i]; // patch - IE/FF compatibility for non latin URLs var article = TH.article; // if (article == TH.url) // article = decodeURIComponent(article); this.loadjscssfile(this.path + "/mizar/web/comments?article="+encodeURIComponent(article)+"&title="+encodeURIComponent(TH.title)+"&publisher="+encodeURIComponent(TH.publisher)+"&category=" + encodeURIComponent(TH.category)+ "&url=" + encodeURIComponent(TH.url) + "&callback=TH_widget.draw&position="+TH_i, "js"); }, loading: function() { // joomla/mootools patch - in case of joomla/mootools - wait for domready, otherwise IE problems var e=/*@cc_on!@*/false; if (e) { try { window.addEvent("domready", TH_widget.domready); return; } catch (e) { } } TH_widget.domready(); }, domready: function() { if (typeof TH_i == 'undefined'){ TH_i = 0; } if (TH_i>TH_position){ setTimeout(TH_widget.domready, 1000); return; } TH_widget.loadme(); TH_i++; setTimeout(TH_widget.domready, 1); }, findPos: function(ctrl) { var pos = {x:0, y:0}; if (ctrl.offsetParent) { while(ctrl) { pos.x += ctrl.offsetLeft; pos.y += ctrl.offsetTop; ctrl = ctrl.offsetParent; } } else if (ctrl.x && ctrl.y) { pos.x += ctrl.x; pos.y += ctrl.y; } return pos; }, inlayer: false, showHint: function(hoveritem) { hp = document.getElementById("ta_hint"); // find offset offset = {x : 0, y: 0}; ctrl = hp.offsetParent; while(ctrl) { offset.x += ctrl.offsetLeft; offset.y += ctrl.offsetTop; ctrl = ctrl.offsetParent; } var pos = TH_widget.findPos(hoveritem); hp.style.top = pos.y - hp.offsetHeight - offset.y + "px"; hp.style.left = pos.x + 20 - offset.x + "px"; hp.style.visibility = "Visible"; hoveritem.onmouseout = function() { TH_widget.hideHint(); }; }, hideTheHint: function() { if (this.inlayer) return; hp = document.getElementById("ta_hint"); hp.style.visibility = "Hidden"; }, hideHint: function() { setTimeout(function() { TH_widget.hideTheHint(); }, 250); }, addHint: function(hintText) { var hdiv = document.createElement('div'); hdiv.setAttribute("class", "talkahead"); var html = '
Sponsored Comments are paid messages in response to an article, created by anyone interested in having his or her point of view prominently displayed.
'
+ 'Learn More'
+ '
'
+ '