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 chkAntal(antalet) {
  if (antalet == 'Annat') {
    document.kontaktHL.Antal.disabled = false;
    document.kontaktHL.Antal.focus();
    document.kontaktHL.selAntal.value = document.kontaktHL.Antal.value;
  }
  else {
    document.kontaktHL.Antal.value = "";
    document.kontaktHL.Antal.disabled = true;
    document.kontaktHL.selAntal.value = document.kontaktHL.selAntal.value;
    }
}

function chkPaket() {
  if (document.forms[0].radBokapaket[0].checked == true) {
    document.kontaktHL.txtAnkomstdatum.disabled = true;
    document.kontaktHL.txtAvresedatum.disabled = true;
    document.kontaktHL.txtAnkomstdatum.value = "";
    document.kontaktHL.txtAvresedatum.value = "";
    document.kontaktHL.txtShowdatum.disabled = false;
    }
  if (document.forms[0].radBokapaket[1].checked == true) {
    document.kontaktHL.txtAnkomstdatum.disabled = false;
    document.kontaktHL.txtAvresedatum.disabled = false;
    document.kontaktHL.txtShowdatum.value = "";
    document.kontaktHL.txtShowdatum.disabled = true;
  }
}

function chkShow() {
  if (document.forms[0].txtShowdatum.value == '') {
    document.forms[0].radShowbokning[0].disabled = true;
    document.forms[0].radShowbokning[1].disabled = true;
    document.forms[0].radShowbokning[0].checked = false;
    document.forms[0].radShowbokning[1].checked = false;
  }
  else {
    document.forms[0].radShowbokning[0].disabled = false;
    document.forms[0].radShowbokning[1].disabled = false;
    }
}
function sendTo() {
// Om Showpaket
  if (document.forms[0].radBokapaket[0].checked == true) {
    document.forms[0].SkickaKnapp.disabled = false;
    document.forms[0].EmailSubject.value = "Kontaktformulär hemsidan - Showpaket";
    return (true);
  }
// Om Hotellpaket
  if (document.forms[0].radBokapaket[1].checked == true) {
    document.forms[0].SkickaKnapp.disabled = false;
    document.forms[0].EmailSubject.value = "Kontaktformulär hemsidan - Hotellpaket";
    return (true);
  }
  else {
    document.forms[0].SkickaKnapp.disabled = true;
    return (false);
  }
  alert("Eller?");
}

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.radBokapaket[0].checked == true) {
    if (theForm.txtShowdatum.value == "") {
      alert("Fyll i fältet \"Showdatum\"!");
      theForm.txtShowdatum.focus();
      return (false);
    }
  }

  if (theForm.radBokapaket[1].checked == true) {
    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);
    }
  }

  return (true);
}

