function checa(f) {
    if (f.nicho.value == "") {
	alert("Selecione o tipo de nicho.");
    f.nicho.focus();
    return false;
    }

    if (f.diam.value == "") {
	alert("Selecione o diâmetro e nº de cordoalhas do nicho.");
    f.diam.focus();
    return false;
    }
var valor = f.alfa.value;
    if ((valor<0)||(valor>40)||(f.alfa.value=="")){
	alert("Digite o valor de alfa entre 0º e 40º para nichos verticais\ne entre 20º e 40º para nichos horizontais.");
    f.alfa.focus();
    return false;
    }
   if (isNaN(f.alfa.value) || ((valor % 1)!=0)){ 
   alert ("O campo alfa deve conter apenas números inteiros."); 
   f.alfa.focus();
    return false;
    }
 if ((valor<20)&&(f.nicho.value=="horizontal")){
	alert("Para nichos horizontais, o valor de alfa deve estar entre 20º e 40º.");
    f.alfa.focus();
    return false;
    }

}

function abreNichos() {
	window.open('dimensionamento-nichos-calculos.php','window','left=50,top=50,width=500,height=500');
}

function MM_openBrWindow(theURL,winName,w,h,scrollbars) 

	{ 

	  LeftPosition=(screen.width)?(screen.width-w)/2:100;

	  TopPosition=(screen.height)?(screen.height-h)/2:100;

	  

	  settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scrollbars+',location=no,directories=no,status=0,menubar=no,toolbar=no,resizable=yes';

	  URL = theURL;

	  window.open(URL,winName,settings);

	}

function get_h(){

x = document.getElementById("internal-content").offsetHeight;
y = document.getElementById("menu-lateral");

y.setAttribute('style', 'height:'+(x-50)+'px;');

}

window.onload = function() {
	get_h();
}
