function PoPuP()
{
 var frmlr,tab_cam="",gato="gato=",i,thumb=0,top=0,left=0,fscreen="",ffscreen=0, width, height=0, camh;
 frmlr=document.PoP;
 if(frmlr.thumb.checked)
 {
    thumb=1;
    gato="1,";
 }
 else
    gato="0,";

  if(thumb)
  {
   width=176;
   camh=144;
  }
  else
  {
   width=352;
   camh=288;
  }


 if(frmlr.inone.checked || frmlr.zapp.checked)
 {
  winname="kargaland";

  if(frmlr.inone.checked)
     gato+="1,";
  else
     gato+="0,";

  if(frmlr.zapp.checked)
  {
     winname+="zapp";
     zapp=1;
     gato+="1,";
  }
  else
  {
     zapp=0;
     gato+="0,";
  }

  if(frmlr.testimage.checked)
  {
     gato+="testimage,";
  }
  
  if(frmlr.fullscreen.checked)
  {
      fscreen = "fullscreen,";
    ffscreen=1;
    gato+="fscreen,";
  }

  for(i=0;i<(frmlr.elements.length-1);i++)
  {
   if(frmlr.elements[i].name=="cam[]" && frmlr.elements[i].checked)
   {
      tab_cam+="&cam[]="+frmlr.elements[i].value;
      gato+=frmlr.elements[i].value+",";
      height+=camh;
   }
  }

  if(zapp) height=camh;

  if(ffscreen)
  {
   width+=2;
   height+=2;
  }
  else
  {
   width+=10;
   height+=30;
  }

  var ExpireDate = new Date ();
  ExpireDate.setTime(ExpireDate.getTime()+(365 * 24 * 3600 * 1000));
  document.cookie = "gato="+gato+"; expires=" + ExpireDate.toGMTString();

  webcamWin=window.open("popups.php?frame=1&thumb="+thumb+"&zapp="+zapp+"&fscreen="+ffscreen+"&win_name="+winname+tab_cam,winname,fscreen+"top=0,left=0,width=100,height=100,toolbar=0,resizable=0,directories=0,status=0,menubar=0,scrollbars=0");
  webcamWin.resizeTo(width,height);
 }
 else
 {
  gato+="0,0,";

  if(frmlr.fullscreen.checked)
  {
      fscreen = "fullscreen,";
    ffscreen=1;
    gato+="fscreen,";
  }

  height=camh;

  if(ffscreen)
  {
   width+=2;
   height+=2;
  }
  else
  {
   width+=10;
   height+=30;
  }

  for(i=0;i<(frmlr.elements.length-1);i++)
  {
   if(frmlr.elements[i].name=="cam[]" && frmlr.elements[i].checked)
   {
      tab_cam+="&cam[]="+frmlr.elements[i].value;
      gato+=frmlr.elements[i].value+",";
   }
  }

  var ExpireDate = new Date ();
  ExpireDate.setTime(ExpireDate.getTime()+(365 * 24 * 3600 * 1000));
  document.cookie = "gato="+gato+"; expires=" + ExpireDate.toGMTString();

  for(i=0;i<(frmlr.elements.length-1);i++)
  {
   if(frmlr.elements[i].name=="cam[]" && frmlr.elements[i].checked)
   {
      webcamWin=window.open("popups.php?frame=1&thumb="+thumb+"&fscreen="+ffscreen+"&win_name=cam"+frmlr.elements[i].value+"&cam[]="+frmlr.elements[i].value+"&winX="+left+"&winY="+top,"cam"+frmlr.elements[i].value,fscreen+"top="+top+",left="+left+",width=100,height=100,toolbar=0,resizable=0,directories=0,status=0,menubar=0,scrollbars=0");
      webcamWin.resizeTo(width,height);
      webcamWin.moveTo(left,top);
      top+=15;
      left+=15;
   }
  }

 }

 document.close();
}

function PopOne(IdCam)
{
 var frmlr,tab_cam="",gato="gato=",i,thumb=0,top=0,left=0,fscreen="",ffscreen=0,width=0,height=0;
 frmlr=document.PoP;
 if(frmlr.thumb.checked)
    thumb=1;

  if(frmlr.fullscreen.checked)
  {
      fscreen = "fullscreen,";
    ffscreen=1;
  }

  if(thumb)
  {
   width=176;
   height=144;
  }
  else
  {
   width=352;
   height=288;
  }

  if(ffscreen)
  {
   width+=2;
   height+=2;
  }
  else
  {
   width+=10;
   height+=30;
  }

 webcamWin=window.open("popups.php?frame=1&thumb="+thumb+"&fscreen="+ffscreen+"&win_name=cam"+IdCam+"&cam[]="+IdCam,"cam"+IdCam,fscreen+"top=0,left=0,width=100,height=100,toolbar=0,resizable=0,directories=0,status=0,menubar=0,scrollbars=0");
 webcamWin.resizeTo(width,height);
}

function NFenetre(nom,url,tW,tH)
{
 var scrolls = 1, resizable = 1, rapport = 0;
 rapport = tW/tH;
 if(screen.width<tW)
 {
  tW=screen.width+10;
  if(navigator.appVersion.indexOf("MSIE 6"))
  {
    tH = (tW-10) / rapport;
  }
  scrolls=1;
  resizable = 1;
 }
 if(screen.height<tH)
 {
  tH=screen.height;
  if(navigator.appVersion.indexOf("MSIE 6"))
  {
    tW = tH * rapport +10;
  }
  scrolls=1;
  resizable = 1;
 }
 window.open(url,nom,"width="+tW+",height="+tH+",toolbar=0,resizable="+resizable+",directories=0,status=0,menubar=0,scrollbars="+scrolls);
}

function ICQLite()
{
 var leftpos = (screen.availWidth - 200)-40;
 resiz = (navigator.appName=="Netscape") ? 0 : 1;
 window.open("http://lite.icq.com/icqlite/web/0,,,00.html", "TOFI","width=177,height=446,top=40,left="+leftpos+",directories=no,location=no,menubar=no,scroll=no,status=no,titlebar=no,toolbar=no,resizable="+resiz+"");
}

function ShowHide(cible_, imgCible, imgOpen, imgClose)
{
 var i=0;
 cibles = cible_.split(',');
 while(cible=cibles[i])
 {
    objCible = eval(cible)
    objImgCible = eval(imgCible)
    if(objCible.style.display=="none")
    {
        objCible.style.display="";
        objImgCible.src=imgClose;
        objImgCible.title="Masquer";
    }
    else
    {
        objCible.style.display="none";
        objImgCible.src=imgOpen;
        objImgCible.title="Montrer";
    }
    i++;
 }
}

function setCookie(nom, valeur, expir)
{
  var ExpireDate = new Date ();
  ExpireDate.setTime(ExpireDate.getTime()+expir);
  document.cookie = nom+"="+escape(valeur)+"; expires=" + ExpireDate.toGMTString();
}