﻿<!--
// THE WEB OBJECTS TOOL LIBRARY 1.0 - POWERED BY THE-E-GHOST
// Script calendriers initialise par http://www.toutjavascript.com
// Conception par http://the-e-ghost.com - Septembre 2006
// Reproduction gratuite a condition de laisser ce commentaire

// *******************************************************************************************************************************
// BIBLIOTHEQUE DES FUNCTIONS GENERIQUES *****************************************************************************************
// Ecriture dans le document
function d(content) {
	window.document.write(content);
}
// Ecriture dans un calque
function displayTarget(content,target) {
    document.getElementById(target).innerHTML			= content;
}
// Assignation d'une valeur a un element
function valueTarget(value,target) {
    document.getElementById(target).value				= value;
}
// Assignation visibilite heritee a un element
function showTarget(target) {
	document.getElementById(target).style.visibility 	= '';
}
// Assignation visibilite hidden a un element
function hideTarget(target) {
	document.getElementById(target).style.visibility 	= 'hidden';
}
// Positionnement horizontal d'un calque
function leftTarget(target,value) {
	document.getElementById(target).style.left 			= value;
}
// Positionnement vertical d'un calque
function topTarget(target,value) {
	document.getElementById(target).style.top 			= value;
}
// Assignation d'une largeur a un calque
function widthTarget(target,value) {
	document.getElementById(target).style.width 		= value;
}
// Assignation d'une hauteur a un calque
function heightTarget(target,value) {
	document.getElementById(target).style.height 		= value;
}
// Positionnement vertical d'un calque avec scroll
function topTargetWithScroll(target,value) {
	dimTop 		= getTop(target);
	deltaTop	= (dimTop - value)/scrollAcc;
	if (Math.abs(deltaTop) < 1) {
		topTarget(target,value);
	} else {
		topTarget(target,dimTop-deltaTop); 
		setTimeout('topTargetWithScroll(\''+target+'\','+value+')',timerPas);
	}
}
// Positionnement horizontal d'un calque avec scroll
function leftTargetWithScroll(target,value) {
	dimLeft		= getLeft(target);
	deltaLeft	= (dimLeft - value)/scrollAcc;
	if (Math.abs(deltaLeft) < 1) {
		leftTarget(target,value);
	} else {
		leftTarget(target,dimLeft-deltaLeft); 
		setTimeout('leftTargetWithScroll(\''+target+'\','+value+')',timerPas);
	}
}
// Asignation d'une largeur de calque avec scroll
function widthTargetWithScroll(target,value) {
	dimWidth	= getWidth(target);
	deltaWidth	= (dimWidth - value)/scrollAcc;
	if (Math.abs(deltaWidth) < 1) {
		widthTarget(target,value);
	} else {
		widthTarget(target,dimWidth-deltaWidth); 
		setTimeout('widthTargetWithScroll(\''+target+'\','+value+')',timerPas);
	}
}
// Assignation d'une hauteur de calque avec scroll
function heightTargetWithScroll(target,value) {
	dimHeight	= getHeight(target);
	deltaHeight	= (dimHeight - value)/scrollAcc;
	if (Math.abs(deltaHeight) < 1) {
		heightTarget(target,value);
	} else {
		heightTarget(target,dimHeight-deltaHeight); 
		setTimeout('heightTargetWithScroll(\''+target+'\','+value+')',timerPas);
	}
}
// Redimensionnement H, L, X, Y d'un calque avec scroll
function resizeAllWithScroll(target,topValue,leftValue,widthValue,heightValue) {
	dimTop		= getTop(target);
	dimLeft 	= getLeft(target);
	dimWidth 	= getWidth(target);
	dimHeight 	= getHeight(target);
	deltaTop	= (dimTop - topValue)/scrollAcc;
	deltaLeft	= (dimLeft - leftValue)/scrollAcc;
	deltaWidth	= (dimWidth - widthValue)/scrollAcc;
	deltaHeight	= (dimHeight - heightValue)/scrollAcc;
	if (getMax(Math.abs(deltaTop),Math.abs(deltaLeft),Math.abs(deltaWidth),Math.abs(deltaHeight)) < 1) {
		topTarget(target,topValue);
		leftTarget(target,leftValue);
		widthTarget(target,widthValue);
		heightTarget(target,heightValue);
	} else {
		topTarget(target,dimTop-deltaTop); 
		leftTarget(target,dimLeft-deltaLeft); 
		widthTarget(target,dimWidth-deltaWidth); 
		heightTarget(target,dimHeight-deltaHeight); 
		setTimeout('resizeAllWithScroll(\''+target+'\','+topValue+','+leftValue+','+widthValue+','+heightValue+')', timerPas);
	}
}
// Assignation d'une valeur de z index a un calque
function zindexTarget(target,value) {
	document.getElementById(target).style.zIndex = value;
}
// Recuperation de la largeur de la fenetre du navigateur
function getScreenWidth() {
	screenWidth = getWidth('ecran');
	return screenWidth;
}
// Recuperation de la hauteur de la fenetre du navigateur
function getScreenHeight() {
	screenHeight = getHeight('ecran');
	return screenHeight;
}
// Recuperation de la position top du calque
function getTop(target) {
	value = document.getElementById(target).offsetTop;
	return value;
}
// Recuperation de la position left du calque
function getLeft(target) {
	value = document.getElementById(target).offsetLeft;
	return value;
}
// Recuperation de la largeur du calque
function getWidth(target) {
	value = document.getElementById(target).offsetWidth;
	return value;
}
// Recuperation de la hauteur de calque
function getHeight(target) {
	value = document.getElementById(target).offsetHeight;
	return value;
}
// Recherche de la valeur maxi d'une serie de valeur
function getMax(val1) {
	argv		= getMax.arguments;
	argc		= getMax.arguments.length;
	maxVal		= val1;
	i 			= 1;
	while(i < argc) {
		if (argv[i] > maxVal)	maxVal=argv[i];
		i++;
	}
	return maxVal;
}
// Recherche de la valeur mini d'une serie de valeur
function getMin(val1) {
	argv		= getMin.arguments;
	argc		= getMin.arguments.length;
	minVal		= val1;
	i 			= 1;
	while(i < argc) {
		if (argv[i] < minVal)	minVal=argv[i];
		i++;
	}
	return minVal;
}
-->