/* Demande d'affichage d'une fenêtre au niveau du front office */
function ouvrirFenetrePlan(url, nom) {
   window.open(url, nom, "width=520,height=500,scrollbars=yes,status=yes,resize=yes");
}

/* Permet l'ajout de favori dans Internet Explorer */
function ajoutFavoris(lienFavoris) {
	browserName = navigator.appName;
	browserVer = parseInt(navigator.appVersion);
	
	if (browserName == "Microsoft Internet Explorer" & browserVer >= 4) {
		window.external.AddFavorite(location.href, document.title);
	} else {
		window.location.href = lienFavoris;
	}
	
}

// Fonction d'ouverture et d'alimentation du pop-up avec une image
function afficheImageSurMesure(source, titre, largeur, hauteur) {
	
	if (titre.length <= 0) {
		titre = "photo";
	}
	
	affichage = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">';

	// Code html du pop-up
	affichage += '<html><head><title>' + titre + '</title></head><body onload="window.focus();">';

	// On appelle la source de l'image correspondant a l'emplacement et au numero de lot
	affichage += '<img src="' + source + '" alt="' + titre + '" />';
	affichage += '</body></html>';

	// Préparation 
	var props = 'width='+ largeur + ', height=' + hauteur + ',status=no,directories=no,toolbar=no,location=no,menubar=no,scrollbars=yes,resizable=yes';

	// Ouverture du pop-up
	pop = window.open('', titre, props);

	// Insertion du code HTML du pop-up
	pop.document.write(affichage);

	// Nettoyage du pop-up
	pop.document.close();
}
