
function refreshGoTop() {
	// Masque ou affiche le lien "top" en fonction de la taille de la fenêtre
	if(document.getElementById('gotop')) {
		h_body = (getSize(document.getElementById('body'))).h;
		document.getElementById('gotop').style.visibility = (h_body > getWindowHeight() ? "visible" : "hidden");
	}

}



function bookmark() {
	// Fonction d'ajout de bookark (navigateur)
	if(nav['Name'] == "Internet Explorer" && nav['Version'] >=4)
		window.external.AddFavorite(window.location + "", document.title);
	else if(nav['Name'] == "Safari") 
		alert("Hit COMMAND+D to bookmark this site.");
	else
		alert("Hit CTRL+D to bookmark this site.");
}


function showID(id) {
	// Affiche l'élément id
	if(document.getElementById(id))
		document.getElementById(id).style.display = "block";
}


function maskID(id) {
	// Masque l'élément id
	if(document.getElementById(id))
		document.getElementById(id).style.display = "none";
}






// FONCTIONS UTILISEES POUR LES TAILLES / LE POSITIONNEMENT D'ELEMENTS //

function getWindowHeight() {
	// Retourne la hauteur de la fenêtre
	var windowHeight = 0;
	if(typeof(window.innerHeight)=='number')
		windowHeight = window.innerHeight;
	else if(document.documentElement && document.documentElement.clientHeight)
		windowHeight = document.documentElement.clientHeight;
	else if(document.body && document.body.clientHeight)
		windowHeight = document.body.clientHeight;
	return windowHeight;
}
function getDocumentHeight() {
	return getWindowHeight();
}

function getWindowWidth() {
	// Retourne la largeur de la fenêtre
	var windowWidth = 0;
	if(typeof(window.innerWidth)=='number')
		windowWidth = window.innerWidth;
	else if(document.documentElement && document.documentElement.clientWidth)
		windowWidth = document.documentElement.clientWidth;
	else if(document.body && document.body.clientWidth)
		windowWidth = document.body.clientWidth;
	return windowWidth;
}
function getDocumentWidth()	{
	return getWindowWidth();
}


function getPosition(element) {
	// Retourne la position de l'objet envoyé en paramètre
	var elem=element, tagname="", x=0, y=0;
  
	while ((typeof(elem)=="object") && (typeof(elem.tagName)!="undefined")) {
		y+=elem.offsetTop;
		x+=elem.offsetLeft;
		tagname=elem.tagName.toUpperCase();

		if(tagname=="BODY")
			elem=0;

		if(typeof(elem)=="object")
			if (typeof(elem.offsetParent)=="object")
				elem=elem.offsetParent;
	}

	position = new Object();
	position.x = x;
	position.y = y;
	return position;
}

// Retourne la position de l'objet envoyé en paramètre
function getPosition2(element) {
	var elem=element, tagname="", x=0, y=0;
  
	y+=elem.offsetTop;
	x+=elem.offsetLeft;

	position = new Object();
	position.x = x;
	position.y = y;
	return position;
}




// Retourne la taille de l'objet envoyé en paramètre
function getSize(element) {
	var elem=element, w=0, h=0;

	w+=elem.offsetWidth;
	h+=elem.offsetHeight;

	position = new Object();
	position.w = w;
	position.h = h;
	return position;
}



