// JavaScript Document

function MM_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}

function twValide_char(nChamp,nAccepte,nbr) {
  var ok = "oui";
  var min = "oui";
  var nChar;
  for (var i=0; i<nChamp.value.length; i++) {
    nChar = "" + nChamp.value.substring(i, i+1);
    if (nAccepte.indexOf(nChar) == "-1") ok = "non";
  }
  if (ok == "non") {
    alert("\nErreur !\ Seulement les caractères suivant sont acceptés :\n "+nAccepte);
    nChamp.focus();
    nChamp.select();
  }

}

<!--
function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' doit contenir une adresse email.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- Le champ '+nm+' doit contenir une adresse email valide.\n'; }
  } if (errors) alert('Erreur :\n'+errors);
  document.MM_returnValue = (errors == '');
}
//-->

<!--


function Affiche_OBJ(){
var Arg = arguments; // Récup liste des arguments passée à la fonction
var Obj;
for( var i=0; i< Arg.length; i++){ // On parcours la liste
Obj = document.getElementById( Arg[i]); // Récup Objet correspondant
if( Obj){
Obj.style.visibility = "visible";
document.body.style.overflow = "hidden";


//-- Ou autre méthode
Obj.style.display = "";
 }
 }
 }

function Masque_OBJ(){
var Arg = arguments; // Récup liste des arguments passée à la fonction
var Obj;
for( var i=0; i< Arg.length; i++){ // On parcours la liste
Obj = document.getElementById( Arg[i]); // Récup Objet correspondant
if( Obj){
Obj.style.visibility = "hidden";
document.body.style.overflow = "auto";
Obj.style.margin = "0"
//-- Ou autre méthode
Obj.style.display = "none";
}
}
}









var Onerotate_delay = 4000; // delay in milliseconds (5000 = 5 secs)
Onecurrent = 0;

function Onenext() {
if (document.Oneslideform.Oneslide[Onecurrent+1]) {
document.images.Oneshow.src = document.Oneslideform.Oneslide[Onecurrent+1].value;
document.Oneslideform.Oneslide.selectedIndex = ++Onecurrent;
   }
else Onefirst();
}
function Oneprevious() {
if (Onecurrent-1 >= 0) {
document.images.Oneshow.src = document.Oneslideform.Oneslide[Onecurrent-1].value;
document.Oneslideform.Oneslide.selectedIndex = --Onecurrent;
   }
else Onelast();
}
function Onefirst() {
Onecurrent = 0;
document.images.Oneshow.src = document.Oneslideform.Oneslide[0].value;
document.Oneslideform.Oneslide.selectedIndex = 0;
}
function Onelast() {
Onecurrent = document.Oneslideform.Oneslide.length-1;
document.images.Oneshow.src = document.Oneslideform.Oneslide[Onecurrent].value;
document.Oneslideform.Oneslide.selectedIndex = Onecurrent;
}
function Oneap(text) {
document.Oneslideform.Oneslidebutton.value = (text == "Stop") ? "Start" : "Stop";
Onerotate();
}
function Oneap2(text) {
document.Oneslideform.Oneslidebutton2.value = (text == "Start") ? "Stop" : "Start";
Onerotate();
}
function Onechange() {
Onecurrent = document.Oneslideform.Oneslide.selectedIndex;
document.images.Oneshow.src = document.Oneslideform.Oneslide[Onecurrent].value;
}
function Onerotate() {
if (document.Oneslideform.Oneslidebutton2.value == "Stop") {
Onecurrent = (Onecurrent == document.Oneslideform.Oneslide.length-1) ? 0 : Onecurrent+1;
document.images.Oneshow.src = document.Oneslideform.Oneslide[Onecurrent].value;
document.Oneslideform.Oneslide.selectedIndex = Onecurrent;
window.setTimeout("Onerotate()", Onerotate_delay);
}
}


function validbutton1()
{
window.open("/options/calendrier.asp?origine=date","calendrier","width=310,height=230,top=120,left=120");
}










