function PreloadInterface(Used_Skin)
  {
    var Path='interface/' + Used_Skin + '/';
    TabImgInterface[0]= new Image;
    TabImgInterface[0].src =Path + 'about.gif';
    TabImgInterface[1]=new Image;
    TabImgInterface[1].src=Path + 'show.gif';
    TabImgInterface[2]=new Image;
    TabImgInterface[2].src=Path + 'diapo.gif';
    TabImgInterface[3]=new Image;
    TabImgInterface[3].src=Path + 'diapostop.gif';
    TabImgInterface[4]=new Image;
    TabImgInterface[4].src=Path + 'next.gif';
    TabImgInterface[5]=new Image;
    TabImgInterface[5].src=Path + 'previous.gif';
    TabImgInterface[6]=new Image;
    TabImgInterface[6].src=Path + 'download.gif';
    TabImgInterface[7]=new Image;
    TabImgInterface[7].src=Path + 'print.gif';
    TabImgInterface[8]=new Image;
    TabImgInterface[8].src=Path + 'down.gif';
    TabImgInterface[9]=new Image;
    TabImgInterface[9].src=Path + 'up.gif';
    TabImgInterface[10]=new Image;
    TabImgInterface[10].src=Path + 'zoom_in.gif';
    TabImgInterface[11]=new Image;
    TabImgInterface[11].src=Path + 'zoom_out.gif';
    TabImgInterface[12]=new Image;
    TabImgInterface[12].src=Path + 'loading.gif';
    TabImgInterface[13]=new Image;
    TabImgInterface[13].src=Path + 'separator.gif';
    TabImgInterface[14]=new Image;
    TabImgInterface[14].src=Path + 'nav.jpg';
    TabImgInterface[15]=new Image;
    TabImgInterface[15].src=Path + 'nav.jpg';
    if (PlayMusic==1)
      {
        TabImgInterface[16]=new Image;
        TabImgInterface[16].src=Path + 'sound.gif';
        TabImgInterface[17]=new Image;
        TabImgInterface[17].src=Path + 'soundstop.gif';
      }
  }

function DynamicDiapo() 
  {
    DiapoNumber = DiapoNumber + 1;
    var id = "Diapo" + DiapoNumber;
    document.write('<DIV Id="' + id + '"></DIV>');
    this.div = document.getElementById(id);
    this.currentChild = null;
    this.create = DynamicDiapo_Create;
    this.addImages = DynamicDiapo_AddImages;
  }

function DynamicDiapo_Create(DiapoName)
  { 
    var ParentID = 'ID' + DiapoNumber;
    var StrTemp = '<DIV ID="' + ParentID + '" CLASS="parent">';
    StrTemp += '<a STYLE="cursor: pointer" onClick="ExpandCollapse(document.getElementById(\''+ParentID+'\'));">';
    StrTemp += '<IMG SRC="interface/'+Skin+'/up.gif" title="Ouvrir ou fermer le diaporama" ></a>';
    StrTemp += '' + DiapoName;
    StrTemp += '<DIV STYLE="display: none" CLASS="child"></DIV>';
    StrTemp += '</DIV>';
    this.div.innerHTML += StrTemp;
    this.currentChild = document.getElementById(ParentID);
  }

