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.txtTelefon.value == "")
  {
    alert("Fyll i fältet \"Telefon\"!");
    theForm.txtTelefon.focus();
    return (false);
  }

    if (theForm.txtFodelsear.value == "") {
        alert("Fyll i fältet \"Födelseår\"!");
        theForm.txtFodelsear.focus();
        return (false);
        }

    if (theForm.txtPersinfo.value == "") {
        alert("Fyll i fältet \"Personlig info\"!");
        theForm.txtPersinfo.focus();
        return (false);
        }

        if (theForm.txtSprak.value == "") {
        alert("Fyll i fältet \"Språkkunskaper\"!");
        theForm.txtSprak.focus();
        return (false);
        }

    if (theForm.txtUtbildning.value == "") {
        alert("Fyll i fältet \"Utbildning\"!");
        theForm.txtUtbildning.focus();
        return (false);
        }

      if (theForm.txtNuvarande.value == "") {
        alert("Fyll i fältet \"Nuvarande anställning\"!");
        theForm.txtNuvarande.focus();
        return (false);
        }

  if (theForm.chkKorkort == true) {
      if (!theForm.chkKorkort[0].checked && !theForm.chkKorkort[1].checked) {
        alert("Har Du körkort?");
        theForm.chkKorkort[0].focus();
        return (false)
        }
    }

  return (true);
}
