/**
* @version $Id: common.js 3997 2006-06-12 03:59:51Z spacemonkey $
* @copyright Copyright (C) 2005 - 2006 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/

/**
 * Common javascript funtionality for menus
 *
 * @author		Jean Philippe Bigois <jeanphilippe.bigois@valsdesaintonge.org>
 * @package		Joomla
 * @since		1.5
 * @version     1.0
 */
 
/* -------------------------------------------- */
/* -- Browser information --------------------- */
/* -------------------------------------------- */
Browser = new Object();
Browser.agt     = navigator.userAgent.toLowerCase();
Browser.is_ie	= ((Browser.agt.indexOf("msie") != -1) && (Browser.agt.indexOf("opera") == -1));

/* -------------------------------------------- */
/* -- Menus roll over function ---------------- */
/* -------------------------------------------- */
<!--//--><![CDATA[//><!--

sfCharmeHover = function() {

var sfEls = document.getElementById("charme").getElementsByTagName("LI");
for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfCharmeHover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfCharmeHover\\b"), "");
		}
	}
}

sfAirhover = function()	{

var sfEls = document.getElementById("air").getElementsByTagName("LI");
for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfAirhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfAirhover\\b"), "");
		}
	}
}

sfCheminhover = function()	{

var sfEls = document.getElementById("chemin").getElementsByTagName("LI");
for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfCheminhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfCheminhover\\b"), "");
		}
	}
}

sfHistoirehover = function()	{

var sfEls = document.getElementById("histoire").getElementsByTagName("LI");
for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfHistoirehover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfHistoirehover\\b"), "");
		}
	}
}

sfPatrihover = function()	{

var sfEls = document.getElementById("patri").getElementsByTagName("LI");
for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfPatrihover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfPatrihover\\b"), "");
		}
	}
}

sfPierrehover = function()	{

var sfEls = document.getElementById("pierre").getElementsByTagName("LI");
for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfPierrehover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfPierrehover\\b"), "");
		}
	}
}

if (window.attachEvent) window.attachEvent("onload", sfCharmeHover);
if (window.attachEvent) window.attachEvent("onload", sfAirhover);
if (window.attachEvent) window.attachEvent("onload", sfCheminhover);
if (window.attachEvent) window.attachEvent("onload", sfHistoirehover);
if (window.attachEvent) window.attachEvent("onload", sfPatrihover);
if (window.attachEvent) window.attachEvent("onload", sfPierrehover);

//--><!]]>