function DynamicDiapo_AddImages(ImgsTab)
  {

// Affichage photo !
    var ImgName = 'Img' + DiapoNumber;
    var ImgLoadingName = 'loading' + DiapoNumber;
    var ListName = 'list' + DiapoNumber;
    var FormName = 'form' + DiapoNumber;
//    var CommentName = 'comment' + DiapoNumber;
    var DivImg = 'DivImgContainer' + DiapoNumber;
    var ListBox = 'document.forms[\'' + FormName + '\'].elements[\'' + ListName + '\']';
    ImgsTab.sort();
    var ImgURL =  ImgsTab[0];
    if (ImgURL.lastIndexOf('#')!=-1)
      {
        ImgURL=ImgURL.substring(0,ImgURL.lastIndexOf(".")+1) + 'thumb';
      }
    else if (ResampledSize > 0)
      {
        ImgURL = 'resize.php?img_path=' + ImgURL + '&width=' + ResampledSize + '&height=' + ResampledSize + '&onlyshow=0';
        ImgsTab[0]=ImgsTab[0] + '#';
      }     
    var StrTemp = '<div id="' + DivImg + '" style="overflow:auto ;width: ' + DiapoScreenWidth + ';height: ' + DiapoScreenHeight + ';text-align: center">';
    StrTemp += '<table width="' + DiapoScreenWidth + '" height="' + DiapoScreenHeight + '">';
    StrTemp += '<tr><td align="center">';
    StrTemp += '<img name="' + ImgLoadingName + '" style="display:block" src="interface/'+Skin+'/loading.gif" width="48" height="12" border="0">';
    StrTemp += '<A STYLE="cursor: pointer;" onClick="Image_Popup(' + ListBox + '.value);">'; 



    if (Stretch > 0) 
      {
        StrTemp += '<img ID="Loading" name="' + ImgName + '" style="display:none;filter:alpha(opacity=100)" src="' + ImgURL + '" width="' + (DiapoScreenWidth - 8) + '" height="' + (DiapoScreenHeight - 20) + '"></A>';    
      } 
    else
      {  
        StrTemp += '<img ID="Loading" name="' + ImgName + '" style="display:none;filter:alpha(opacity=100)" src="' + ImgURL + '"></A>';
      } 
    StrTemp += '</td></tr>';
    StrTemp += '</table>';
    StrTemp += '</div>';
// List Box
    StrTemp += '<div CLASS="navig" style="width: ' + DiapoScreenWidth + '"><br>';
    StrTemp += '<FORM name="' + FormName + '">';
    if (HiddeListBox==1)
      {
        if (Nav=='Ope')
          {  
            StrTemp += '<SELECT NAME="' + ListName + '" style="visibility: hidden;width:0px;height:0px"></select>';
          } 
        else
          { 
            StrTemp += '<SELECT NAME="' + ListName + '" style="display: none"></select>';
          }
      }
    else 
      {
        StrTemp += '<SELECT NAME="' + ListName + '" onchange="ChangeImg(' + ImgName + ',' + ImgLoadingName + ',this);"></select>';
      }
    StrTemp += '</form>';
// Pour les commentaires !
//    StrTemp += '<table border="1" cellspacing="2"  width="' + DiapoScreenWidth + '" align="center" background="interface/newline/nav.jpg">';
//    StrTemp += '<tr>';
//    StrTemp += '<td colspan=1>';
//    StrTemp += '<div align="center">';
//    StrTemp += '<b><u><font size="2" color="#000000">Commentaire</font></u></b><br>';
//    StrTemp += '<textarea name="' + CommentName + '" rows="6" cols="48"></textarea>';
//    StrTemp += '</div>';
//    StrTemp += '</td>';
//    StrTemp += '</tr>';
//    StrTemp += '</table>';
// Barre de navigation !    
    StrTemp += '<div CLASS="navig" style="width: ' + DiapoScreenWidth + '">';
    StrTemp += '<table align="center">';
    StrTemp += '<tr><td align="center">';
    if (PlayMusic==1)
      {
        StrTemp += '<a STYLE="cursor: pointer;" onclick="PlaySound(' + ImgName + '.src);">';
        StrTemp += '<img src="interface/'+Skin+'/sound.gif" border="0" width="20" height="20" title="Jouer la musique du diaporama"></a>';
        StrTemp += '<a STYLE="cursor: pointer;">';
        StrTemp += '&nbsp;';
        StrTemp += '<a STYLE="cursor: pointer;" onclick="StopSound();">';
        StrTemp += '<img src="interface/'+Skin+'/soundstop.gif" border="0" width="20" height="20" title="Arrêter la musique du diaporama"></a>';
        StrTemp += '<a STYLE="cursor: pointer;">';
        StrTemp += '&nbsp;';
        StrTemp += '<img src="interface/'+Skin+'/separator.gif" border="0" width="20" height="20" >';
      }
    else
      {
        StrTemp += '<a STYLE="cursor: pointer;" onclick="Help_Popup();">';
        StrTemp += '<img src="interface/'+Skin+'/about.gif" border="0" title="Aide et crédits..."></a>';
        StrTemp += '<img src="interface/'+Skin+'/separator.gif" width="20" height="20" border="0">';
      }
    StrTemp += '<a STYLE="cursor: pointer;" onclick="Image_Popup(' + ListBox + '.value);">';
    StrTemp += '<img src="interface/'+Skin+'/show.gif" border="0"  title="Afficher l\'image en taille réelle"></a>';
    StrTemp += '<img src="interface/'+Skin+'/separator.gif" border="0">';

    StrTemp += '<A STYLE="cursor: pointer;" onClick="Vucomment(' + ImgName + ',' + ListBox + '.value);">'; 
    StrTemp += '<img src="interface/'+Skin+'/bulle.gif" border="0" title="Afficher ou ne pas afficher le commentaire"></a>';
    StrTemp += '<img src="interface/'+Skin+'/separator.gif" width="20" height="20" border="0">';

    StrTemp += '<A STYLE="cursor: pointer;" onClick="Admin();">'; 
    StrTemp += '<img src="interface/'+Skin+'/admin.gif" border="0" title="Modifier ou créer les commentaires (réservé à l\'Administrateur)"></a>';
    StrTemp += '<img src="interface/'+Skin+'/separator.gif" width="20" height="20" border="0">';

    StrTemp += '<a STYLE="cursor: pointer;" onClick="ZoomIn(' + ImgName + ',document.getElementById(\'' + DivImg + '\'));">';
    StrTemp += '<img src="interface/'+Skin+'/zoom_in.gif" border="0" title="Zoom + sur l\'image"></a>';
    StrTemp += '&nbsp;';
    StrTemp += '<a STYLE="cursor: pointer;" onClick="PreviousImg(' + ImgName + ',' + ImgLoadingName + ',' + ListBox + ');">';
    StrTemp += '<img src="interface/'+Skin+'/previous.gif" border="0" title="Revenir à l\'image précédente"></a>';
    StrTemp += '&nbsp;&nbsp;&nbsp;';
    StrTemp += '<a STYLE="cursor: pointer;" onClick="NextImg(' + ImgName + ',' + ImgLoadingName + ',' + ListBox + ');">';
    StrTemp += '<img src="interface/'+Skin+'/next.gif" border="0"  title="Passer à l\'image suivante"></a>';
    StrTemp += '&nbsp;';
    StrTemp += '<a STYLE="cursor: pointer;" onClick="ZoomOut(' + ImgName + ',document.getElementById(\'' + DivImg + '\'));">';
    StrTemp += '<img src="interface/'+Skin+'/zoom_out.gif" border="0" title="Zoom - sur l\'image"></a>';
    StrTemp += '<img src="interface/'+Skin+'/separator.gif" width="20" height="20" border="0">';
    StrTemp += '<a STYLE="cursor: pointer;" onClick="IniAutoDiapo(document.getElementById(\'ID' + DiapoNumber + '\'),' + ImgName + ',' + ImgLoadingName + ',' + ListBox + ');">';
    StrTemp += '<img src="interface/'+Skin+'/diapo.gif" border="0" title="Diaporama automatique"></a>';
    StrTemp += '&nbsp';
    StrTemp += '<a STYLE="cursor: pointer;" onclick="StopAuto(' + ImgName + ');">';
    StrTemp += '<img src="interface/'+Skin+'/diapostop.gif" border="0" title="Arrêter le diaporama automatique"></a>';
    if (PlayMusic==1)
      {
        StrTemp += '<img src="interface/'+Skin+'/separator.gif" width="20" height="20" border="0">';
        StrTemp += '<a STYLE="cursor: pointer;" onclick="Help_Popup();">';
        StrTemp += '<img src="interface/'+Skin+'/about.gif" border="0" title="Aide et crédits..."></a>';
      }
    StrTemp += '</td></tr>';
    StrTemp += '</table>';
    StrTemp += '</div>';
    this.currentChild.childNodes[2].innerHTML += StrTemp;
    FillListBox(ImgsTab,document.forms[FormName].elements[ListName]); 
    NImg=new Image();
    NImg.name='N'+ ImgName;
    NImg.src=ImgURL; 
    TabNewImg[TabNewImg.length]=NImg;
    WaitComplete();    
    if ((OpenFirst==1)&&(DiapoNumber==1))
      {
        this.currentChild.childNodes[2].style.display="block";
  	this.comment.value= "Insertion texte !"; 
      }
    else
      {
        this.currentChild.childNodes[2].style.display="none";
      }
  }

