//======================================================================================
//--- Fonctions génériques
//======================================================================================
/**
 * Retourne la lettre associée au lecteur local
 */
function getDriveLetter() {
	var re = /file:\/\/\/([A-Z]+):\//i;
	var path_info = re.exec(document.location.href);
	return path_info[1];
} // end of 'getDriveLetter()'

/**
 * Verifie que la chaine passée n'est pas une chaine vide
 *
 * @param	string strSaisie	Chaine de caractère
 * @return	boolean				Retourne false si elle est vide, true dans la cas contraire
 */
function isBlank(strSaisie) {
	var iSaisie = 0;
	var strBlank = ""

	if (strSaisie != "") {
		for (i=0; i < strSaisie.length; i++)
			if (strSaisie.charAt(i) != ' ') iSaisie = 1;
		if (iSaisie == 1)
			return false;
	}
	return true;
}

/**
 * Verifie la validité d'une adresse email (presence d'un @ puis d'un .
 *
 * @param	string strSaisie	Adresse email à vérifier
 * @return	boolean				Retourne true si c'est une adresse email, false dans le cas contraire
 */
function isEmail(strSaisie) {
	a = strSaisie.indexOf("@");
	if ( a != -1 ) {
		p = strSaisie.indexOf(".", a);
		if ( p != -1 )
			return true;
	}
	return false;
}

/**
 * Verifie si un objet de type radio ou checkbox a au moins un element selectionné
 *
 * @param	object obj	Input de type radio ou checkbox d'un formulaire
 * @return	boolean		Retourne true si un element au moins est selectionné false dans le cas contraire
 * @author				David Duret
 * @created				2002-06-12
 */
function isChecked(obj) {
	for ( var i = 0; i < obj.length; i++ ) {
		if ( typeof(checked) == 'undefined' ) checked = false;
		checked = ( obj[i].checked || checked );
	}
	return checked
}

//======================================================================================
//--- Gestion des slideshow pour les photos
//======================================================================================
/*
DHTML slideshow script- 
© Dynamic Drive (www.dynamicdrive.com)
For full source code, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
*/

var photos=new Array()
var photoslink=new Array()
var which=0


//Specify whether images should be linked or not (1=linked)
var linkornot=0

//Set corresponding URLs for above images. Define ONLY if variable linkornot equals "1"
photoslink[0]=""
photoslink[1]=""
photoslink[2]=""
photoslink[3]=""
photoslink[4]=""

//do NOT edit pass this line

var preloadedimages=new Array()
for (i=0;i<photos.length;i++){
	preloadedimages[i]=new Image()
	preloadedimages[i].src=photos[i]
}

function applyeffect(){
	if (document.all){
		photoslider.filters.revealTrans.Transition=Math.floor(Math.random()*23)
		photoslider.filters.revealTrans.stop()
		photoslider.filters.revealTrans.apply()
	}
}

function playeffect(){
	if (document.all)
		photoslider.filters.revealTrans.play()
}

function keeptrack(){
	window.status="Image "+(which+1)+" of "+photos.length
}


function backward(){
	if (which>0){
		which--
		applyeffect()
		document.images.photoslider.src=photos[which]
		playeffect()
		keeptrack()
	}
}

function forward(){
	if (which<photos.length-1){
		which++
		applyeffect()
		document.images.photoslider.src=photos[which]
		playeffect()
		keeptrack()
	}
}

function transport(){
	window.location=photoslink[which]
}
