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 MailToLybo_Validator(theForm)
{

  if (theForm.txtPersonnummer.value == "")
  {
    alert("Fyll i fältet \"Personnummer\"!");
    theForm.txtPersonnummer.focus();
    return (false);
  }

  if (theForm.txtFornamn.value == "")
  {
    alert("Fyll i fältet \"Förnamn\"!");
    theForm.txtFornamn.focus();
    return (false);
  }


  if (theForm.txtEfternamn.value == "")
  {
    alert("Fyll i fältet \"Efternamn\"!");
    theForm.txtEfternamn.focus();
    return (false);
  }

  if (theForm.txtGatuadress.value == "")
  {
    alert("Fyll i fältet \"Gatuadress\"!");
    theForm.txtGatuadress.focus();
    return (false);
  }

  if (theForm.txtPostnummer.value == "")
  {
    alert("Fyll i fältet \"Postnummer\"!");
    theForm.txtPostnummer.focus();
    return (false);
  }

  if (theForm.txtPostnummer.value.length > 12)
  {
    alert("Fyll i fältet \"Postnummer\"!");
    theForm.txtPostnummer.focus();
    return (false);
  }

  if (theForm.txtOrt.value == "")
  {
    alert("Fyll i fältet \"Ort\"!");
    theForm.txtOrt.focus();
    return (false);
  }

  if (theForm.txtHemtelefon.value == "")
  {
    alert("Fyll i fältet \"Hemtelefon\"!");
    theForm.txtHemtelefon.focus();
    return (false);
  }

  if (theForm.txtHemtelefon.value.length > 25)
  {
    alert("Max 25 siffror för \"Hemtelefon\".");
    theForm.txtHemtelefon.focus();
    return (false);
  }

  if (theForm.chkAccepterar.value == "Nej")
  {
    alert("Du måste läsa och acceptera PUL (SFS 1998:20)");
    theForm.chkAccepterar.focus();
    return (false);
  }
  return (true);
}

function MailToOther_Validator(theForm)
{

  if (theForm.txtPersonnummer.value == "")
  {
    alert("Fyll i fältet \"Personnummer\"!");
    theForm.txtPersonnummer.focus();
    return (false);
  }

  if (theForm.txtNamn.value == "")
  {
    alert("Fyll i fältet \"Namn\"!");
    theForm.txtNamn.focus();
    return (false);
  }

  if (theForm.txtGatuadress.value == "")
  {
    alert("Fyll i fältet \"Gatuadress\"!");
    theForm.txtGatuadress.focus();
    return (false);
  }

  if (theForm.txtPostadress.value == "")
  {
    alert("Fyll i fältet \"Postadress\"!");
    theForm.txtPostadress.focus();
    return (false);
  }

  if (theForm.txtHemtelefon.value == "")
  {
    alert("Fyll i fältet \"Hemtelefon\"!");
    theForm.txtHemtelefon.focus();
    return (false);
  }

  if (theForm.txtHemtelefon.value.length > 25)
  {
    alert("Max 25 siffror för \"Hemtelefon\".");
    theForm.txtHemtelefon.focus();
    return (false);
  }

  return (true);
}

function pul() {
   newwindow=window.open("pul.html","PULinfo","toolbar=0,status=1,naviagation=1,menubar=0,scrollbars=1,resizable=1,width=400,height=430"); newwindow.document.close();
   }

function ny_sida(url,width,height) {
	egenskaper="toolbar=yes,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes";
	egenskaper+=",width="+width;
	egenskaper+=",height="+height;
	unik=new Date();
	unik=unik.getSeconds()+"_"+unik.getMinutes()+"_"+unik.getHours();
	window.open(url,unik,egenskaper);
}

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");
      }
}