function GetMouse(e)
  {
//    if ($suit_mouse==1)
//      {
        x = (Nav == 'Net') ? e.pageX : event.x+document.body.scrollLeft;
        y = (Nav == 'Net') ? e.pageY : event.y+document.body.scrollTop;
        TheComment.style.top = y + 5;
        TheComment.style.left = x; 
//      }
//    else
//      {
//        TheComment.style.top = (screen.height-140)/2;
//        TheComment.style.left = 5; 
//      }
  }

function GetKey(e)
  {
    if (Nav=="Net")
      Key = e.which;
    else
      Key = window.event.keyCode;
  }


function UpdateKey(e)
  {
    Key = 0;
    if (TheComment.style.display=="block") HiddeComment();
  }

function MakeTrans(ImgElement)
  { 
    Img=ImgElement; 
    if (ImgElement.filters.alpha.opacity!=100) 
      {
        ImgElement.filters.alpha.opacity=ImgElement.filters.alpha.opacity+10;
        TransTimer = setTimeout("MakeTrans(Img)", 60);
      }
   }


function WaitComplete()
  { 
   for (cnt=0; cnt<TabNewImg.length; cnt++)
      {
        if ((TabNewImg[cnt])&&(TabNewImg[cnt].complete)) 
          {
            ID=TabNewImg[cnt].name.substring(4); 
            document['Img' + ID].src = TabNewImg[cnt].src;
            document['loading' + ID].style.display="none"; 
            document['Img' + ID].style.display="block"; 
            if (document['Img' + ID].filters) MakeTrans(document['Img' + ID]);
            document['Img' + ID].id="IsLoaded";
            UpdateImg=UpdateImg+1;
            TabNewImg[cnt]=null;
         }
      }
      if (UpdateImg==TabNewImg.length)
        {
          UpdateImg=0;
          TabNewImg.length=0;
        } 
      else WaitTimer=window.setTimeout("WaitComplete()",60);
  }


