/* functions for language selection */

function showLangMessage() {
	var langMessage = "";
	var htmlH = 640;
	var langPopupBg = document.getElementById("langLBBg");
	var langPopup = document.getElementById("langLB");
	var langPopupContentText = document.getElementById("langLBContentText");
	var langPopupH = 0;
	var langPopupT = 0;

	var langAvail = langAvailable.split(",");
	if (langAvail.length == 1) {
		window.location.href = eval("applicationPath_" + langAvail[0]);
	}
	else {
		for (var i=0; i < langAvail.length; i++) {
			langMessage = langMessage + "<div class='linkHolder'><a href='javascript:void(0);' onclick='gotoCourse(this)' class='langLink' id='langLink_"+i+"' title='" + eval("langSelLanguage_" + langAvail[i]) + "'>" + eval("langSelLanguage_" + langAvail[i]) + "</a></div>";			
			langMessage = langMessage + "";
		}
		langMessage = langMessage + "";
		langPopupContentText.innerHTML = langMessage;
		langPopupH = langPopup.offsetHeight;	
		langPopupT = parseInt(htmlH / 2) - parseInt(langPopupH / 2);
		langPopup.style.top = langPopupT + "px";	
		langPopupBg.style.visibility = "visible";
	}	
}	
function gotoCourse(btn){
	var langAvail = langAvailable.split(",");
	num = Number($(btn).attr('id').substring(9));
	// eLRT Integration/Testing.
	window.parent.document.langChosen = langAvail[num];
	var path = eval("applicationPath_" + langAvail[num])
	window.location.replace(path);	
}