<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}
//-->
<!-- Begin
function mod(div,base) {
return Math.round(div - (Math.floor(div/base)*base));
}
function calcBmi() {
var w = document.bmi.weight.value * 1;
var HeightFeetInt = document.bmi.htf.value * 1;
var HeightInchesInt = document.bmi.hti.value * 1;
HeightFeetConvert = HeightFeetInt * 12;
h = HeightFeetConvert + HeightInchesInt;
displaybmi = (Math.round((w * 703) / (h * h)));
var rvalue = true;
if ( (w <= 35) || (w >= 500) || (h <= 48) || (h >= 120) ) {
alert ("Invalid data. Please check and re-enter!");
rvalue = false;
}
if (rvalue) {
if (HeightInchesInt > 11) {
reminderinches = mod(HeightInchesInt,12);
document.bmi.hti.value = reminderinches;
document.bmi.htf.value = HeightFeetInt + 
((HeightInchesInt - reminderinches)/12);
document.bmi.answer.value = displaybmi;
}
if (displaybmi <19) 
document.bmi.comment.value = "Underweight";
if (displaybmi >=19 && displaybmi <=25) 
document.bmi.comment.value = "Normal Weight Range";
if (displaybmi >=26 && displaybmi <=29) 
document.bmi.comment.value = "Prone to Health Risks";
if (displaybmi >=30 && displaybmi <=40) 
document.bmi.comment.value = "Obese";
if (displaybmi >40) 
document.bmi.comment.value = "Morbidly Obese";
document.bmi.answer.value = displaybmi; }
return rvalue;
}
// End -->
<!--
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

//-->
	<!--
	function validateNC(wd){var ret=false,resNC=0,bmi=0; if(wd.forms.length > 0){var polNC = wd.forms[0]['pol'],ageNC = wd.forms[0]['alter'].value,wesNC = wd.forms[0]['gew'].value,rostNC = wd.forms[0]['grs'].value;
  if(!(polNC[0].checked || polNC[1].checked)){resNC=resNC;}else{resNC++;}
  if((ageNC<19) || (ageNC>110) || (!ageNC.match(/^\d*$/))){resNC=resNC;}else{resNC++;}
  if((wesNC<5) || (wesNC>410) || (!wesNC.match(/^\d*$/))){resNC=resNC;}else{resNC++;}
  if((rostNC<1) || (rostNC>220) || (!rostNC.match(/^\d*$/))){resNC=resNC;}else{resNC++;}
  if(resNC<4){
	return(0);
	}else{
	bmi=Math.round(wesNC*10000/Math.pow(rostNC,2));
	wd.forms[0]['res'].value = bmi;
	result(bmi,ageNC,polNC[0].checked);
	return(bmi);
	}
  }else if(wd.layers.length>0){
	for(var i=0;i<wd.layers.length;i++){
	  ret=validateNC(wd.layers[i].document);
	  if(ret>0){
		break;
	  }
	}
  }
return(ret);
}
function validate(){
if(document.all){
	var res=0,bmi=0,pol=document.forms[0]['pol'],age=document.forms[0]['alter'].value,wes=document.forms[0]['gew'].value,rost=document.forms[0]['grs'].value;
		if((rost<1) || (rost>220) || (!rost.match(/^\d*$/))){res=4;}
		if((wes<5) || (wes>410) || (!wes.match(/^\d*$/))){res=3;}
		if((age<19) || (age>110) || (!age.match(/^\d*$/))){res=2;}
		if(!(pol[0].checked || pol[1].checked)){res=1;}
	}else{
	var bmiNC=validateNC(document);
	res =(bmiNC>0)? 0 : 5;
	}						
switch(res){
	case 0: if(document.all){bmi=wes*10000/Math.pow(rost,2);result(Math.round(bmi),age,pol[0].checked);}return false;break;	
	case 1: alert ("weiblich oder männlich?!");return false;break;	
	case 2: alert ("Alter bitte zwischen 19 und 110 wählen!");return false;break;
	case 3: alert ("Sie haben Ihr Gewicht falsch angegeben!");return false;break;
	case 4: alert ("Sie haben Ihre Größe falsch angegeben!!");return false;break;
	case 5: alert ("Überprüfen Sie bitte Ihre Angaben!");return false;break;
	default: alert ("Überprüfen Sie bitte Ihre Angaben!");return false;break;
	}
	}	