function FillListBox(ImgsTab,ListBox)
  {
    for (cnt=0; cnt<ImgsTab.length; cnt++)
      {
        OnlyFile=ImgsTab[cnt].substring(ImgsTab[cnt].lastIndexOf("/")+1);
        OnlyFile=OnlyFile.substring(0,OnlyFile.lastIndexOf("."));
        ListBox.length++;
        ListBox[cnt].text=unescape(OnlyFile);
        ListBox[cnt].value=ImgsTab[cnt];
      }
    ListBox.selectedIndex = 0;
  }

function NextImg(ImgElement,ImgLoadingElement,ListBox)
  {
    StopAuto(ImgElement);
    ImgElement.id="Loading";
    if (ImgElement.filters) ImgElement.filters.alpha.opacity=0;
    ImgElement.style.display="none";
    ImgLoadingElement.style.display="block";
    i = ListBox.selectedIndex + 1;
    if (i > ListBox.length - 1) {i = 0};
    ImgURL=ListBox[i].value;
    UpdateComment(ImgURL);
    if (ImgURL.lastIndexOf('#')!=-1)
      {
        ImgURL=ImgURL.substring(0,ImgURL.lastIndexOf(".")+1) + 'thumb';
      }
    else if (ResampledSize > 0)
      {
        ImgURL = 'resize.php?img_path=' + ImgURL + '&width=' + ResampledSize + '&height=' + ResampledSize + '&onlyshow=0';
        ListBox[i].value=ListBox[i].value + '#';
      }     
    NImg=new Image();
    NImg.name='N'+ImgElement.name;
    NImg.src=ImgURL; 
    TabNewImg[TabNewImg.length]=NImg;
    WaitComplete();    
    ListBox.selectedIndex = i; 
  }


function PreviousImg(ImgElement,ImgLoadingElement,ListBox)
  {
    StopAuto(ImgElement);
    ImgElement.id="Loading";
    if (ImgElement.filters) ImgElement.filters.alpha.opacity=0;
    ImgElement.style.display="none";
    ImgLoadingElement.style.display="block";
    i = ListBox.selectedIndex - 1;
    if (i < 0) {i = ListBox.length-1};
    ImgURL=ListBox[i].value;
    UpdateComment(ImgURL);
    if (ImgURL.lastIndexOf('#')!=-1)
      {
        ImgURL=ImgURL.substring(0,ImgURL.lastIndexOf(".")+1) + 'thumb';
      }
    else if (ResampledSize > 0)
      {
        ImgURL = 'resize.php?img_path=' + ImgURL + '&width=' + ResampledSize + '&height=' + ResampledSize + '&onlyshow=0';
        ListBox[i].value=ListBox[i].value + '#';
    }     
    NImg=new Image();
    NImg.name='N'+ImgElement.name;
    NImg.src=ImgURL; 
    TabNewImg[TabNewImg.length]=NImg;
    WaitComplete();    
    ListBox.selectedIndex = i; 
  }


