/* Développé par Arnaud Binard www.wikio.com - merci de ne pas enlever ce commentaire - please don't remove this comment */ 
var closeBalloon=closeContextMenu=null;
function Bubble(targetObj){this.targetObj=targetObj;this.Obj;this.bubbleObj=false;}
Bubble.prototype.invertVisibility=function(objectId,isVisible){if(this.Obj){this.Obj.style.visibility=isVisible;return true;}else{return false;};}
Bubble.prototype.moveObj=function(){if(this.Obj){if(this.xCoordinate)this.Obj.style.left=this.xCoordinate;if(this.yCoordinate)this.Obj.style.top=this.yCoordinate;return true;}else{return false;};}
Bubble.prototype.editBubble=function(event,content,divId,xCoor,yCoor,mouseCoorX,mouseCoorY,placement,keep){this.hideBubble();this.set();this.Obj=top.document.createElement("DIV");this.Obj.id="Bubble";this.Obj.style.visibility="hidden";this.Obj.style.position="absolute";if(window.attachEvent){this.Obj.attachEvent("onmouseover",top.stopBubbleClosure);this.Obj.attachEvent("onmouseout",top.closeBub);}else if(window.addEventListener){this.Obj.addEventListener("mouseover",top.stopBubbleClosure,true);this.Obj.addEventListener("mouseout",top.closeBub,true);};top.document.body.appendChild(this.Obj);this.bubbleObj=this.Obj;this.ObjStyle=this.bubbleObj.style;this.addX=xCoor;this.addY=yCoor;this.placement=placement;if(event && content){if(!keep)this.hideBubble();docX=(ie)?top.document.documentElement.scrollLeft+top.document.body.scrollLeft:window.scrollX;docY=(ie)?top.document.documentElement.scrollTop+top.document.body.scrollTop:window.scrollY;event.cancelBubble=true;var bubbleContent=(document.getElementById(content))?document.getElementById(content).innerHTML:content;this.Obj.appendChild(this.balloon(bubbleContent));if((toolkit.getOffsetCoor(event)[toolkit.coor.Y]+event.offsetHeight+this.Obj.offsetHeight+yCoor)>document.body.clientHeight+docY)this.placement="up";if(this.placement=="up"){this.yCoordinate=toolkit.getOffsetCoor(event)[toolkit.coor.Y]-this.Obj.offsetHeight-yCoor;if((toolkit.getOffsetCoor(event)[toolkit.coor.X]+this.Obj.offsetWidth+xCoor)>document.body.clientWidth+docX){this.xCoordinate=toolkit.getOffsetCoor(event)[toolkit.coor.X]-this.Obj.offsetWidth+xCoor+this.addX;this.cbr="bubbr1";}else{this.xCoordinate=toolkit.getOffsetCoor(event)[toolkit.coor.X]+xCoor;this.cbl="bubbl1";};}else{this.yCoordinate=toolkit.getOffsetCoor(event)[toolkit.coor.Y]+(yCoor*2);if((toolkit.getOffsetCoor(event)[toolkit.coor.X]+this.Obj.offsetWidth+xCoor)>document.body.clientWidth){this.xCoordinate=toolkit.getOffsetCoor(event)[toolkit.coor.X]-this.Obj.offsetWidth+xCoor+this.addX;this.ctr="bubtr1";}else{this.xCoordinate=toolkit.getOffsetCoor(event)[toolkit.coor.X]+8+xCoor;this.ctl="bubtl1";}};if(mouseCoorX){this.xCoordinate=toolkit.getOffsetCoor(event)[toolkit.coor.X]+this.addX;this.set();if(placement=="up")this.cbl="bubbl1";else this.ctl="bubtl1";};if(mouseCoorY){this.yCoordinate=event.y+this.addY;this.set();this.ctl="bubtl1";};this.Obj.removeChild(this.Obj.childNodes[0]);this.Obj.appendChild(this.balloon(bubbleContent));this.moveObj(this.xCoordinate,this.yCoordinate);if(this.invertVisibility(this.targetObj,'visible')){this.bubbleObj=this.Obj;this.Obj.style.zIndex=++g_zindex;return true;}else return false;}else return false;}
Bubble.prototype.hideBubble=function(){if(this.bubbleObj){this.invertVisibility(this.bubbleObj,'hidden');this.bubbleObj=false;}}
Bubble.prototype.makeCorner=function(tdClass,imgClass){td=top.document.createElement("TD");if(tdClass){td.className=tdClass;};img=top.document.createElement("IMG");img.src=top.clearImg;img.height=img.width=0;img.border=0;img.className=(imgClass)?imgClass:"bubb";td.appendChild(img);return td;}
Bubble.prototype.balloon=function(content){balloon=top.document.createElement("TABLE");setTable(balloon);ballonTbody=top.document.createElement("TBODY");balloon.appendChild(ballonTbody);topTR=top.document.createElement("TR");ballonTbody.appendChild(topTR);topTR.appendChild(this.makeCorner(null,this.ctl));topTR.appendChild(this.makeCorner("bubtop",null));topTR.appendChild(this.makeCorner(null,this.ctr));contentTR=top.document.createElement("TR");ballonTbody.appendChild(contentTR);contentTR.appendChild(this.makeCorner("bubl",null));this.contentTd=top.document.createElement("TD");this.contentTd.id="bubblecontent";this.contentTd.className="bubc";if(content.nodeType==1 || content.nodeType==3){this.contentTd.appendChild(content);}else{this.contentTd.innerHTML=content;};contentTR.appendChild(this.contentTd);contentTR.appendChild(this.makeCorner("bubr",null));bottomTR=top.document.createElement("TR");ballonTbody.appendChild(bottomTR);bottomTR.appendChild(this.makeCorner(null,this.cbl));bottomTR.appendChild(this.makeCorner("bubbottom",null));bottomTR.appendChild(this.makeCorner(null,this.cbr));return balloon;}
Bubble.prototype.set=function(){this.ctl="bubtl";this.ctr="bubtr";this.cbl="bubbl";this.cbr="bubbr";}
Bubble.prototype.closeBubble=function(){if(this.bubbleObj && this.bubbleObj.parentNode)this.bubbleObj.parentNode.removeChild(this.bubbleObj);}
function closeBub(){top.closeBalloon=top.setTimeout("killBalloon()",400);}
function stopBubbleClosure(event){top.clearTimeout(top.closeBalloon);}
function killBalloon(){if(g_bubble)g_bubble.closeBubble();top.closeBalloon=null;}
function bubByEvent(event){top.stopBubbleClosure();var event=(ie)?window.event.srcElement:event.target;x=(toolkit.getOffsetCoor(event)[toolkit.coor.X])?toolkit.getOffsetCoor(event)[toolkit.coor.X]:15;y=(event.y)?event.y:15;content=event.content;while(event.tagName!="TD"){event=event.parentNode;};if(g_bubble){g_bubble.editBubble(event,content,null,x,y);};}
function spanBub(event){top.stopBubbleClosure();var x=y=15;var event=(ie)?top.event.srcElement:event.target;if(toolkit.getOffsetCoor(event)[toolkit.coor.X])x=toolkit.getOffsetCoor(event)[toolkit.coor.X];if(event.y)y=event.y;content=event.content;if(g_bubble){g_bubble.editBubble(event,content,null,x,y);};}
function warningByEvent(event){var event=(ie)?window.event.srcElement:event.target;x=(toolkit.getOffsetCoor(event)[toolkit.coor.X])?toolkit.getOffsetCoor(event)[toolkit.coor.X]:15;y=(event.y)?event.y:15;content=event.content;placement=(event.placement)?event.placement:null;mouseCoorX=(ie)?top.event.clientX+top.document.documentElement.scrollLeft+top.document.body.scrollLeft:event.clientX+window.scrollX;while(event.tagName!="TD"){event=event.parentNode;};if(g_bubble)g_bubble.editBubble(event,content,null,x,y,mouseCoorX,null,placement);}
function mousebubByEvent(event){var event=(ie)?window.event.srcElement:event.target;x=(toolkit.getOffsetCoor(event)[toolkit.coor.X])?toolkit.getOffsetCoor(event)[toolkit.coor.X]:15;y=(event.y)?event.y:15;content=event.content;mouseCoorX=(ie)?top.event.clientX+top.document.documentElement.scrollLeft+top.document.body.scrollLeft:event.clientX+window.scrollX;mouseCoorY=(ie)?top.event.clientY+top.document.documentElement.scrollTop+top.document.body.scrollTop:event.clientY+window.scrollY;if(g_bubble)g_bubble.editBubble(event,content,null,x,y,mouseCoorX,mouseCoorY);}
function warning(event,content,dest,x,y,mouseCoorX,mouseCoorY,placement){x=(x!=null)?x:15;y=(y!=null)?y:15;var event=(ie)?window.event.srcElement:event.target;mouseCoorX=(ie)?window.event.clientX+document.documentElement.scrollLeft+document.body.scrollLeft:event.clientX+window.scrollX;while(event.tagName!="TD"){event=event.parentNode;};if(g_bubble){g_bubble.editBubble(event,content,dest,x,y,mouseCoorX,mouseCoorY,placement);};}
function mousebub(event,content,dest,x,y,mouseCoorX,mouseCoorY){var event=(ie)?window.event.srcElement:event.target;x=(x!=null)?x:15;y=(y!=null)?y:15;mouseCoorX=(ie)?window.event.clientX+document.documentElement.scrollLeft+document.body.scrollLeft:event.clientX+window.scrollX;mouseCoorY=(ie)?window.event.clientY+document.documentElement.scrollTop+document.body.scrollTop:event.clientY+window.scrollY;if(g_bubble)g_bubble.editBubble(event,content,dest,x,y,mouseCoorX,mouseCoorY);}
function contextMenu(targetObj){this.targetObj=targetObj;this.Obj;this.menuObj=false;}
contextMenu.prototype.invertVisibility=function(objectId,isVisible){if(this.Obj){this.Obj.style.visibility=isVisible;return true;}else return false;}
contextMenu.prototype.moveObj=function(){if(this.Obj){this.Obj.style.left=this.xCoordinate;this.Obj.style.top=this.yCoordinate;return true;}else return false;}
contextMenu.prototype.editMenu=function(event,content,divId,xCoor,yCoor,mouseCoorX,mouseCoorY,placement,keep){
this.hideMenu();stopMenuClosure();
this.Obj=top.document.createElement("DIV");this.Obj.id="Menu";this.Obj.style.visibility="hidden";this.Obj.style.position="absolute";
if(window.attachEvent){this.Obj.attachEvent("onmouseover",top.stopMenuClosure);this.Obj.attachEvent("onmouseout",top.closeMenu);}else if(window.addEventListener){this.Obj.addEventListener("mouseover",top.stopMenuClosure,true);this.Obj.addEventListener("mouseout",top.closeMenu,true);};
top.document.body.appendChild(this.Obj);this.menuObj=this.Obj;this.ObjStyle=this.menuObj.style;this.addX=xCoor;this.addY=yCoor;this.placement=placement;if(event && content){
if(!keep)this.hideMenu();event.cancelMenu=true;
docX=(ie)?top.document.documentElement.scrollLeft+top.document.body.scrollLeft:window.scrollX;
docY=(ie)?top.document.documentElement.scrollTop+top.document.body.scrollTop:window.scrollY;
var menuContent=(document.getElementById(content))?document.getElementById(content):content;
if(menuContent.getAttribute("ccsClass")){this.Obj.appendChild(this.balloon(menuContent,menuContent.getAttribute("ccsClass")));}else{this.Obj.appendChild(this.balloon(menuContent));};
if((toolkit.getOffsetCoor(event)[toolkit.coor.Y]+event.offsetHeight+this.Obj.offsetHeight+yCoor)>document.body.clientHeight+docY)this.placement="up";
if(this.placement=="up"){
this.yCoordinate=toolkit.getOffsetCoor(event)[toolkit.coor.Y]-this.Obj.offsetHeight-yCoor;
if((toolkit.getOffsetCoor(event)[toolkit.coor.X]+this.Obj.offsetWidth+xCoor)>document.body.clientWidth){
this.xCoordinate=toolkit.getOffsetCoor(event)[toolkit.coor.X]-this.Obj.offsetWidth+xCoor+this.addX;}
else{this.xCoordinate=toolkit.getOffsetCoor(event)[toolkit.coor.X]+xCoor;}
}
else{this.yCoordinate=toolkit.getOffsetCoor(event)[toolkit.coor.Y]+event.offsetHeight+yCoor;
if((toolkit.getOffsetCoor(event)[toolkit.coor.X]+this.Obj.offsetWidth+xCoor)>document.body.clientWidth){
this.xCoordinate=toolkit.getOffsetCoor(event)[toolkit.coor.X]-this.Obj.offsetWidth+xCoor+this.addX;}
else{this.xCoordinate=toolkit.getOffsetCoor(event)[toolkit.coor.X]+8+xCoor;};
};
if(mouseCoorX){this.xCoordinate=toolkit.getOffsetCoor(event)[toolkit.coor.X]+this.addX;};
if(mouseCoorY){this.yCoordinate=event.y+this.addY;};
this.moveObj(this.xCoordinate,this.yCoordinate);
if(this.invertVisibility(this.targetObj,'visible')){this.menuObj=this.Obj;this.Obj.style.zIndex=++g_zindex;return true;}else {return false;};}else {return false;};}
contextMenu.prototype.hideMenu=function(){if(this.menuObj){this.invertVisibility(this.menuObj,'hidden');this.menuObj=false;};}
contextMenu.prototype.makeCorner=function(tdClass,imgClass){td=top.document.createElement("TD");if(tdClass)td.className=tdClass;img=top.document.createElement("IMG");img.src=top.clearImg;img.height=img.width=0;img.border=0;img.className=(imgClass)?imgClass:"bubb";td.appendChild(img);return td;}
contextMenu.prototype.balloon=function(content,cName){balloon=top.document.createElement("DIV");balloon.id="menucontent";balloon.className=(cName)?cName:"cmbg";while(content.hasChildNodes()){if(content.childNodes[0].nodeType==1){balloon.appendChild(content.childNodes[0]);};};return balloon;}
contextMenu.prototype.closeMenu=function(){if(this.menuObj && this.menuObj.parentNode)this.menuObj.parentNode.removeChild(this.menuObj);}
function killMenu(){if(g_menu)g_menu.closeMenu();top.closeContextMenu=null;}
function closeMenu(){top.closeContextMenu=top.setTimeout("killMenu()",500);}
function stopMenuClosure(event){top.clearTimeout(top.closeContextMenu);}
var g_menu=new contextMenu("Bubble");var g_bubble=new Bubble("Bubble");
function bub(event,content,dest,tgt,x,y){var event=(ie)?window.event.srcElement:event.target;x=(x)?x:15;y=(y)?y:15;if(tgt){while(event.nodeName!=tgt){event=event.parentNode;}};if(g_bubble)g_bubble.editBubble(event,content,dest,x,y);}
function onRssImg(event){var event=(ie)?top.event.srcElement:event.target;if(!event.getAttribute("winurl")){return false;}else{if(event.getAttribute("tgt") && event.getAttribute("tgt")=="_self"){top.location.href=event.getAttribute("winurl")}else{window.open(event.getAttribute("winurl"))}};}
function rssMenu(adress){rssMenuDiv = top.document.createElement("DIV");rssMenuDiv.setAttribute("ccsClass","subs");for(cpt=0;cpt<rssReaders.length;cpt++){img=top.document.createElement("IMG");img.src="/shared/gui/subscribe/"+rssReaders[cpt][0]+".gif";if(rssReaders[cpt][2])img.setAttribute("tgt",rssReaders[cpt][2]);img.setAttribute("border",0);img.style.margin="0px";img.setAttribute("winurl",rssReaders[cpt][1]+adress); img.winurl=rssReaders[cpt][1]+adress;if(window.attachEvent){ img.attachEvent("onclick",top.onRssImg,true);}else if(window.addEventListener){img.addEventListener("click",top.onRssImg,true);};rssMenuDiv.appendChild(img);};return rssMenuDiv;}
function showMenu(event,content,dest,x,y,mouseCoorX,mouseCoorY,placement){
var event=(ie)?window.event.srcElement:event.target;if(g_menu && event && !event.rated){x=(x!=null)?x:0;y=(y!=null)?y:-1;while(!event.id)event=event.parentNode;if(!content){closeMenu();return;};id=event.id;mrss=(event.getAttribute("rss"))?event.getAttribute("rss"):false;mvalue=(event.getAttribute("pid"))?",'"+event.getAttribute("pid")+"'":"";mcat=(event.getAttribute("categ"))?",'"+event.getAttribute("categ")+"'":"";if(isNaN(id))id=id.substring(2,id.length);contentParam=(isNaN(parseInt(id)))?event.id:id;content=(mrss)?eval(content+"('"+mrss+"')"):eval(content+"("+contentParam+mvalue+mcat+")");g_menu.editMenu(event,content,dest,x,y,mouseCoorX,mouseCoorY,placement);}}
