/**
 * Affichage des commentaires en AJAX
 * Production Vic Pelletier, tous droits r�serv�es
 * Tommy Bri�re
 * avril 2009
**/(function(){
var Z= window.ZoneCommentaire= function(pid, zid, tid,eid){
this.noPage= 0;
this.pid= pid;
this.zid= zid;
this.tag= tid;
this.eid= eid;
this.dz= new DynamicZone(zid, DynamicZoneJavascriptEval);
this.update();}
Z.prototype={
update: function(){
var me= this;
jQuery("#"+this.tag).load("/plugin.php",{
plugin:"commentaire" ,
action:"getPage" ,
pageId: this.pid,
zoneId: this.zid,
noPage: this.noPage,
eid: this.eid,
itemParPage: Z.itemParPage,
tag: this.tag},function(){jQuery("#"+me.tag).css("min-height","0px")}
);},
setPage: function(noPage){
if(this.noPage!=noPage){
this.noPage= noPage;
this.update();}}}

var zones=[], hash={};
Z.itemParPage= 10;
Z.add= function(pid, zid, tid,eid){
var z= new Z(pid, zid, tid,eid);
zones.push(z);
hash[zid+"_"+ tid]= z;}
Z.setPage= function(zid, tag, noPage){
Z.get(zid, tag).setPage(noPage);}
Z.get= function(zid, tag){
return hash[zid+"_"+ tag];}
Z.affAbus= function(id){
if($j("#abus_"+id+":visible").length== 0)
$j("#abus_"+id).show();
else
$j("#abus_"+id).hide();}
Z.abus= function(id){
var url="/plugin.php";
var postData="&plugin=commentaire&action=abus&id="+id;
var request=blockingXmlCall(url,postData);
var data= request.responseText;
if(data !="OK" ){
alert(data);}else
$j(".zone_abus").hide();}})();