function caricaLayer() {
		document.getElementById('main').style.visibility='visible'; 
		completeAHAH.ahah('index2.html', 'main', '', 'GET', '', this);
}
function select() {
		document.getElementById('submenu_bg').style.backgroundColor='#fff8da';
		//document.getElementById('submenu').textContent='Menu '+content;		
}
function deselect() {
		document.getElementById('submenu_bg').style.backgroundColor='#fadfb4';
		//document.getElementById('submenu').textContent='Servizi Finanziari Immobiliari dal 1981';		
}
function selectClick(content) {
		//document.getElementById('submenu').textContent='Menu '+content;
		completeAHAH.ahah('submenu/'+content+'.html', 'submenu', '', 'GET', '', this);
}

function ahahLoad(content,target) {

		//document.getElementById('main').style.visibility='visible'; 
		completeAHAH.ahah('data/'+content+'.html', ''+target+'', '', 'GET', '', this);
}
function popup(content,width,height) {
		document.getElementById('popup').style.visibility='visible';		completeAHAH.ahah('data/'+content+'.html', 'popup', '', 'GET', '', this);
}
function nascondipopup() {
		document.getElementById('popup').style.visibility='hidden';
}
function nascondi(target) {
		document.getElementById(target).style.visibility='hidden';
}
function maps(content,width,height) {
		document.getElementById('maps').style.visibility='visible';		completeAHAH.ahah('maps/'+content+'.html', 'maps', '', 'GET', '', this);
}
function tooltip(content,width,height) {
		document.getElementById('main').style.visibility='visible';		completeAHAH.ahah('tooltip/'+content+'.html', 'tooltip', '', 'GET', '', this);
}


function mutuo(content) {
	//javascript:document.getElementById('lav_dip').disabled='false'; //lav dipendente on 

	//alert(content);
	if(content=='disabled') {
		document.getElementById('tipo_mutuo').disabled = 'disabled';
		document.getElementById('ubicazione_casa').disabled = 'disabled';
		document.all[tipo_mutuo].disabled = true; 
		document.all[ubicazione_casa].disabled = true; 	
		//alert('disabled');
		//alert(content);
	}else{
		document.getElementById('tipo_mutuo').removeAttribute("disabled");
		document.getElementById('ubicazione_casa').removeAttribute("disabled");
		document.all[tipo_mutuo].disabled = false;
		document.all[ubicazione_casa].disabled = false;	
		//alert('enabled');
		//alert(content);
	}
}
function lav_dip(content) {
	//javascript:document.getElementById('lav_dip').disabled='false'; //lav dipendente on 
	//document.getElementById('lav_dip').disabled=content;
	/**/
	if(content=='disabled') {
		document.getElementById('lav_dip').disabled = 'disabled';
		document.all[lav_dip].disabled = true; 
		//document.getElementById('ubicazione_casa').disabled = 'disabled';	
		//alert('disabled');
		//alert(content);
	}else{
		document.getElementById('lav_dip').removeAttribute("disabled");
		document.all[lav_dip].disabled = false; 
	//	document.getElementById('ubicazione_casa').removeAttribute("disabled");	
		//alert('enabled');
		//alert(content);
	}	
	//alert(content);
}

/* CALCOLA RATA*/
//dichiarazione varibile
rata = "";
//funzione calcolo rata
function CalcolaRata(m,n,i,k)
    {
//lettura dati
      m = parseInt(m);
      n = parseInt(n);
      i = parseFloat(i)/100;
      k = parseInt(k);
//numero di rate
      kn = k*n;
//interesse del periodo
      ik = i/k;
//calcolo della rata costante
      rata = m*ik/(1-Math.pow(ik+1,-k*n));
      return Math.round(rata*100)/100 //arrotondo risultato 
 }