function ChangeImg(ImgElement,ImgLoadingElement,ListBox)
  {
    StopAuto(ImgElement);
    ImgElement.id="Loading";
    if (ImgElement.filters) ImgElement.filters.alpha.opacity=0;
    ImgElement.style.display="none";
    ImgLoadingElement.style.display="block";
    ImgURL=ListBox[ListBox.selectedIndex].value;
    UpdateComment(ImgURL);
    if (ImgURL.lastIndexOf('#')!=-1)
      {
        ImgURL=ImgURL.substring(0,ImgURL.lastIndexOf(".")+1) + 'thumb';
      }
    else if (ResampledSize > 0)
      {
        ImgURL = 'resize.php?img_path=' + ImgURL + '&width=' + ResampledSize + '&height=' + ResampledSize + '&onlyshow=0';
        ListBox[ListBox.selectedIndex].value=ListBox[ListBox.selectedIndex].value + '#';
      }     
    NImg=new Image();
    NImg.name='N'+ImgElement.name;
    NImg.src=ImgURL; 
    TabNewImg[TabNewImg.length]=NImg;
    WaitComplete(); 
  }


function AutoNextImg()
  {
    switch (CurrentImg.id)
      { 
      case "IsLoaded" :        
        CurrentImg.id="CanNext";  

       i = CurrentList.selectedIndex;
       ImgURL=CurrentList[i].value;
       UpdateComment(ImgURL);
        
        i = CurrentList.selectedIndex + 1;
        if (i > CurrentList.length - 1) {i = 0};
        ImgURL=CurrentList[i].value;
        
        AutoTimer = setTimeout('AutoNextImg()',TimePauseAuto);
        break;      

      case "CanNext" :
        CurrentImg.id="Loading";
        CurrentImgLoading.style.display="block";
        CurrentImg.style.display="none";
        if (CurrentImg.filters) CurrentImg.filters.alpha.opacity=0;
        i = CurrentList.selectedIndex + 1;
        if (i > CurrentList.length - 1) {i = 0};
        ImgURL=CurrentList[i].value;
        if (ImgURL.lastIndexOf('#')!=-1)
          {
            ImgURL=ImgURL.substring(0,ImgURL.lastIndexOf(".")+1) + 'thumb';
          }
        else if (ResampledSize > 0)
          {
            ImgURL = 'resize.php?img_path=' + ImgURL + '&width=' + ResampledSize + '&height=' + ResampledSize + '&onlyshow=0';
            CurrentList[i].value=CurrentList[i].value + '#';
          }     
        NImg=new Image();
        NImg.name='N'+ CurrentImg.name;
        NImg.src=ImgURL; 
        TabNewImg[TabNewImg.length]=NImg;
       WaitComplete();    
        UpdateComment(ImgURL);
        CurrentList.selectedIndex = i;
        AutoTimer = setTimeout('AutoNextImg()',100);
        break;     
     
      case "Loading" :
        AutoTimer = setTimeout('AutoNextImg()',100);
        break;
      }
  }    


function IniAutoDiapo(DivElement,ImgElement,ImgLoadingElement,ListBox)
  {
    if (CurrentDiapo) 
      {
        StrTitle=CurrentDiapo.childNodes[1].data;
        if (StrTitle.search(/automatique/)!= -1) CurrentDiapo.childNodes[1].data=StrTitle.substring(0,StrTitle.lastIndexOf("("));
      }
    clearTimeout(AutoTimer);
    CurrentImg=ImgElement;
    CurrentImgLoading=ImgLoadingElement;
    CurrentList=ListBox;
    CurrentDiapo=DivElement;
    StrTitle=CurrentDiapo.childNodes[1].data;
    if (StrTitle.search(/automatique/)== -1) CurrentDiapo.childNodes[1].data=StrTitle + "(automatique)";
    if (CurrentImg.id=="CanNext") CurrentImg.id="IsLoaded";
    
    HiddeComment();

  
    AutoNextImg();
 }


function StopAuto(ImgElement)
  {
   if (CurrentImg) if (ImgElement.name==CurrentImg.name) 
    {
      StrTitle=CurrentDiapo.childNodes[1].data;
      if (StrTitle.search(/automatique/)!= -1) CurrentDiapo.childNodes[1].data=StrTitle.substring(0,StrTitle.lastIndexOf("("));
      clearTimeout(AutoTimer);
    }
    HiddeComment();
  }


function ZoomIn(ImgElement, DivImgElement)
  {
    DivImgElement.style.overflow="Auto";
    ImgElement.width = ImgElement.width + 30;
    if (Stretch>0) ImgElement.height = ImgElement.height + 30;
   
  }


