/*	orbite.js
	Copyleft Tancrède Bastié 2005-2008

requires :
	dom.js
	js_lib.js
*/

addLoadEvent(
	function () {
		/*	No, I need not viagra.
			Non, je n'ai pas besoin de viagra.
		*/
		var subject = document.getElementsByTagName("title")[0].firstChild;

		if (subject != null) subject = subject.nodeValue;
		// Let us face IE odd DOM.
		// Faisons face au bizarre DOM de IE.
		else subject = "Sur orbite...";

		var c = new Array(109, 97, 105, 108, 116, 111, 58, 111, 114, 98, 105, 116, 101, 49, 64, 111, 114, 98, 105, 116, 101, 46, 105, 110, 102, 111, 63, 115, 117, 98, 106, 101, 99, 116, 61);
		var s = "";
		for (var i = 0; i < c.length; i++) s += String.fromCharCode(c[i]);

		var ul = document.getElementById("menu");
		var li = document.createElement("li");
		var anchor = document.createElement("a");
		anchor.href = s + subject;
		anchor.appendChild(img("http://www.orbite.info/contact.gif", "Enveloppe", "Contact", 21, 16));
		anchor.appendChild(textNode("\u00A0Contact"));
		appendTo(li, anchor);
		ul.appendChild(li);

		/*	Link to parent also benefits from a cuty icon.
			Le lien vers le parent bénéficie aussi d'une petite icône.
		*/
		var parent = document.getElementById("parent");
		if (parent != null) {
			parent.insertBefore(textNode("\u00A0"), parent.firstChild);
			parent.insertBefore(img("http://www.orbite.info/up.gif", "Flèche vers le haut", "Vers le niveau supérieur", 17, 18), parent.firstChild);
		}

		/*	Every anchor or form of class 'newWindow' will open in a new window.
			Toutes les ancres et les formulaires de la classe "newWindow" s'ouvriront dans une nouvelle fenêtre.
		*/
		readyNewWindowAnchors();
	}
);
