﻿function centerVert(beginend) {
  var tmpStr = '';
  var browser = navigator.appName;
  var version = navigator.appVersion;
  if (browser == 'Microsoft Internet Explorer') {
    if (version.indexOf('MSIE 5') != -1) {
	if (beginend == 'begin') {
	  tmpStr = '<table width=100% height=100% cellspacing=0 cellpadding=0 border=0><tr><td align=center valign=middle>';
	}
	else {
	  tmpStr = '</td></tr></table>';
	}
    document.write(tmpStr);
    }
  }
}

function moreDetails(thisId,newId) {
  var tmpStr = window.location.toString();
  var repStr = new RegExp(thisId + "=","g");
  tmpStr = tmpStr.replace(repStr,newId + "=");
  var repStr2 = new RegExp("id=" + thisId,"g");
  tmpStr = tmpStr.replace(repStr2,"id=" + newId);
  document.location.replace(tmpStr);
}
function BMIBeregn(hojde, vaegt)
{
  vaegt = vaegt.replace(",",".");
  hojde = hojde.replace(",",".");
  hojde = hojde / 100;
  //return Math.floor((vaegt/(hojde*hojde)));
  return Math.round((vaegt/(hojde*hojde)));
  //return (vaegt/(hojde*hojde));
}
function BMIBeregnGo()
{
document.getElementById('idBmiResultat').value = BMIBeregn(document.getElementById('idBmiHojde').value, document.getElementById('idBmiVaegt').value);
}
function BMIBeregner()
{
document.write('<div style="background-color: #bcbac0; padding:8px; width:450px;">');
document.write('<table border="0" cellpadding="0" cellspacing="0">');
document.write('<tr>');
document.write('<td class="section" width="80"><b>Højde (cm)</b></td>');
document.write('<td class="section" width="60"><input type="text" name="bmiHojde" id="idBmiHojde" style="width:40px;"></td>');
document.write('<td class="section" width="75"><b>Vægt (kg)</b></td>');
document.write('<td class="section" width="60"><input type="text" name="bmiVaegt" id="idBmiVaegt" style="width:40px;"></td>');
document.write('<td class="section" width="70"><input type="button" value="Beregn" style="background-color: #e30035; color: #ffffff; font-weight: bold; border: 0px;" onclick="BMIBeregnGo();"></td>');
document.write('<td class="section" width="30"><b>BMI</b></td>');
document.write('<td class="section"><input type="text" name="bmiResultat" id="idBmiResultat" style="width:40px;"></td>');
document.write('</tr>');
document.write('</table>');
document.write('</div>');
}
function OvervaegtVideo()
{
t = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="265" height="212" id="overvaegt_video" align="middle">';
t += '<param name="allowScriptAccess" value="sameDomain" />';
t += '<param name="allowFullScreen" value="false" />';
t += '<param name="movie" value="/html/video/overvaegt_video.swf" />';
t += '<param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />';
t += '<embed src="/html/video/overvaegt_video.swf" quality="high" bgcolor="#ffffff" width="265" height="212" name="overvaegt_video" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
t += '</object>';
document.getElementById('speciale_beskriv_venstre').style.width = '460px';
document.getElementById('speciale_beskriv_hojre').style.width = '270px';
document.getElementById('speciale_beskriv_hojre').style.marginLeft = '20px';

document.getElementById('speciale_beskriv_hojre').innerHTML = t;
}