var alm = '';

function gtit(r) {
	var _x = 0;
	var _l = r - 1;
	_x = _l * 20 + 27;
	return _x;
}

function glit(w) {
	var _m = 0;
	var _w = '';	
	for ( var j = 0; j < w.length; j++) {
		if (w[j].length > _m) {
			_w = w[j];
			_m = w[j].length;
		}
	}
	return glit2(_w);
}

function glit2(w) {
	var _x = 0;
	if (w.length != 0 && w.length < 15)
		_x = 30;
	for ( var a = 0; a < w.length; ++a) {
		var _ai = w.charAt(a);
		if (_ai >= 97 && _ai <= 122) { _x += 5; } else { if (_ai >= 65 && _ai <= 90) { _x += 6; } else { if (_ai == '32') { _x += 3; } else { if (_ai == '105') { _x -= 4; } else { if (_ai == '108') {  _x -= 4; } else { if (_ai == '73') { _x -= 6;} else { _x += 5; }}}}}}_x += 3; }	
	return _x;
}

function ov(div, u) {
	div.style.background = 'url(' + u + ')';
}

function om(div, u) {
	div.style.background = 'url(' + u + ')';
}

function ov(div) {
	// div.style.background = "#2CA9E1";
	 div.style.background = "#DDDDDD";	
	div.style.color = "#A54D9B";
	/*div.style.background = "#D5D4D4";
	div.style.border = "1px solid";
	div.style.bordercolor =  "#A74A9B";*/
}

function ot(div) {
	div.style.background = "#414143";		
	div.style.color = "#FFFFFF";
	/*div.style.border = "0px";*/
}

function vsb(i) {
	_a = i.split("-");
	if (_a.length > 1) {
		_l = _a.length;
		for ( var x = 0; x < _l; ++x) {
			if (ival(_a[x])) {
				vw(_a[x]);
			}
		}
	} else {
		vw(i);
	}
}

function hasm() {
	if (alm != '') {
		_ah = alm.split("-");
		_lh = _ah.length;
		for ( var i = 0; i < _lh; ++i) {
			var _if = 'ifr' + _ah[i];
			document.getElementById(_if).style.display = "none";
			document.getElementById(_ah[i]).style.display = "none";
		}
	}
}

function ival(i) {
	var _e = false;
	_aam = alm.split("-");
	for ( var n = 0; n < _aam.length; ++n) {
		if (_aam[n] == i) {
			_e = true;
		}
	}
	return _e;
}

function vw(id) {
	var _if = 'ifr' + id;
	var DivRef = document.getElementById(id);
	var IfrRef = document.getElementById(_if);
	DivRef.style.display = "block";
		
	DivRef.style.border = "1px solid";
	DivRef.style.bordercolor =  "#A74A9B";
	
	IfrRef.style.width = DivRef.offsetWidth;
	IfrRef.style.height = DivRef.offsetHeight;
	IfrRef.style.top = DivRef.style.top;
	IfrRef.style.left = DivRef.style.left;
	IfrRef.style.display = "block";
}

function sm(ct, at, wt, al) {
	var _h;
	if (wt == 0) {		
		_h = "";
	}
	_h = "<div style=\"position:absolute;cursor: pointer;top: "
			+ ct[2]
			+ ";left: "
			+ ct[3]
			+ "px;width: "
			+ wt
			+ "\px;text-align: center;background-color: #002539; display: none;z-index:100;\" onmouseover=\"vsb('"
			+ ct[1] + "\');\" onmouseout=\"hasm();\" id=\""
			+ ct[0] + "\">";
	for ( var j = 0; j < at.length; j++) {
		_h += "<div class=\"menuItem\" onmouseover=\"ov(this)\" onmouseout=\"ot(this)\"><div onclick=\"location.href='"
				+ al[j]
				+ "\';hasm();\" class=\"menuItemLink\">"
				+ at[j] + "</div></div>";
	}
	_h += "</div>";
	document.write(_h);
}

hasm();

function imme(param) {
	_ah = alm.split("-");
	_lh = _ah.length;
	for ( var i = 0; i < _lh; ++i) {
		var _h = "<iframe id=\"ifr"
				+ _ah[i]
				+ "\" scrolling=\"no\" frameborder=\"0\" style=\"position:absolute;display:none;width:0;height:0\"></iframe>";
		document.write(_h);
	}
}

