function toggleDispLang()
{
	var lang = getCookie('l');
	//if lang cookie not set, set it default to english.
	if (!lang)
	{
		setLangCookie('e');
		lang = 'e';
	}
	
	var classLogic = 
			{
				menuItemClass: {e: "menuitem1", a: "aramenuitem1"},
				menuTitleClass: {e: "menutitle1", a: "aramenutitle1"},
				selectLang: {e: "عربي", a: "English"},
				langDir: {e: "ltr", a: "rtl"}
			}
	// the 'sections' variable is global and set per the needs of the calling page
	//alert(sections);var sections;
	for (x in sections)
	{
		//alert(sections[eval('x')][eval('lang')]);
		//alert(document.getElementById(eval('x')).innerHTML);
		document.getElementById(eval('x')).innerHTML = sections[eval('x')][eval('lang')];
		document.getElementById(eval('x')).className = classLogic.menuItemClass[eval('lang')];
	}
	document.getElementById('selectlang').innerHTML = classLogic.selectLang[eval('lang')];

	// set language direction
	document.getElementById('bodydir').setAttribute('dir',classLogic.langDir[eval('lang')]);
	return;
}

function toggleLangCookie()
{
	var l = getCookie('l');
	
	// toggle here
	if (l != 'a')
	{
		l = 'a';
	}
	else
	{
		l = 'e';
	}
	var trek = new Date();
	fixDate(trek);
	//trek.setYear(2037);
	trek.setTime(trek.getTime() + 3650 * 24 * 60 * 60 * 1000);
	setCookie("l",l,trek,'/','.jannah.com');
	//alert('Cookie set to: ' + l);
	//setTimeout(5000,"");
}

function removeLangCookie()
{
	deleteCookie('l','/','.jannah.com');
	//alert(getCookie('l'));
}

function setLangCookie(l)
{
	var l;
	var trek = new Date();
	fixDate(trek);
	//trek.setYear(2037);
	trek.setTime(trek.getTime() + 3650 * 24 * 60 * 60 * 1000);
	setCookie("l",l,trek,'/','.jannah.com');
	//alert('Cookie set to: ' + l);
	//setTimeout(5000,"");
}