<!--

var CONST_URL_WA_BLOG="wa_dyn_blog.php"
function BJgOC(raNnc)
{
var UHYVr;
if((raNnc.responseXML!=null)&&(raNnc.responseXML.documentElement!=null))
{
UHYVr=raNnc.responseXML.documentElement
}
else
{
var s=raNnc.responseText;
var delimiter1="<?xml";
var delimiter2="</is_blogslike>";
var n1=s.indexOf(delimiter1);
if(n1>=0)
{
s=s.substring(n1);
var n2=s.lastIndexOf(delimiter2);
if(n2>0)
{
s=s.substring(0,n2+delimiter2.length);
if(typeof DOMParser!='undefined')
{
var parser=new DOMParser();
UHYVr=parser.parseFromString(s,"text/xml");
}
else
{
var KQejh=new ActiveXObject("Microsoft.XMLDOM");
KQejh.async=false;
if(KQejh.loadXML(s))
{
UHYVr=KQejh;
}
}
}
}
}
return UHYVr
}
function budRq(SQbfB)
{
var PthZE=SQbfB.getElementsByTagName("result");
if(PthZE&&(PthZE.length>0))
{
var pxYVf=PthZE[0].firstChild.nodeValue
return wa_evaluate(pxYVf);
}
return false;
}
function OmgZP(SQbfB)
{
var PthZE=SQbfB.getElementsByTagName("error");
if(PthZE&&(PthZE.length>0))
{
var pxYVf=""+trimString(PthZE[0].firstChild.nodeValue)
if(pxYVf.substr(0,1)=="@")
{
pxYVf=Translator.tr(pxYVf.substr(1));
}
return pxYVf;
}
var PKDKV=budRq(SQbfB)
if(PKDKV==false)
{
return Translator.tr("Error:Server connexion");
}
return"";
}
WieaR=function(jQtcp,wcvIE,arxfJ)
{
var nbhRn=arxfJ[0]
var SQbfB=BJgOC(wcvIE)
var vaTFM=budRq(SQbfB)
if(vaTFM)
WA_Dialog.alert(Translator.tr("Post message successfully"))
else
{
WA_Dialog.alert(OmgZP(SQbfB))
}
WA_refreshBlogs()
}
qmlcD=function(nbhRn,cQOVv)
{
if(document.webaca_is_preview)
{
WA_Dialog.alert(Translator.tr("Operation not allowed in preview mode"));return;
}
var w=new WA_Dialog();
w.progress()
makePOSTRequest(CONST_URL_WA_BLOG+"?action=post_comment",cQOVv,WieaR,[nbhRn]);
}
JjpbI=function(jQtcp,wcvIE,arxfJ)
{
var YbdkQ=arxfJ[0]
var ebQjb=arxfJ[1]
var SQbfB=BJgOC(wcvIE)
var vaTFM=budRq(SQbfB)
var svbYT=YbdkQ.split(',');
for(var ffwUo=0;ffwUo<svbYT.length;ffwUo++)
{
var AxhSF=svbYT[ffwUo]
var PthZE=SQbfB.getElementsByTagName("counter_"+AxhSF);
if(PthZE.length>0)
{
var pxYVf=PthZE[0].firstChild.nodeValue;
var xLvTf=document.getElementById(ebQjb)
if(xLvTf)
{
xLvTf.innerHTML=pxYVf+" "+Translator.tr("label_message(s)")
}
}
}
}
WA_refreshBlogs=function()
{
for(var nTljj in document.wa_global_blogs_elements)
{
WA_blog_refresh(nTljj)
}
}
WA_blog_refresh=function(ebQjb)
{
var ANLCp=Ziwdt(ebQjb)
var cQOVv=""
cQOVv+="list_id="+ANLCp+"&"
makePOSTRequest(CONST_URL_WA_BLOG+"?action=refresh_counter_comments",cQOVv,JjpbI,[ANLCp,ebQjb]);
}
function onAPA(arxfJ)
{
var nbhRn=arxfJ[0]
var w=new WA_Dialog();
w.fHgfJ=function(pxYVf)
{
return pxYVf;
}
w.pNFED=function(nbhRn)
{
var ZuXir=document.getElementById(nbhRn+"-blog-form")
var PuRnG=[ZuXir.author,ZuXir.comment]
for(var i=0;i<PuRnG.length;i++)
{
var kvTdS=PuRnG[i];
kvTdS.style.backgroundColor="#ffffff"
if(kvTdS.value.length==0)
{
kvTdS.style.backgroundColor="#ff0000";kvTdS.focus();return;
}
}
var cQOVv=""
cQOVv+="id_article="+Ziwdt(nbhRn)+"&"
cQOVv+="author="+this.fHgfJ(ZuXir.author.value)+"&"
if(ZuXir.email)
{
cQOVv+="email="+this.fHgfJ(ZuXir.email.value)+"&"
}
cQOVv+="comments="+this.fHgfJ(ZuXir.comment.value)+"&"
qmlcD(nbhRn,cQOVv)
}
w.JNIsO=function(nbhRn)
{
var raNnc=document.wa_global_blogs_elements[nbhRn]
var kuVam=raNnc.has_email
this.addButton(Translator.tr("Submit message"),this.pNFED,nbhRn,this)
var css_common="font-family:Arial;"
var s_col_text=this.getColorTheme(3)
var css_label=css_common+"color:"+s_col_text+";text-decoration:none;font-weight:bold;font-size:12px;"
this.initializeWindow(500,500)
var s=""
s+="<form id='"+nbhRn+"-blog-form'>"
s+="<table border=0 cellpadding=0 cellspacing=0  style='width:90%;'>";
s+="<tr><td align=left style='"+css_label+"'>"
s+=Translator.tr("Blog author")+"<br>"
s+="<input name='author' type=text>"
s+="<br>"
s+="<br>"
s+="</td></tr>";
if(kuVam)
{
s+="<tr><td align=left style='"+css_label+"'>"
s+=Translator.tr("Blog url")+"<br>"
s+="<input name='email' type=text>"
s+="<br>"
s+="<br>"
s+="<br>"
s+="</td></tr>";
}
s+="<tr><td align=center style='"+css_label+"'>"
s+="<textarea name='comment' style='width:100%;height:100px;' ></textarea>"
s+="</td></tr>";
s+="</table>"
s+="</form>"
this.writeContent(s)
}
w.JNIsO(nbhRn)
}
function pjrvk(parent,name)
{
var obj=parent.getElementsByTagName(name)
if(obj&&obj.length>0)
{
var node=obj[0]
return node.getAttribute('val');
}
return "";
}
function FSWfE(jQtcp,wcvIE,glURS)
{
var nbhRn=glURS[0]
var vTdjv=glURS[1]
var SQbfB=BJgOC(wcvIE)
var YbSVC=OmgZP(SQbfB)
if(YbSVC.length>0)
{
if(document.webaca_is_preview)
{
return;
}
vTdjv.writeContent("<span style='"+vTdjv.cssText1()+"'>"+YbSVC+" </span>")
return;
}
var doc=SQbfB
var text="";
var items=SQbfB.getElementsByTagName("OBJECT");
var css_common="font-family:Arial;"
var s_col_text=vTdjv.getColorTheme(3)
var svurk=""
for(i=0;i<items.length;i++)
{
var obj_comment=items[i]
var id_article=pjrvk(obj_comment,"id_article")
var comment=pjrvk(obj_comment,"comment")
var author=pjrvk(obj_comment,"author")
var created=pjrvk(obj_comment,"created")
var email=pjrvk(obj_comment,"email")
author=unescape(author)
comment=unescape(comment)
if(email=="http://") email="";
if(email.length>0)
{
var label_url=email;
var url=email;
if((email.indexOf("@")>0)&&(email.indexOf("mailto:")<0))
{
url="mailto:"+email;
label_url=email;
}
email="<a href='"+url+"' target=_blank>"+label_url+"</a>";
}
svurk+="<span style='"+css_common+"color:"+s_col_text+";text-decoration:none;font-size:13px;'><b>"+author+" </b></span>";
svurk+="<span style='"+css_common+"color:#0000ff;text-decoration:underline;font-size:13px;'>"+email+"</span> ";
svurk+="<span style='"+css_common+"color:#0000ff;text-decoration:none;font-size:11px;'>"+created+" </span>";
svurk+="<br>";
svurk+="<span style='"+css_common+"color:"+s_col_text+";font-size:13px;'>"+comment+" </span>";
if(i<items.length-1)
{
svurk+="<hr>";
}
}
if(items.length==0)
{
svurk+="<span style='"+vTdjv.cssText1()+"'>"+Translator.tr("No comments in this blog!")+" </span>"
}
vTdjv.writeContent(svurk)
}
function Ziwdt(ebQjb)
{
var raNnc=document.wa_global_blogs_elements[ebQjb]
return raNnc.id_blog
}
function WA_blog(ebQjb)
{
var w=new WA_Dialog();
w.JNIsO=function(ebQjb)
{
this.addButton(Translator.tr("Send a message"),onAPA,[ebQjb])
this.initializeWindow(650,900)
var mess="Loading messages...."
if(document.webaca_is_preview)
{
mess=Translator.tr("Operation not allowed in preview mode");
}
var s=""
s+="<table border=0 cellpadding=0 cellspacing=0  style='width:100%;'><tr>";
s+="<td align=center style='"+this.cssText1()+"'>"
s+=mess
s+="</td></tr></table>"
this.writeContent(s)
var cQOVv="";
cQOVv+="list_id="+Ziwdt(ebQjb)
if(document.webaca_is_preview!=true)
{
makePOSTRequest(CONST_URL_WA_BLOG+"?action=get_comments",cQOVv,FSWfE,[ebQjb,this]);
}
}
w.JNIsO(ebQjb)
}

-->
