// 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 !\ Only these characters are allowed:\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+' must be a true email address.\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 += '- The field '+nm+' must be a true email address.\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";
}
}
}


function Affiche_content(){
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 = "scroll";
document.body.style.overflowX = "hidden";
Obj.style.margin = "0px 0px 0px 0px"
//-- Ou autre méthode
Obj.style.display = "";
 }
 }
 }




function Masque_content(){
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 = "scroll";
document.body.style.overflowX = "hidden";
Obj.style.margin = "0px 0px 0px 0px"
//-- 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");
}

/*---------------------------------------------CSS MENU-------------------------------------------------------------------------*/



var cssmenuids=["cssmenu1"] //Enter id(s) of CSS Horizontal UL menus, separated by commas
var csssubmenuoffset=-1 //Offset of submenus from main menu. Default is 0 pixels.

function createcssmenu2(){
for (var i=0; i<cssmenuids.length; i++){
  var ultags=document.getElementById(cssmenuids[i]).getElementsByTagName("ul")
    for (var t=0; t<ultags.length; t++){
			ultags[t].style.top=ultags[t].parentNode.offsetHeight+csssubmenuoffset+"px"
    	var spanref=document.createElement("span")
			spanref.className="arrowdiv"
			spanref.innerHTML="&nbsp;&nbsp;&nbsp;&nbsp;"
			ultags[t].parentNode.getElementsByTagName("a")[0].appendChild(spanref)
    	ultags[t].parentNode.onmouseover=function(){
					this.style.zIndex=100
    	this.getElementsByTagName("ul")[0].style.visibility="visible"
					this.getElementsByTagName("ul")[0].style.zIndex=0
    	}
    	ultags[t].parentNode.onmouseout=function(){
					this.style.zIndex=0
					this.getElementsByTagName("ul")[0].style.visibility="hidden"
					this.getElementsByTagName("ul")[0].style.zIndex=100
    	}
    }
  }
}

if (window.addEventListener)
window.addEventListener("load", createcssmenu2, false)
else if (window.attachEvent)
window.attachEvent("onload", createcssmenu2)









function delfi(File) {
	if (confirm("Do you want to delete " + File + " ?")) {
		window.location.href = "/ftp/sample.asp?Act=delfi&File=" + File;
	}
}
function delfo(Folder) {
	if (confirm("Do you want to delete " + Folder + " ?")) {
		window.location.href = "/ftp/sample.asp?Act=delfo&Folder=" + Folder;
	}
}
function rename(File) {
	var NewName = prompt("Rename the file:", File)
	if (NewName) {
		window.location.href = "/ftp/sample.asp?Act=ren&OldName=" + File + "&NewName=" + NewName;
	}
}
function mkdir() {
	var NewFolder = prompt("Rename the file:", "Nouveau Dossier")
	if (NewFolder) {
		window.location.href = "/ftp/sample.asp?Act=mkdir&Folder=" + NewFolder;
	}
}

function download(File) {
	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.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=460,WIDTH=600,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;
	}
}







