// This is the Clientside javascript formvalidations and other functions
// Javafunctions
function dagtilmaaned() {
 var letters = document.formen.dd.value.length +1;
 if (letters <= 2)
  {document.formen.dd.focus()}
 else
  {document.formen.mm.focus()}
};

function maanedtilaar() {
 var letters = document.formen.mm.value.length +1;
 if (letters <= 2)
  {document.formen.mm.focus()}
 else
  {document.formen.yyyy.focus()}
};

function timetilminut() {
 var letters = document.formen.hh.value.length +1;
 if (letters <= 2)
  {document.formen.hh.focus()}
 else
  {document.formen.min.focus()}
};

function timetilminut2() {
 var letters = document.formen.hh2.value.length +1;
 if (letters <= 2)
  {document.formen.hh2.focus()}
 else
  {document.formen.min2.focus()}
};

function flytfokus(elmnt,content) {
if (content.length==elmnt.maxLength){
  next=elmnt.tabIndex
  if (next<document.forms[0].elements.length){
   document.forms[0].elements[next].focus()
  }
 }
};

function submitdommertjans() {
 if (document.formen.Kampnr.value == ""){
  alert('Du skal indtaste kampnummeret.');
  document.formen.Kampnr.focus();
  return false;
 }else
 if (document.formen.dd.value == ""){
  alert('Du skal indtaste en dato');
  document.formen.dd.focus();
  return false;
 }else
 if (document.formen.mm.value == ""){
  alert('Du skal indtaste en dato');
  document.formen.mm.focus();
  return false;
 }else
 if (document.formen.hh.value == ""){
  alert('Du skal indtaste et tidspunkt.');
  document.formen.hh.focus();
  return false;
 }else
 if (document.formen.Hold.value == ""){
  alert('Du skal indtaste, hvem der spiller mod hinanden.');
  document.formen.Hold.focus();
  return false;
 }else
 if (document.formen.Hvor.value == ""){
  alert('Du skal indtaste, hvor kampen finder sted.');
  document.formen.Hvor.focus();
  return false;
 }else
  return true;
};

function submitbegivenhed() {
 if (document.formen.begivenhed.value == ""){
  alert("Du skal indtaste navnet på begivenheden.");
  return false;
 }else
 if (document.formen.dd.value == ""){
  alert("Du skal indtaste en korrekt dato.");
  return false;
 }else
 if (document.formen.Hvor.value == ""){
  alert("Du skal indtaste, hvor begivenheden finder sted");
  return false;
 }else
  return true;
};

function submitkamp() {
 if (document.formen.Kampnr.value == ""){
  alert('Du skal indtaste kampnummeret.');
  document.formen.Kampnr.focus();
  return false;
 }else
 if (document.formen.dd.value == ""){
  alert('Du skal indtaste en dato');
  document.formen.dd.focus();
  return false;
 }else
 if (document.formen.mm.value == ""){
  alert('Du skal indtaste en dato');
  document.formen.mm.focus();
  return false;
 }else
 if (document.formen.hh.value == ""){
  alert('Du skal indtaste et tidspunkt.');
  document.formen.hh.focus();
  return false;
 }else
 if (document.formen.Hold.value == ""){
  alert('Du skal indtaste, hvem der skal spilles mod.');
  document.formen.Hold.focus();
  return false;
 }else
 if (document.formen.Hvor.value == ""){
  alert('Du skal indtaste, hvor kampen finder sted.');
  document.formen.Hvor.focus();
  return false;
 }else
  return true;
};

function tildel(id, projekt) {
 window.location="frivillige.asp?action=tilmeldfriv&id=" + id + "&projektid=" + projekt + "&medlemsnummer=" + document.form1.tildelnavn.options[document.form1.tildelnavn.selectedIndex].value
};

function oprettraener(hold) {
 window.location="traener.asp?action=oprettræner&hold=" + hold + "&medlemsnummer=" + document.form1.opretnavn.options[document.form1.opretnavn.selectedIndex].value
};

function opretholdleder(hold) {
 window.location="traener.asp?action=opretholdleder&hold=" + hold + "&medlemsnummer=" + document.form2.opretnavn.options[document.form2.opretnavn.selectedIndex].value
};

var _gaq = _gaq || []; /* GOOGLE ANALYTICS */
_gaq.push(['_setAccount', 'UA-26255891-1']);
_gaq.push(['_trackPageview']);
