// JavaScript Document
$(function () {
   // find the div.fade elements and hook the hover event
   $('div.fade').hover(function() {
   // on hovering over find the element we want to fade *up*
     var fade = $('> div', this);

     // if the element is currently being animated (to fadeOut)...
     if (fade.is(':animated')) {
	   // ...stop the current animation, and fade it to 1 from current position
	   fade.stop().fadeTo(250, 1);
     } else {
	   fade.fadeIn(250);
     }
   }, function () {
	   var fade = $('> div', this);
	   if (fade.is(':animated')) {
		   fade.stop().fadeTo(250, 0);
	   } else {
		   fade.fadeOut(250);
	   }
	});
 })

function calcular() {

  var bandera;
  var peso;
  var altura;
  var imc;

  bandera = false;
  peso = $("#peso").val();
  altura = $("#altura").val();


  if (peso != "" && altura != "") {
    imc = peso / (altura*altura);
    $("#imc").html((Math.round(imc*100)/100));
  } else {
    alert("No ingresó el peso o la altura correctamente. No se puede realizar el cálculo");
  }
}

