var LAY = "";	//Layer containing the menu-items
var root = "/";

function switchMenu(mImg, strBehind){
	document.getElementById(mImg).src = root + "images/" + lng + "/menu/sec/" + mImg + strBehind + ".jpg";
}

sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("li");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

function s(first, last, text){
if (text=="")
	{
document.write('<A href="' + 'mailto:' + first + '@' + last + '">' + first + '[AT]' + last + '</A>');
}
else
	{
document.write('<A href="' + 'mailto:' + first + '@' + last + '">' + text + '</A>');
}
}

function makeLayer(idMenu, idLink, name, layerID){
	tmpLay = "<LI id=\"l" + layerID + "\">\n  <A href=\"" + eval('idLink[0]') + "\" onmouseover=\"switchMenu('" + name + "','on');\" onmouseout=\"switchMenu('" + name + "','');\">\n";
	tmpLay += "<IMG src=\""+ root + "images/" + lng + "/menu/sec/" + name + ".jpg\" width=\"105\" height=\"27\" id=\"" + name + "\" alt=\"" + eval('idMenu[0]') + "\">\n";
	tmpLay += "</A><UL>\n";
	for(var i=1;i <= idMenu.length - 1;i++) if (idMenu.length != 0){
		tmpLay += "<LI><A href=\"" + eval('idLink['+i+']') + "\">" + eval('idMenu['+i+']') + "</A></LI>\n";
	}
	tmpLay += "</UL>\n</LI>\n";
	LAY += tmpLay
}

function makeMyMenu(){
	LAY = "<UL id=\"nav\">\n" + LAY + "</UL>\n";
	document.write(LAY);
}

function lg(a,b){
		window.location.href=window.location.href.replace(a,b)
}