function result(b,a,p){
var text="";
var t1="<h2>Ergebnis:</h2>Kritisches Untergewicht! Sie sind viel zu dünn. Suchen Sie einen Arzt auf, und versuchen Sie, regelmäßige kalorienreiche Mahlzeiten zu sich zu nehmen.";
var t2="<h2>Ergebnis:</h2>Deutliches Untergewicht! Sie sind viel zu dünn. Essen Sie regelmäßig. Wenn Sie nicht zunehmen, suchen Sie einen Arzt auf.";
var t3="<h2>Ergebnis:</h2>Untergewicht! Sie sind zu dünn. Versuchen Sie, durch regelmäßige Mahlzeiten zuzunehmen.";
var t4="<h2>Ergebnis:</h2>Gratulation! Sie sind absolut normalgewichtig. Versuchen Sie, Ihr Gewicht so lange wie möglich in diesem Bereich zu halten.";
var t5="<h2>Ergebnis:</h2>Leichtes Übergewicht! Versuchen Sie durch Bewegung und eine kalorienreduzierte Ernährung Ihr Gewicht zu reduzieren.";
var t6="<h2>Ergebnis:</h2>Übergewicht! Sie sind adipös und sollten auf jeden Fall abnehmen. Bewegen Sie sich mehr, und lassen Sie sich ärztlich beraten. Führen Sie Ihre Diät unter Anleitung von Experten durch.";
var t7="<h2>Ergebnis:</h2>Krankhaftes Übergewicht! Sie müssen so schnell wie möglich Ihr Gewicht reduzieren. Ihr Risiko für Herz-Kreislauf- Erkrankungen und Diabetes ist erhöht. Außerdem werden durch das hohe Gewicht Ihre Gelenke stark beansprucht. Sie sollten einen Arzt aufsuchen und unter Anleitung von Experten abnehmen.";
if((p && b<16)||(!p && b<17)){text=t1;}
if((p && b>=16 && b<18 && 25<=a)||(!p && ((b==17 && a>=35 && a<=44)||(b>=17 && b<=19 && 45<=a)))){text=t2;}
if((p && ((b>=16 && b<=18 && a>=19 && a<=24)||(b>=18 && b<=19 && a>=25 && a<=34)||(b>=18 && b<=20 && a>=35 && a<=44)||(b>=18 && b<=21 && a>=45 && a<=54)||(b>=18 && b<=22 && a>=55)))||(!p && ((b>=17 && b<=19 && a>=19 && a<=24)||(b>=17 && b<=20 && a>=25 && a<=34)||(b>=18 && b<=21 && a>=35 && a<=44)||(b>=20 && b<=22 && a>=45 && a<=54)||(b>=20 && b<=23 && a>=55 && a<=64)||(b>=20 && b<=24 && a>=64)))){text=t3;}
if((p && ((b>=19 && b<=24 && a>=19 && a<=24)||(b>=20 && b<=25 && a>=25 && a<=34)||(b>=21 && b<=26 && a>=35 && a<=44)||(b>=22 && b<=27 && a>=45 && a<=54)||(b>=23 && b<=28 && a>=55 && a<=64)||(b>=24 && b<=29 && a>64)))||(!p && ((b>=20 && b<=25 && a>=19 && a<=24)||(b>=21 && b<=26 && a>=25 && a<=34)||(b>=22 && b<=27 && a>=35 && a<=44)||(b>=23 && b<=28 && a>=45 && a<=54)||(b>=24 && b<=29 && a>=55 && a<=64)||(b>=25 && b<=29 && a>64)))){text=t4;}
if((p && ((b>=25 && b<=29 && a>=19 && a<=24)||(b>=26 && b<=30 && a>=25 && a<=34)||(b>=27 && b<=31 && a>=35 && a<=44)||(b>=28 && b<=32 && a>=45 && a<=54)||(b>=29 && b<=33 && a>=55 && a<=64)||(b>=30 && b<=34 && a>64)))||(!p && ((b>=26 && b<=30 && a>=19 && a<=24)||(b>=27 && b<=31 && a>=25 && a<=34)||(b>=28 && b<=32 && a>=35 && a<=44)||(b>=29 && b<=33 && a>=45 && a<=54)||(b>=30 && b<=34 && a>=55 && a<=64)||(b>=30 && b<=35 && a>64)))){text=t5;}
if((p && b<=40 && ((b>=30 && a>=19 && a<=24)||(b>=31 && a>=25 && a<=34)||(b>=32 && a>=35 && a<=44)||(b>=33 && a>=45 && a<=54)||(b>=34 && a>=55 && a<=64)||(b>=35 && a>64)))||(!p && b<=40 && ((b>=31 && a>=19 && a<=24)||(b>=32 && a>=25 && a<=34)||(b>=33 && a>=35 && a<=44)||(b>=34 && a>=45 && a<=54)||(b>=35 && a>=55 && a<=64)||(b>=36 && a>64)))){text=t6;}
if(b>40){text=t7;}
if(document.all){						    //IE
  document.forms[0]['res'].value=b;
  document.all.bmirestext.innerHTML=text;
  }else{									//NC
  var textLayer=document.layers[0].document.layers[2].document.layers[1].document.layers[0].document.layers[0].document.layers[2].document;
  textLayer.open();textLayer.write("+text+");textLayer.close();
  }
}
	//-->