function go(URL) {
  topPos=(screen.availHeight/2)-270
  leftPos=(screen.availWidth/2)-337
    if (navigator.appName=="Netscape") {
      window.open(URL,"Detalj","screenY="+topPos+",screenX="+leftPos+",width=600, height=450,resizable=no,scrollbars=yes,toolbar=no,statusbar=no");
      }
    else {
      window.open(URL,"Detalj","top="+topPos+",left="+leftPos+",width=600, height=450,resizable=no,scrollbars=yes,toolbar=no,statusbar=no");
      }
}

function nytt(URL,width,height) {
  unik=new Date();
  unik=unik.getSeconds()+"_"+unik.getMinutes()+"_"+unik.getHours();
  yPos=(screen.availHeight/2)-(height/2);
  xPos=(screen.availWidth/2)-(width/2);

  if (navigator.appName=="Netscape") {
    window.open(URL,unik,"screenY="+yPos+",screenX="+xPos+",width="+width+",height="+height+",resizable=no,scrollbars=no,toolbar=no,status=no");
    }
    else {
      window.open(URL,unik,"top="+yPos+",left="+xPos+",width="+width+",height="+height+",resizable=no,scrollbars=no,toolbar=no,status=no");
      }
}

function SendElements() {
		var i,j;
		for (i=0; i < document.forms[0].elements.length-1; i++)
			switch (String(document.forms[0].elements[i].name).substring(0,3))
			{
				case "chk":
					if (document.forms[0].elements[i].checked)
						document.forms[0].elements[i].value = "Ja";
					else {
						document.forms[0].elements[i].checked = false;
						document.forms[0].elements[i].value = "Nej";
					}
					break;
			}
}

function Kontakt_Validator(theForm)
{

  if (theForm.txtNamn.value == "")
  {
    alert("Fyll i fältet \"Namn\"!");
    theForm.txtNamn.focus();
    return (false);
  }

  if (theForm.txtAdress.value == "")
  {
    alert("Fyll i fältet \"Adress\"!");
    theForm.txtAdress.focus();
    return (false);
  }

  if (theForm.txtPostadress.value == "")
  {
    alert("Fyll i fältet \"Postadress\"!");
    theForm.txtPostadress.focus();
    return (false);
  }

  if (theForm.txtEpost.value == "")
  {
    alert("Fyll i fältet \"E-mail\"!");
    theForm.txtEpost.focus();
    return (false);
  }

  if (theForm.txtTelefon.value == "")
  {
    alert("Fyll i fältet \"Telefon\"!");
    theForm.txtTelefon.focus();
    return (false);
  }

  if (theForm.txtAnkomstdatum.value == "")
  {
    alert("Fyll i fältet \"Ankomstdatum\"!");
    theForm.txtAnkomstdatum.focus();
    return (false);
  }

  if (theForm.txtAnkomstdatum.value == "")
  {
    alert("Fyll i fältet \"Ankomstdatum\"!");
    theForm.txtAnkomstdatum.focus();
    return (false);
  }

  if (theForm.txtAvresedatum.value == "") {
      alert("Fyll i fältet \"Avresedatum\"!");
      theForm.txtAvresedatum.focus();
      return (false);
  }

  if (document.getElementById("txtPersinfo") != null) {
    if (document.getElementById("txtPersinfo").value == "") {
      alert("Fyll i fältet \"Personlig info\"!");
      document.getElementById("txtPersinfo").focus();
      return (false);
      }
  }

  if (document.getElementById("txtSprak") != null) {
    if (document.getElementById("txtSprak").value == "") {
      alert("Fyll i fältet \"Språkkunskaper\"!");
      document.getElementById("txtSprak").focus();
      return (false);
      }
  }

  if (document.getElementById("txtUtbildning") != null) {
    if (document.getElementById("txtUtbildning").value == "") {
      alert("Fyll i fältet \"Utbildning\"!");
      document.getElementById("txtUtbildning").focus();
      return (false);
      }
  }

  if (document.getElementById("txtNuvarande") != null) {
    if (document.getElementById("txtNuvarande").value == "") {
      alert("Fyll i fältet \"Nuvarande anställning\"!");
      document.getElementById("txtNuvarande").focus();
      return (false);
      }
  }

  if (document.getElementById("chkKorkort") != null) {
    if (document.getElementById("chkKorkort") == true) {
      if (!theForm.chkKorkort[0].checked && !theForm.chkKorkort[1].checked) {
        alert("Har Du körkort?");
        theForm.chkKorkort[0].focus();
        return (false)
        }
    }
  }

  return (true);
}