function ZoomOut(ImgElement, DivImgElement)
  {
     if ((parseInt(DivImgElement.style.height)>ImgElement.height-30)&&(parseInt(DivImgElement.style.width)>ImgElement.width-30)) DivImgElement.style.overflow="hidden";
     if ((ImgElement.width>100)&&(ImgElement.height>100))
       {
          ImgElement.width = ImgElement.width - 30;
          if (Stretch>0) ImgElement.height = ImgElement.height - 30;
       }
   
  }


function PlaySound(SoundFilePath)
  {
    SoundFilePath=SoundFilePath.substring(0,SoundFilePath.lastIndexOf("/")+1);
    SoundFilePath=SoundFilePath + 'sound.mid';
    url="player.php?music_path=" + SoundFilePath + "&nav=" + Nav;
    ThePlayer.src=url;  
  }

function StopSound()
  {
    url="player.php?music_path=#&nav=" + Nav;
    ThePlayer.src="url";  
  }


function Vucomment(ImgObj,ImgPath)
  {
    if (TheComment.style.display=="none")
      {
        if (CurrentImg) if (CurrentImg.name==ImgObj.name) CanUpdateComment=true;
        DisplayComment(ImgPath);
      }
    else
      {
        HiddeComment();

      }
  } 


function DisplayComment(ImgPath)
  {
    if (TheComment.style.display=="none")
      {
        FilePathWithoutExt=ImgPath.substring(0,ImgPath.lastIndexOf(".")+1);
        TextFilePath=FilePathWithoutExt + 'txt';
        url="comment_frame.php?text_path=" + TextFilePath + "&skin=" + Skin;
        SlideDown();
        TheComment.style.display="block";
        TheComment.height=0;
        TheComment.src=url;  
       }
      else
      {
        FilePathWithoutExt=ImgPath.substring(0,ImgPath.lastIndexOf(".")+1);
        TextFilePath=FilePathWithoutExt + 'txt';
        url="comment_frame.php?text_path=" + TextFilePath + "&skin=" + Skin;
        SlideDown();
        TheComment.style.display="block";
        TheComment.height=0;
        TheComment.src=url;  
       }
  }

function UpdateComment(ImgPath)
  {
    if (CanUpdateComment==true)
      {
        FilePathWithoutExt=ImgPath.substring(0,ImgPath.lastIndexOf(".")+1);
        TextFilePath=FilePathWithoutExt + 'txt';
        url="comment_frame.php?text_path=" + TextFilePath + "&skin=" + Skin;
        TheComment.src=url;  
      } 
  }


function HiddeComment()
  {
    CanUpdateComment=false;
    TheComment.style.display="none";
    TheComment.src="#";
    SlideVal=0;
  }

function SlideDown()
  {
SlideVal=270;
    SlideVal++;
    if (SlideVal<300) 
      {
      TheComment.height=SlideVal;
      Down=setTimeout("SlideDown()",0); 
      }
  }

function Help_Popup()
  {
    var WinName = "Help_Popup";
    var x=(screen.width-510)/2;
    var y=(screen.height-510)/2; 
    window.open('help_popup.php?skin=' + Skin,WinName,'top=' + y + ',left=' + x +',width=480,height=480,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no');
  }


function Image_Popup(ImgPath)
  {
    var WinName = "Image_Popup";
    var x=0;
    var y=0; 
    if (ImgPath.lastIndexOf('#')!=-1)
      ImgPath=ImgPath.substring(0,ImgPath.lastIndexOf("#"));
    window.open('image_popup.php?img_path=' + ImgPath + '&skin=' + Skin + '&showlines=' + ShowLines,WinName,'toolbar=no, location=no, status=no, menubar=no, scrollbars=yes, resizable=yes');
  }


function ExpandCollapse(DivElement) 
  {
    var ImgIcon = DivElement.childNodes[0].childNodes[0];
    DivElement = DivElement.childNodes[2];
    if (DivElement.style.display == "none")
      {  
         DivElement.style.display = "block" ;
         ImgIcon.src = "interface/" +Skin+ "/down.gif" ;
      }
    else 
      {
         DivElement.style.display = "none" ;
         ImgIcon.src = "interface/" +Skin+ "/up.gif" ;
         HiddeComment()
      }
  }
 
function Admin()
  {
    var WinName = "Admin_Popup";
    window.open('addons/comments.php?skin=' + Skin,WinName);
  }
