var AuthenticationPage = {
	
	changeLang: function(lang) {
		document.formChoices.fc_lang.value = lang;
		this.sendFormChoices(document.formChoices.tab.value);
	},
	
	sendFormChoices: function(tab, section) {
		
		// country
		//
		var cs = document.getElementById('countrySelector');
		var id_country;
		if (cs) {
			id_country = cs.options[cs.selectedIndex].value;
		} else {
			cs = document.getElementById('fc_country');
			if (cs) id_country = cs.value;
		}	
		
		// login
		var cl = document.getElementById('cust_login');
		var login = '';
		if (cl) {
			login = document.getElementById('cust_login').value;
		} else {
			cs = document.getElementById('fc_login');
			if (cs) login = cs.value;
		}	
		
		document.formChoices.fc_country.value = id_country;
		document.formChoices.fc_login.value = login;
		document.formChoices.tab.value = tab;
		if (section!=undefined) document.formChoices.section.value = section;
		document.formChoices.submit();
		
	},
	
	openTab: function(tabName) {
		this.sendFormChoices(tabName);
	},
	
	gotoSection : function(name) {
		this.sendFormChoices(document.formChoices.tab.value, name);
	}
		
}