﻿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;
}

function formTjek(){

var table = document.getElementById("blanket");  
if(table){
var cells = table.getElementsByTagName("tr");  
for (var i = 0; i < cells.length; i++) {  
	sts=cells[i].getElementsByTagName("span");
	for (var j = 0; j < sts.length; j++) { 
		stat = sts[j].getAttribute("class");
		if ( stat == "formreq" ) { 
			
			cells[i].setAttribute("class","error");

		}

	}
    
}
}

}
Tangora.Events.AddHandler(window, "onload", formTjek);




ordCount = -1;
ordArr = new Array();
ordIDArr = new Array();


function ordbog(){
if(document.getElementById('VisningDiv')){

thisT = document.getElementById('VisningDiv').innerHTML;

var linkArray = document.getElementById('VisningDiv').getElementsByTagName('a');

for(var i=0; i<linkArray.length; i++){
   var linkTarget = linkArray[i].getAttribute('href');

for (j = 0; j < ordArr.length; j++)
{
r = "" + ordArr[j];

   if (ordIDArr[j] != '')
   {
   
   ma = thisT.match(r);

   


   if (ma != null)
   {
	for (k = 0; k < ma.length; k++)
	{
	    thisMa = ma[k];
	    thisMa = thisMa.replace(/\)/gi, "\\)");
	    thisMa = thisMa.replace(/ /gi, " ");
	    thisMa = thisMa.replace(/\./gi, "\\.");
	    thisMa = thisMa.replace(/\,/gi, "\\,");
	    thisMa = thisMa.replace(/\!/gi, "\\!");
	    thisMa = thisMa.replace(/\-/gi, "\\-");
	    thisMa = thisMa.replace(/\:/gi, "\\:");
 
	    thisVal = ma[k];


	   
	    lastVal = thisVal.substr(thisVal.length - 1);

	    if (lastVal == ")" || lastVal == "." || lastVal == "," || lastVal == "!" || lastVal == "-" || lastVal == " ")
	    {
		 thisT = thisT.replace(new RegExp('' + thisMa + '' , "g" ), "<a href=\"/page901.aspx?recordid901=" + ordIDArr[j] + "\" class=\"ordboglink\">" + thisVal.substr(0, thisVal.length - 1)  + "</a>" + lastVal);
	    }
	    else
	    {
		 thisT = thisT.replace(new RegExp('' + thisMa + '' , "g" ), "<a href=\"/page901.aspx?recordid901=" + ordIDArr[j] + "\" class=\"ordboglink\">" + thisVal  + "</a>");
	    }
	}
	}
   
   
	 }

	}

}

document.getElementById('VisningDiv').innerHTML = thisT;
document.getElementById('VisningDiv').style.display = 'block';


}

}
//Tangora.Events.AddHandler(window, "onload", ordbog);

