function SupprDossier(URL){
  var a;
  a = confirm('Etes vous sur de supprimer ce dossier ainsi que son contenu ?');
  if(a ==true) {
  window.location=URL;
  }
}

function SupprFichier(URL){
  var a;
  a = confirm('Voulez vous supprimer ce fichier ?');
  if(a ==true) {
  window.location=URL;
  }
}

function OpenWindow(popup, w, h){
  new_window = window.open(popup, "pictures", "status=no,resizable=yes,scrollbars=auto,height=420,width=600,align=left");
}

function OuvrirPopup(URL, Nom, W, H){
  var top, left, height, width;
  width = Math.min(W, screen.availWidth-25);
  height = Math.min(H, screen.availHeight-50);
  top = (screen.availHeight-25 - height)/2;
  left = (screen.availWidth-10 - width)/2;
  Fenetre = window.open(URL,Nom,'location=no,toolbar=no,directories=no,menubar=no,resizable=yes,scrollbars=yes,status=no,width=' + width + ',height=' + height + ',left=' + left + ',top=' + top + ',screenx=' + left + ',screeny=' + top);
  Fenetre.focus();
}

function OuvrirPopupSize(URL, Nom, W, H){
  var top, left, height, width;
  width = Math.min(W, screen.availWidth-25);
  height = Math.min(H, screen.availHeight-50);
  top = (screen.availHeight-25 - height)/2;
  left = (screen.availWidth-10 - width)/2;
  Fenetre = window.open(URL,Nom,'location=no,toolbar=no,directories=no,menubar=no,resizable=yes,scrollbars=yes,status=no,width=' + width + ',height=' + height + ',left=' + left + ',top=' + top + ',screenx=' + left + ',screeny=' + top);
  Fenetre.focus();
}

function OuvrirPopupNoSB(URL, Nom, W, H){
  var top, left, height, width;
  width = Math.min(W, screen.availWidth-25);
  height = Math.min(H, screen.availHeight-50);
  top = (screen.availHeight-25 - height)/2;
  left = (screen.availWidth-10 - width)/2;
  Fenetre = window.open(URL,Nom,'location=no,toolbar=no,directories=no,menubar=no,resizable=yes,scrollbars=no,status=no,width=' + width + ',height=' + height + ',left=' + left + ',top=' + top + ',screenx=' + left + ',screeny=' + top);
  Fenetre.focus();
}

function FenetreCent(url,nom,largeur,hauteur,options){
  var haut=(screen.height-hauteur)/2-40;
  var Gauche=(screen.width-largeur)/2;
  fencent=window.open(url,nom,"top="+haut+",left="+Gauche+",width="+largeur+",height="+hauteur+","+options);
}

function MM_swapImgRestore(){
  var i,x,a=document.MM_sr;
  for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)
    x.src=x.oSrc;
}

function MM_preloadImages(){
  var d=document;
  if(d.images){
    if(!d.MM_p)
      d.MM_p=new Array();
    var i, j=d.MM_p.length, a=MM_preloadImages.arguments;
    for(i=0; i<a.length; i++)
      if (a[i].indexOf("#")!=0){
        d.MM_p[j]=new Image;
        d.MM_p[j++].src=a[i];
      }
  }
}

function MM_findObj(n, d){
  var p,i,x;
  if(!d)
    d=document;
  if((p=n.indexOf("?"))>0&&parent.frames.length){
    d=parent.frames[n.substring(p+1)].document;
    n=n.substring(0,p);
  }
  if(!(x=d[n])&&d.all)
    x=d.all[n];
  for (i=0;!x&&i<d.forms.length;i++)
    x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++)
    x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById)
    x=d.getElementById(n);
  return x;
}

function MM_swapImage(){
  var i,j=0,x,a=MM_swapImage.arguments;
  document.MM_sr=new Array;
  for(i=0;i<(a.length-2);i+=3)
    if ((x=MM_findObj(a[i]))!=null){
      document.MM_sr[j++]=x;
      if(!x.oSrc)
        x.oSrc=x.src;
      x.src=a[i+2];
    }
}


function MM_jumpMenu(targ,selObj,restore){
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore)
    selObj.selectedIndex=0;
}


function MM_reloadPage(init){
  if (init==true)
    with (navigator) {
      if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
        document.MM_pgW=innerWidth; 
        document.MM_pgH=innerHeight;
        onresize=MM_reloadPage;
      }
    }
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH)
    location.reload();
}


function ClicSelectIdxImg($Obj,$Img,$DstSelect,$IdSelect,$Mod){
  $AC = Math.random();
  $Obj.src = '/pic_sel_img.php?Img='+$Img+'&DstSelect='+$DstSelect+'&IdSelect='+$IdSelect+'&Mod='+$Mod+'&'+$AC;
}


function ClicPixelAction($URL){
  $AC = Math.random();
  document.PixelAction.src = $URL+'&'+$AC;
}

function RedimensionneMaxi(){
  window.moveTo(0,0);
  window.resizeTo(screen.availWidth,screen.availHeight); 
}

function EffacerInput($Obj){
  $Obj.value = '';
  $Obj.focus();
}

function ClickPtDeVueTous(){
  if(document.form_rechercheav.PtVueTous.checked){
    document.form_rechercheav.CtrPlon.checked=false;
    document.form_rechercheav.VueAeri.checked=false;
    document.form_rechercheav.GrPlan.checked=false;
    document.form_rechercheav.VuePlon.checked=false;
  }
}

function ClickPtVue($Obj){
  if(document.form_rechercheav.PtVueTous.checked && $Obj.checked) document.form_rechercheav.PtVueTous.checked=false;
}

function ClickPerson($Obj){
  if ($Obj == document.form_rechercheav.PersTous){
    if($Obj.checked){
      document.form_rechercheav.VueExt.checked=false;
      document.form_rechercheav.VueInt.checked=false;
    }
    else
      document.form_rechercheav.VueExt.checked=true;
  }
  if ($Obj == document.form_rechercheav.VueInt){
    if($Obj.checked){
      document.form_rechercheav.VueExt.checked=false;
      document.form_rechercheav.PersTous.checked=false;
    }
    else
      document.form_rechercheav.PersTous.checked=true;
  }
  if ($Obj == document.form_rechercheav.VueExt){
    if($Obj.checked){
      document.form_rechercheav.VueInt.checked=false;
      document.form_rechercheav.PersTous.checked=false;
    }
    else
      document.form_rechercheav.PersTous.checked=true;
  }
}


