<!--
 

var CONST_URL_WA_BLOG="wa_dyn_blog.php"
function mrMZi(TAGPt)
{
var xGWDP;
if((TAGPt.responseXML!=null)&&(TAGPt.responseXML.documentElement!=null))
{
xGWDP=TAGPt.responseXML.documentElement
}
else
{
var s=TAGPt.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();
xGWDP=parser.parseFromString(s,"text/xml");
}
else
{
var CDGps=new ActiveXObject("Microsoft.XMLDOM");
CDGps.async=false;
if(CDGps.loadXML(s))
{
xGWDP=CDGps;
}
}
}
}
}
return xGWDP
}
function sWBGE(ZucOd)
{
var qWTjl=ZucOd.getElementsByTagName("result");
if(qWTjl&&(qWTjl.length>0))
{
var qWHwG=qWTjl[0].firstChild.nodeValue
return wa_evaluate(qWHwG);
}
return false;
}
function JUFYh(ZucOd)
{
var qWTjl=ZucOd.getElementsByTagName("error");
if(qWTjl&&(qWTjl.length>0))
{
var qWHwG=""+trimString(qWTjl[0].firstChild.nodeValue)
if(qWHwG.substr(0,1)=="@")
{
qWHwG=Translator.tr(qWHwG.substr(1));
}
return qWHwG;
}
var FKnGP=sWBGE(ZucOd)
if(FKnGP==false)
{
return Translator.tr("Error:Server connexion");
}
return"";
}
obooh=function(DxVcZ,dPGbY,svYjg)
{
var DHHoI=svYjg[0]
var ZucOd=mrMZi(dPGbY)
var nfxIB=sWBGE(ZucOd) 
if(nfxIB)
WA_Dialog.alert(Translator.tr("Post message successfully"))
else
{
WA_Dialog.alert(JUFYh(ZucOd))
}
WA_refreshBlogs() 
}
hUZhK=function(DHHoI,ROJhg)
{
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",ROJhg,obooh,[DHHoI]);
}
LBkGq=function(DxVcZ,dPGbY,svYjg)
{
var mdRgJ=svYjg[0]
var DHHoI_button=svYjg[1]
var ZucOd=mrMZi(dPGbY)
var nfxIB=sWBGE(ZucOd)
var YTiqa_ids=mdRgJ.split(',');
for(var nEqSM=0;nEqSM<YTiqa_ids.length;nEqSM++)
{
var DHHoI_counter=YTiqa_ids[nEqSM]
var qWTjl=ZucOd.getElementsByTagName("counter_"+DHHoI_counter);
if(qWTjl.length>0)
{
var qWHwG=qWTjl[0].firstChild.nodeValue;
var RcgAK=document.getElementById(DHHoI_button)
if(RcgAK)
{
RcgAK.innerHTML=qWHwG+" "+Translator.tr("label_message(s)")
}
}
}
}
WA_refreshBlogs=function()
{
for(var ZboZi in document.wa_global_blogs_elements)
{
WA_blog_refresh(ZboZi)
}
}
WA_blog_refresh=function(DHHoI_button)
{
var DHHoI_blog=EALWF(DHHoI_button)
var ROJhg=""
ROJhg+="list_id="+DHHoI_blog+"&"
makePOSTRequest(CONST_URL_WA_BLOG+"?action=refresh_counter_comments",ROJhg,LBkGq,[DHHoI_blog,DHHoI_button]);
}
function fNifw(svYjg)
{
var DHHoI=svYjg[0]
var w=new WA_Dialog();
w.sTtOC=function(qWHwG)
{
return qWHwG;
}
w.nwPQt=function(DHHoI)
{
var UhCaV=document.getElementById(DHHoI+"-blog-form")
var UKKOV=[UhCaV.author,UhCaV.comment]
for(var i=0;i<UKKOV.length;i++)
{
var qbWSj=UKKOV[i];
qbWSj.style.backgroundColor="#ffffff"
if(qbWSj.value.length==0)
{
qbWSj.style.backgroundColor="#ff0000";qbWSj.focus();return;
}
}
var ROJhg=""
ROJhg+="id_article="+EALWF(DHHoI)+"&"
ROJhg+="author="+this.sTtOC(UhCaV.author.value)+"&"
if(UhCaV.email)
{
ROJhg+="email="+this.sTtOC(UhCaV.email.value)+"&"
}
ROJhg+="comments="+this.sTtOC(UhCaV.comment.value)+"&"
hUZhK(DHHoI,ROJhg)
}
w.KpSCe=function(DHHoI)
{
var TAGPt=document.wa_global_blogs_elements[DHHoI]
var UVVDB=TAGPt.has_email
this.addButton(Translator.tr("Submit message"),this.nwPQt,DHHoI,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='"+DHHoI+"-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(UVVDB)
{
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.KpSCe(DHHoI)
}
function RdMiL(parent,name)
{
var obj=parent.getElementsByTagName(name)
if(obj&&obj.length>0)
{
var node=obj[0]
return node.getAttribute('val');
}
return "";
}
function AMEwK(DxVcZ,dPGbY,aVKhA)
{
var DHHoI=aVKhA[0]
var bJlol=aVKhA[1]
var ZucOd=mrMZi(dPGbY)
var FXRTq=JUFYh(ZucOd)
if(FXRTq.length>0)
{
if(document.webaca_is_preview)
{
return;
}
bJlol.writeContent("<span style='"+bJlol.cssText1()+"'>"+FXRTq+" </span>")
return;
}
var doc=ZucOd
var text="";
var items=ZucOd.getElementsByTagName("OBJECT");
var css_common="font-family:Arial;"
var s_col_text=bJlol.getColorTheme(3)
var Pnlac=""
for(i=0;i<items.length;i++)
{
var obj_comment=items[i]
var id_article=RdMiL(obj_comment,"id_article")
var comment=RdMiL(obj_comment,"comment")
var author=RdMiL(obj_comment,"author")
var created=RdMiL(obj_comment,"created")
var email=RdMiL(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>";
}
Pnlac+="<span style='"+css_common+"color:"+s_col_text+";text-decoration:none;font-size:13px;'><b>"+author+" </b></span>";
Pnlac+="<span style='"+css_common+"color:#0000ff;text-decoration:underline;font-size:13px;'>"+email+"</span> ";
Pnlac+="<span style='"+css_common+"color:#0000ff;text-decoration:none;font-size:11px;'>"+created+" </span>";
Pnlac+="<br>";
Pnlac+="<span style='"+css_common+"color:"+s_col_text+";font-size:13px;'>"+comment+" </span>";
if(i<items.length-1)
{
Pnlac+="<hr>";
}
}
if(items.length==0)
{
Pnlac+="<span style='"+bJlol.cssText1()+"'>"+Translator.tr("No comments in this blog!")+" </span>"
}
bJlol.writeContent(Pnlac)
}
function EALWF(DHHoI_button)
{
var TAGPt=document.wa_global_blogs_elements[DHHoI_button]
return TAGPt.id_blog
}
function WA_blog(DHHoI_button)
{
var w=new WA_Dialog();
w.KpSCe=function(DHHoI_button)
{
this.addButton(Translator.tr("Send a message"),fNifw,[DHHoI_button])
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 ROJhg="";
ROJhg+="list_id="+EALWF(DHHoI_button)
if(document.webaca_is_preview!=true)
{
makePOSTRequest(CONST_URL_WA_BLOG+"?action=get_comments",ROJhg,AMEwK,[DHHoI_button,this]);
}
}
w.KpSCe(DHHoI_button)
}

-->
