function openBlankWindow(url,width,height){
	thatWindow = window.open (url, '_blank','width=' + width + ',height=' + height + ',resizable=yes, left=50,top=10')
	thatWindow.focus();
}

function openBlankWindowScroll(url,width,height){
	thatWindow = window.open (url, '_blank','width=' + width + ',height=' + height + ',resizable=yes, scrollbars=yes, left=50,top=10')
	thatWindow.focus();
}


function divShow(tDiv){
	if (document.getElementById)	{	// this is the way the standards work
		var tStyle = document.getElementById(tDiv).style.display = "block";
	} else if (document.all) {			// this is the way old msie versions work
		var tStyle = document.all[tDiv].style.display = "block";
	}	else if (document.layers)	{		// this is the way nn4 works
		var tStyle = document.layers[tDiv].style.display = "block";
	}
}
function divHide(tDiv){
	if (document.getElementById) {	// this is the way the standards work
		var tStyle = document.getElementById(tDiv).style.display = "none";
	} else if (document.all) {			// this is the way old msie versions work
		var tStyle = document.all[tDiv].style.display = "none";
	}	else if (document.layers)	{		// this is the way nn4 works
		var tStyle = document.layers[tDiv].style.display = "none";
	}
}

function divShowHide(tDiv){
	if (document.getElementById)	{		// this is the way the standards work
		var tStyle = document.getElementById(tDiv).style;
		//tStyle.display = tStyle.display? "":"block";
	} else if (document.all) {				// this is the way old msie versions work
		var tStyle = document.all[tDiv].style;
		//tStyle.display = tStyle.display? "":"block";
	}	else if (document.layers)	{			// this is the way nn4 works
		var tStyle = document.layers[tDiv].style;
		//tStyle.display = tStyle.display? "":"block";
	}
	if (tStyle.display == "block"){
    tStyle.display = "none";
  } else {
    tStyle.display = "block";
  }
}
var timeoutHideNavbox;
function navboxShow(){
	clearTimeout(timeoutHideNavbox);
	
	divShow('navigatorBox');
}
function navboxHide(){
	timeoutHideNavbox = setTimeout("divHide('navigatorBox');",1500);
}
function navboxShowHide(){
  divShowHide('navigatorBox');
}




function obesita_Funzione(peso,altezza){
	altezza=altezza/100;
	altezza=altezza*altezza;
	index=peso/altezza;
	return index;
}

function obesita_Controlla(form){
	if (form.peso.value==null || form.peso.value.length==0 || form.altezza.value==null || form.altezza.value.length==0){
	alert("Si prega di inserire peso ed altezza!");
	return false;
}
else if (parseFloat(form.altezza.value)<=60 ||
	 parseFloat(form.altezza.value)>=250 ||
	 parseFloat(form.peso.value)<=20 ||
	 parseFloat(form.peso.value)>=300){
	alert("I dati inseriti sono corretti? Per favore obesita_Controllare i valori impostati!");
	return false;
	}
	return true;
}

function obesita_Calcola(form){
var tuo_bmi="";	
if(obesita_Controlla(form)){
	tuo_bmi=Math.round(obesita_Funzione(form.peso.value,form.altezza.value));
	}
if(tuo_bmi>32){
	alert("Il suo peso si trova decisamente al di sopra dei livelli considerati accettabili. Se ha inserito i dati correttamente potrebbe essere consigliabile consultare un medico!");
	form.bmi.value=tuo_bmi;
	}
else{
	form.bmi.value=tuo_bmi;
	}
	return;
}