function delfi(File) {
	if (confirm("Voulez vous supprimer " + File + " ?")) {
		window.location.href = "/ftp/sample.asp?Act=delfi&File=" + File;
	}
}
function delfo(Folder) {
	if (confirm("Voulez vous supprimer " + Folder + " ?")) {
		window.location.href = "/ftp/sample.asp?Act=delfo&Folder=" + Folder;
	}
}
function rename(File) {
	var NewName = prompt("Renommer :", File)
	if (NewName) {
		window.location.href = "/ftp/sample.asp?Act=ren&OldName=" + File + "&NewName=" + NewName;
	}
}
function mkdir() {
	var NewFolder = prompt("Créer le dossier :", "Nouveau Dossier")
	if (NewFolder) {
		window.location.href = "/ftp/sample.asp?Act=mkdir&Folder=" + NewFolder;
	}
}

function download(File) {
	window.open("/ftp/progress.asp?Key=<%=Session.SessionID %>", "", "HEIGHT=220,WIDTH=400,toolbar=0,location=0,directories=0,status=0, scrollbars=0,resizable=0,menubar=0");
	window.location.href = "/ftp/sample.asp?Act=downbrowser&File=" + File;
}
function downserver(File) {
	var ToFolder = prompt("Enter the local path:", "C:\\")
	if (ToFolder.charAt(ToFolder.lenght - 1) != "\\") {ToFolder = ToFolder + "\\"}
	if (ToFolder) {
		window.open("/ftp/progress.asp?Key=<%=Session.SessionID %>", "", "HEIGHT=220,WIDTH=400,toolbar=0,location=0,directories=0,status=0, scrollbars=0,resizable=0,menubar=0");
		window.location.href = "/ftp/sample.asp?Act=downserver&File=" + File + "&To=" + ToFolder;
	}
}
function downfolserver(Folder) {
	var ToFolder = prompt("Enter the local path:", "C:\\")
	if (ToFolder.charAt(ToFolder.lenght - 1) != "\\") {ToFolder = ToFolder + "\\"}
	if (ToFolder) {
		window.open("/ftp/progress.asp?Key=<%=Session.SessionID %>", "", "HEIGHT=220,WIDTH=400,toolbar=0,location=0,directories=0,status=0, scrollbars=0,resizable=0,menubar=0");
		window.location.href = "/ftp/sample.asp?Act=downfolserver&Folder=" + Folder + "&To=" + ToFolder;
	}
}
function upload() {
	var File = prompt("Enter the file path:", "C:\\TEST.ASP")
	if (File) {
		window.open("/ftp/progress.asp?Key=<%=Session.SessionID %>", "", "HEIGHT=220,WIDTH=400,toolbar=0,location=0,directories=0,status=0, scrollbars=0,resizable=0,menubar=0");
		window.location.href = "/ftp/sample.asp?Act=upload&Path=<%=strDir %>&File=" + File;
	}
}
function uploadfol() {
	var Folder = prompt("Enter the folder path:", "C:\\TEST")
	if (Folder) {
		window.open("/ftp/progress.asp?Key=<%=Session.SessionID %>", "", "HEIGHT=220,WIDTH=400,toolbar=0,location=0,directories=0,status=0, scrollbars=0,resizable=0,menubar=0");
		window.location.href = "/ftp/sample.asp?Act=uploadfol&Path=<%=strDir %>&Folder=" + Folder;
	}
}
function uploader() {
	newWin = window.open("/ftp/uploader.asp", "", "HEIGHT=220,WIDTH=400,toolbar=0,location=0,directories=0,status=0, scrollbars=0,resizable=0,menubar=0,border=0")
newWin.document.getElementsByTagName("body")[0].style.margin = 0;
	
	if (newWin.opener == null) {
		window.open("/ftp/progress.asp?Key=<%=Session.SessionID %>", "", "HEIGHT=220,WIDTH=400,toolbar=0,location=0,directories='0',status='0', scrollbars=0,resizable=0,menubar='0'");
		newWin.opener = window;
	}
}







