
function changeLanguage(myFlag){
	var myAddress = location.href;
	var toGo = '';
	switch(myFlag.name){
		case 'italyFlag':
			// Nessun reindirizzamento per la lingua corrente
			if(myAddress.indexOf('lang=IT') != -1) return false;
			// Blanck. Non è stato fatto nessun cambiamnento di lingua fino ad ora
			if(myAddress.indexOf('lang=EN') == -1){
				if(myAddress.indexOf('?') == -1) toGo = '?lang=IT';
				else toGo = '&lang=IT';
				// Link... ok
				myFlag.href = myAddress + toGo;
				return true;
			// E' stato fatto un cambiamento almeno una volta
			}else{
				toGo = myAddress.replace('lang=EN', 'lang=IT');
				myFlag.href = toGo;
				return true;
			}
			break;
		case 'englishFlag':
			// Nessun reindirizzamento per la lingua corrente
			if(myAddress.indexOf('lang=EN') != -1) return false;
			// Blanck. Non è stato fatto nessun cambiamnento di lingua fino ad ora
			if(myAddress.indexOf('lang=IT') == -1){
				if(myAddress.indexOf('?') == -1) toGo = '?lang=EN';
				else toGo = '&lang=EN';
				// Link... ok
				myFlag.href = myAddress + toGo;
				return true;
			// E' stato fatto un cambiamento almeno una volta
			}else{
				toGo = myAddress.replace('lang=IT', 'lang=EN');
				myFlag.href = toGo;
				return true;
			}
			break;
		default:
			alert("Function error. Lenguage " + myFlag + " unavaiable.");
			return false;
	}
}
