subMenuShown = 'no';

function subLanguages(region) {
	var subLangs = '#';
	subLangs += region;
	$j('#subLanguages ul').hide();
	$j(subLangs).show();
}

function openLangPopup() {
	$j(".langOverlay").show();
	$j('#langPopup').slideDown().show();
}

function closeLangPopup() {
	if (subMenuShown == 'yes') {
		slideBackMain();
	} 
	$j('#langPopup').hide();
	$j(".langOverlay").hide();
	
}

function slideMainLang(newLanguage) {
	var newLanguage = newLanguage;
	$j('#subLanguages').show();
	$j('#yourSelection').html('<< Choose Your Region');
	theSetLanguage = $j('.currentLanguageText').html();
	$j('.currentLanguageText').html(newLanguage);
	$j('#langChoiceBox').animate({
		opacity: 0.0,
		left: '-=350'
	}, 1000);
	$j('#subLanguages').animate({
		opacity: 1.0
	}, 2000);
	$j('#backButton').show();
	subMenuShown = 'yes';
}

function slideBackMain() {
	$j('#yourSelection').html('<< Choose Your Language');
	$j('.currentLanguageText').html(theSetLanguage);
	$j('#langChoiceBox').animate({
		opacity: 1,
		left: '+=350'
	}, 1000, function() {
	});
	$j('#backButton').hide();
	subMenuShown = 'no';
	$j('#subLanguages').animate({
		opacity: 0.0
	}, 500, function() {;
	$j('#subLanguages').hide();
	});
}
