/**
 * <p>Title: Site Alpencom</p>
 * <p>Description: fichier permettant l'ajout d'un folder</p>
 * @version 1.1
 * @ modification 10/02/2006 : ajout de la fonction checkfolder()
 */

function openWin(id)
{
	w = window.open('evenement.php?id='+id,'event'+id,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=550,height=300');
}

function OpenPicture(pPlate, pTitle, pWidth, pHeight) 
{
	var lHeightWin = pHeight + 20;
	var lWidthWin = pWidth + 20;
	var lParam="toolbar=no, left=0 ,top=0 ,width=" + lWidthWin + ", height=" + lHeightWin + " , location=no ,directories=no ,status=no, menubar=no, scrollbars=no ,resizable=no"
	imgPlate = new Image();
	imgPlate.src = pPlate;
	lChild = window.open("","Plate",lParam);
	lChild.document.write("<head><title>" + pTitle + "</title></head>" );
	lChild.document.write("<body><img src=" + pPlate + " height=" + pHeight + " width=" + pWidth + "></body>" );
}


function closeWindow()
{
   close();
}

// Fonction vérifiant qu'il n'y ait pas de caractères interdit dans le nopm de répertoire
function checkFolder(pFolder)
{
	//Liste des Caractères interdits
	var CaracteresInterdits = "\`\²\%\*\,\.\?\;\:\§\!\#\$\£\¤\(\)\~\/\\\'\=\+\{\}\[\]|^@&\"\"\<\>©®ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ";

    var i=0;
	var sCaractInter = "";
    Result = true;
    fin=pFolder.length;

   //Boucle qui extrait chaque lettre de 'chaine' et qui regarde si elle correspond à un caractère interdit
    for (var i=0; i<fin; i++) 
	{
      carac = pFolder.substring(i,i+1);
      if (CaracteresInterdits.indexOf(carac)!=(-1))
		{
         Result = false;
		 sCaractInter = sCaractInter + carac + ' ';
		}
    }

   if (Result==false)alert("Following character(s) is(are) forbidden : " + sCaractInter + "\n");
   return Result;
}
