//check whether the browser supports the W3C DOM
var lang_W3CDOM = (document.createElement && document.getElementsByTagName);

//serve to store all images related to the mouseovers
var lang_mouseOvers = new Array();
var lang_mouseOuts = new Array();

//window.onload = lang_Finit;

function lang_Finit()
{
	//If the browser doesn't support the W3C DOM we end it immediately
	if (!lang_W3CDOM) return;
	
	//take all <img> elements that are descendants of the element with id="mouseovers"
	var lang_nav = document.getElementById('lang_FMouseOvers');
	var lang_imgs = lang_nav.getElementsByTagName('img');
	
	//loop through all <img> tags
	for (var i=0;i<lang_imgs.length;i++)
	{
		//Each <img> tag receives a mouseover and a mouseout event handler,
		//so that it executes the necessary script onMouseOver and onMouseOut
		lang_imgs[i].onmouseover = lang_fMouseGoesOver;
		lang_imgs[i].onmouseout = lang_fMouseGoesOut;
		
		//store the normal image and the mouseover image in their respective arrays
		//The normal image has already been loaded, but the browser now fetches 
		//the mouseover image, so that it will be available when
		//the first mouseover event takes place.
		//First we find out which suffix (.gif, .jpg, .png, whatever) the image uses
		var suffix = lang_imgs[i].src.substring(lang_imgs[i].src.lastIndexOf('.'));
		
		//create an entry in the mouseOuts array and store an Image object with a src property
		lang_mouseOuts[i] = new Image();
		lang_mouseOuts[i].src = lang_imgs[i].src;
		
		//create an entry in the mouseOvers array and do the same
		//Since the script knows that the only difference between the names of the normal
		//and the mouseover images is the _omo bit, we can easily concatenate the name of
		//the mouseover image
		lang_mouseOvers[i] = new Image();
		lang_mouseOvers[i].src = lang_imgs[i].src.substring(0,lang_imgs[i].src.lastIndexOf('.')) + "_omo" + suffix;
		
		//add a number property to the <img> tag itself that will serve to 
		//retrieve the correct mouseover and mouseout images from our two arrays
		lang_imgs[i].number = i;
	}
}

function lang_fMouseGoesOver()
{
	this.src = lang_mouseOvers[this.number].src;
}

function lang_fMouseGoesOut()
{
	this.src = lang_mouseOuts[this.number].src;
}

function lang_fTogglein(myId)
{
  thisId=document.all(myId);
  thisId.style.display = ""; // show normally
  
}

function lang_fToggleout(myId)
{
   thisId=document.all(myId);
   thisId.style.display = "none"; // hidden
}

