var isPopupShown=false;var OpensPopup=[];var PopDirection;function CreatePopup(nb){var Menu1=Menu[4+nb];var s='';var nbLine=0;var checkable=false;var iconable=false;var unrollable=false;var i;for (i=1;i<Menu1.length;i++)if (Menu1[i].length<1) nbLine+=1;else {if (Menu1[i][0]>0) checkable=true;if (Menu1[i][1].length>0) iconable=true;if (Menu1[i].length>3) unrollable=true;}var LineWidth=10;if (checkable) LineWidth+=18;if (iconable) LineWidth+=27;LineWidth+=10+Menu1[0];if (unrollable) LineWidth+=14;s+='<div class="PopupMenu" style="width:'+(LineWidth+6)+'px; height:'+((Menu1.length-nbLine-1)*25+nbLine*10+6)+'px;">';s+='<div style="width:'+(LineWidth+4)+'px; height:'+((Menu1.length-nbLine-1)*25+nbLine*10+4)+'px;">';var vTop=2;for (i=1;i<Menu1.length;i++) {s+='<div class="'+(Menu1[i].length<1?'PopupHr':'PopupLn')+'" style="top:'+vTop+'px; width:'+LineWidth+'px;"';if (Menu1[i].length>0) s+=' onclick="ItemClick('+nb+','+i+');" onmouseover="setBold(this,'+nb+','+i+',\'on\');" onmouseout="setBold(this,'+nb+','+i+',\'off\');';s+='">';vTop+=(Menu1[i].length<1?10:25);if (Menu1[i].length>0) {var posX=0;if ((checkable)&&(Menu1[i][0]>0))s+='<img id="pop_chk_'+nb+'_'+i+'" class="PopupCheck" src="http://www.liveworld.fr/Images/Components/PopupMenu/Skins/0/'+(Menu1[i][0]<2?'un':'')+'checked_off.png" alt=""/>';if (checkable) posX+=18;if (iconable) {posX+=10;if (Menu1[i][1]!="")s+='<img class="PopupIcon" src="http://www.liveworld.fr/Images/Components/PopupMenu/Icons/'+Menu1[i][1]+'" alt="t" style="left:'+posX+'px;"/>';posX+=17;}s+='<span class="PopupTxt" id="pop_spn_'+nb+'_'+i+'" style="width:'+Menu1[0]+'px; left:'+(posX+10)+'px;">'+Menu1[i][2]+'</span>';posX+=Menu1[0]+20;if (Menu1[i].length>4)s+='<img id="pop_lnk_'+nb+'_'+i+'" class="PopupUnroll" src="http://www.liveworld.fr/Images/Components/PopupMenu/Skins/0/unroll_off.png" alt="" style="margin-left:'+posX+'px;"/>';}else s+='<div style="width:'+(LineWidth-10)+'px;"></div>';s+='</div>';}s+='</div></div>';s+='<div class="PopupRightBorder" style="left:'+(LineWidth+6)+'px; height:'+((Menu1.length-nbLine-1)*25+nbLine*10-3)+'px;"/></div>';s+='<div class="PopupBottomBorder" style="top:'+((Menu1.length-nbLine-1)*25+nbLine*10+6)+'px; width:'+(LineWidth-3)+'px;"/></div>';s+='<img class="PopupTopRightBorder" src="http://www.liveworld.fr/Images/Components/PopupMenu/Skins/0/TopRight.png" alt="" style="left:'+(LineWidth+6)+'px;"/>';s+='<img class="PopupBottomLeftBorder" src="http://www.liveworld.fr/Images/Components/PopupMenu/Skins/0/BottomLeft.png" alt="" style="top:'+((Menu1.length-nbLine-1)*25+nbLine*10+6)+'px;"/>';s+='<img class="PopupBottomRightBorder" src="http://www.liveworld.fr/Images/Components/PopupMenu/Skins/0/BottomRight.png" alt="" style="position:absolute; left:'+(LineWidth+6)+'px; top:'+((Menu1.length-nbLine-1)*25+nbLine*10+6)+'px;"/>';var div=document.createElement('div');div.innerHTML=s;div.setAttribute('id','popupmenu_'+nb);div.setAttribute('style','position:absolute; visibility:hidden;');document.getElementById('popupmenu').appendChild(div);}function CreatePopupMenu(){var i;for (i=4;i<Menu.length;i++) CreatePopup(i-4);}function OpenPopup(nb, x, y){isPopupShown=true;OpensPopup.push(nb);with (document.getElementById('popupmenu_'+nb).style) {left=x+'px';top=y+'px';visibility='visible';}}function ClosePopup(){isPopupShown=false;var i;for (i=0;i<OpensPopup.length;i++)document.getElementById('popupmenu_'+OpensPopup[i]).style.visibility='hidden';OpensPopup.splice(0,OpensPopup.length);}function setBold(div, nb, i, s){with (div.style)if (s=='on') backgroundColor='#'+Menu[2];else backgroundColor='#'+Menu[0];var Menu1=Menu[4+nb];if (Menu1[i].length>0) {k=Menu1[i][0];if (k>0) {with (document.getElementById('pop_chk_'+nb+'_'+i))if (k==1) src='http://www.liveworld.fr/Images/Components/PopupMenu/Skins/0/unchecked_'+s+'.png';else src='http://www.liveworld.fr/Images/Components/PopupMenu/Skins/0/checked_'+s+'.png';}}var j;for (j=OpensPopup.length-1;j>=0;j--)if (OpensPopup[j]==nb) break;else document.getElementById('popupmenu_'+OpensPopup[j]).style.visibility='hidden';OpensPopup.splice(j+1,OpensPopup.length);if (Menu1[i].length>4) {document.getElementById('pop_lnk_'+nb+'_'+i).src='http://www.liveworld.fr/Images/Components/PopupMenu/Skins/0/unroll_'+s+'.png';with (document.getElementById('popupmenu_'+nb))var tab=[parseInt(style.left),parseInt(style.top),clientWidth,clientHeight];with (document.getElementById('popupmenu_'+Menu1[i][4]))tab.push(clientWidth,clientHeight);if (PopDirection) {var x=tab[0]+tab[2]-3;if (x+tab[4]+4>window.innerWidth) {PopDirection=false;x=tab[0]-tab[4]+3;}}else {var x=tab[0]-tab[4]+3;if (x<0) {PopDirection=true;x=tab[0]+tab[2]-3;}}var y=parseInt(div.style.top)+tab[1]-2;if (y+tab[5]+3>window.innerHeight) y-=tab[5]-19;OpenPopup(Menu1[i][4],x,y);}with (document.getElementById('pop_spn_'+nb+'_'+i).style)if (s=='on') color='#'+Menu[3];else color='#'+Menu[1];}function ItemClick(nb, i){var Menu1=Menu[4+nb][i];var k=Menu1[0];if (k>0) {var s='http://www.liveworld.fr/Images/Components/PopupMenu/Skins/0/';if (k==1) Menu1[0]=2;else {s+='un';Menu1[0]=1;}document.getElementById('pop_chk_'+nb+'_'+i).src=s+'checked_on.png';}ClosePopup();eval(Menu1[3]);}