// JavaScript Document
var active = "who_we_are";

startList = function() {
	init();
	// code for IE
	if(!document.body.currentStyle) return;
	var subs = document.getElementsByName('submenu');
	for(var i=0; i<subs.length; i++) {
		var li = subs[i].parentNode;
		if(li && li.lastChild.style) {
			li.onmouseover = function() {
				this.lastChild.style.visibility = 'visible';
			}
			li.onmouseout = function() {
				this.lastChild.style.visibility = 'hidden';
			}
		}
	}
}

window.onload=startList;

function init()
{
  base = getFileName();
  if ((base == "/")||(base == "index")) {
    base = active
  } else {
	 setInactive();
	}
	setActive(base);
}

function setActive(base)
{
setBackGroundImage((base+"_left"), "images/active_menu_button_left.gif");
setBackGroundImage((base+"_right"), "images/active_menu_button_right.gif");
setBackGroundImage((base+"_btn"), "images/active_menu_button_center.jpg");

active = base;
}

function setInactive()
{
setBackGroundImage((active+"_left"), "images/inactive_menu_button_left.gif");
setBackGroundImage((active+"_right"), "images/inactive_menu_button_right.gif");
setBackGroundImage((active+"_btn"), "images/inactive_menu_button_center.gif");
}

function setBackGroundImage (id, imageURL) {
try {
if (document.layers)
{
document[id].background.src = imageURL == 'none' ? null : imageURL;
}
else if (document.all)
{
document.all[id].style.backgroundImage = imageURL == 'none' ? 'none'
: 'url(' + imageURL + ')';
}
else if (document.getElementById)
{
document.getElementById(id).style.backgroundImage = imageURL ==
'none' ? 'none' : 'url(' + imageURL + ')';
}
} catch(error) {

}
}

function getFileName() {
return file_name_only(window.location.pathname);
}

function file_name_only(str) {
var slash = '/';
if (str.match(/\\/)) {
     slash = '\\';
}
return str.substring(str.lastIndexOf(slash) + 1, str.lastIndexOf('.'));
}
