<!--
var iRowCount;

function initRowCount()
{
	iRowCount=0;
}

function initCompName()
{
  if (document.getElementById("compName").value == "")
    document.getElementById("compName").value = document.getElementById("ContactName").value;
}

function isnumeric(teststring, additionalchar)
{
  var allchars = new String(teststring);
  var s, i;
  i=1;
  s = allchars.charAt(0);
  while (s != '')
  {
    if (s != '0' && s != '1' && s != '2' &&
        s != '3' && s != '4' && s != '5' &&
        s != '6' && s != '7' && s != '8' &&
        s != '9' && s != additionalchar)
      return 0;
    s = allchars.charAt(i);
    i++;
  }
  return i-1;
}

function verifyYearOfBirth()
{
  var val = document.getElementById("compYear").value;
  if (isnumeric(val, '')!=4 || val<1993 || val>2010)
  {
    alert("Ugyldigt fødselsår!");
    document.getElementById("compYear").value = "";
    document.getElementById("compYear").select();
    return false;
  }
  return true;    
}

function verifyYearOfBirthEnglish()
{
  var val = document.getElementById("compYear").value;
  if (isnumeric(val, '')!=4 || val<1900 || val>2003)
  {
    alert("Invalid Year of Birth!");
    document.getElementById("compYear").value = "";
    document.getElementById("compYear").select();
    return false;
  }
  return true;    
}

function removeLineFromTable()
{
  var iCount, iEntryRow, iRow2Delete;
  iEntryRow = iRowCount+1;
  strRow2Delete = document.getElementById("row2Delete").value;
  if (iEntryRow.toString() == strRow2Delete)
  {
    document.getElementById("compName").value = "";
    document.getElementById("compYear").value = "";
  }
  else
  {
    document.getElementById("row2Delete").remove(iRowCount);
    document.getElementById("compTable").deleteRow(strRow2Delete);
    for (i=1; i <= iRowCount; i++)
      document.getElementById("compTable").rows[i].cells[0].innerHTML = i;
    iRowCount = iRowCount -1;
  }
}

//-->

