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 goPage(url) {
	if (url.length > 0) {
		location.href = url;
		}
	}

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 wEpost(user, site) {
	if (user.indexOf("@") > 0) {
		document.write('<a href=\"mailto:' + user.replace(/@/, "&#64;") + '\">');
		document.write(user.replace(/@/, "&#64;") + '</a>');
		}
	else {
		document.write('<a href=\"mailto:' + user + '&#64;' + site + '\">');
		document.write(user + '&#64;' + site + '</a>');
		}
}

function ValidateForm(theForm, variant) {
	if (document.getElementById("txtNamn").value == "") {
		alert("Fyll i fältet \"Namn\"!");
		document.getElementById("txtNamn").focus();
		return (false);
	}
	if (document.getElementById("txtTelefon").value == "") {
		alert("Fyll i fältet \"Telefon\"!");
		document.getElementById("txtTelefon").focus();
		return (false);
	}
	if (document.getElementById("txtEpost").value == "") {
		alert("Fyll i fältet \"E-post\"!");
		document.getElementById("txtEpost").focus();
		return (false);
	}
	switch (variant)
	{
		case 1:
			if (document.getElementById("txtMeddelande").value == "") {
				alert("Fyll i fältet \"Meddelande\"!");
				document.getElementById("txtMeddelande").focus();
				return (false);
			}
		break;
	}
	return (true);
}