$(document).ready(function(){
	$('#Cartina div.PulsStrada').click(function () {
		if (IdStrada = this.getAttribute('id')) {
			$('#Cartina div.PulsStrada').css({'z-index':'1'});
			if ($('#PopUp'+IdStrada).is(':visible')) {
				$('#Cartina div.PulsStrada .PopUp').hide();
			} else {
				$(this).css({'z-index':'2'});
				$('#Cartina div.PulsStrada .PopUp').hide();
				$('#PopUp'+IdStrada).show('fast');
			}
		}
	});
});

function OnOff(Id,DisplayType) {
	o = document.getElementById(Id);
	if (o.style.display==DisplayType) {
		o.style.display='none';
	} else {
		o.style.display=DisplayType;
	}
}

function AccendiSchede(Id,Lang) {
	id_ita = document.getElementById(Id+'_ita');
	id_itaLi = document.getElementById(Id+'_itaLi');
	id_eng = document.getElementById(Id+'_eng');
	id_engLi = document.getElementById(Id+'_engLi');
	id_esp = document.getElementById(Id+'_esp');
	id_espLi = document.getElementById(Id+'_espLi');
	id_chn = document.getElementById(Id+'_chn');
	id_chnLi = document.getElementById(Id+'_chnLi');
	switch(Lang) {
		case('ita'):
			id_ita.style.display = 'block';
			id_itaLi.style.background = '#39562D';
			id_eng.style.display = 'none';
			id_engLi.style.background = 'none';
			id_esp.style.display = 'none';
			id_espLi.style.background = 'none';
			id_chn.style.display = 'none';
			id_chnLi.style.background = 'none';
		break;
		case('eng'):
			id_ita.style.display = 'none';
			id_itaLi.style.background = 'none';
			id_eng.style.display = 'block';
			id_engLi.style.background = '#39562D';
			id_esp.style.display = 'none';
			id_espLi.style.background = 'none';
			id_chn.style.display = 'none';
			id_chnLi.style.background = 'none';
		break;
		case('esp'):
			id_ita.style.display = 'none';
			id_itaLi.style.background = 'none';
			id_eng.style.display = 'none';
			id_engLi.style.background = 'none';
			id_esp.style.display = 'block';
			id_espLi.style.background = '#39562D';
			id_chn.style.display = 'none';
			id_chnLi.style.background = 'none';
		break;
		case('chn'):
			id_ita.style.display = 'none';
			id_itaLi.style.background = 'none';
			id_eng.style.display = 'none';
			id_engLi.style.background = 'none';
			id_esp.style.display = 'none';
			id_espLi.style.background = 'none';
			id_chn.style.display = 'block';
			id_chnLi.style.background = '#39562D';
		break;
	}
}

function Attiva(id) {
	alert(id);
	if (o = document.getElementById(Id)) {
		
	} else {
		alert('non ho trovato '+id);
	}
	o.style.display='block';
	
}

function Disattiva(id) {
	alert(id);
	if (o = document.getElementById(Id)) {
		
	} else {
		alert('non ho trovato '+id);
	}
	o.style.display='none';
	
}

function ScriviInId(valore,Id) {
	if (document.getElementById(Id)) {
		document.getElementById(Id).innerHTML = valore;
	}
}