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=yes,scrollbars=yes,toolbar=no,status=no");
    }
    else {
      window.open(URL,unik,"top="+yPos+",left="+xPos+",width="+width+",height="+height+",resizable=yes,scrollbars=yes,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 MailTo_Validator(theForm)
{

  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.txtPersonnummer.value == "")
  {
    alert("Fyll i fältet \"Personnummer\"!");
    theForm.txtPersonnummer.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.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.chkAccepterar.check = (theForm.chkAccepterar.checked) ? false:true)
  {
    alert("Du måste läsa och acceptera PUL (SFS 1998:20)!");
    theForm.chkAccepterar.focus();
    return (false);
  }

  return (true);
}

function wEpost(user) {
  site = "domptoren.nu";
  document.write('<a href=\"mailto:' + user + '@' + site + '\" style=\"display:inline; margin:0px; padding:0px; background:none;\">'); 
  document.write(user + '@' + site + '</a>');
}

