﻿function CheckInput ()
{
  if (document.forms[0].elements["name"].value == "") {
      document.forms[0].elements["name"].focus();
      alert("Bitte Namen eingeben!");
      return false;
  }

  if (document.forms[0].elements["str"].value == "") {
      document.forms[0].elements["str"].focus();
      alert("Bitte Straße eingeben!");
      return false;
  }

  if (document.forms[0].elements["plz"].value == "") {
      document.forms[0].elements["plz"].focus();
      alert("Bitte Postleitzahl eingeben!");
      return false;
  }

  if (document.forms[0].elements["ort"].value == "") {
      document.forms[0].elements["ort"].focus();
      alert("Bitte Ort eingeben!");
      return false;
  }

  if (document.forms[0].elements["telefon-n"].value == "") {
      document.forms[0].elements["telefon-n"].focus();
      alert("Bitte Telefonnummer eingeben!");
      return false;
  }


  if (document.forms[0].elements["email"].value == "") {
      document.forms[0].elements["email"].focus();
      alert("Bitte E-Mail eingeben!");
      return false;
  }

  return true;
}

function download() 
{
  location.href = "index.php";
}



function CheckLandAuswahl () {
	if (document.form1.staat.options[document.form1.staat.selectedIndex].value == "aa")
	    document.form1.land.style.visibility = "visible";
	    
	else    
	    document.form1.land.style.visibility = "hidden";
}


// Ermittelt den VOB-Typ
// 0-Heinze
// 1-STLBBau
function CheckVOBTyp()
{


//	if (document.getElementsByName("stbbbau")[0] != null) 
//	  document.form1.vobtyp.value = "STLB-Bau";
//	if (document.getElementsByName("heinze")[0] != null) 
//	  document.form1.vobtyp.value = "Heinze";

	if (document.stlbbau != null) 
	  document.form1.vobtyp.value = "STLB-Bau";
	if (document.heinze  != null) 
	  document.form1.vobtyp.value = "Heinze";
}

function CheckInputVOB()
{


	b = CheckInput();
	
	if (b) CheckVOBTyp();
	
	return b;
	
}

function checkTAmax(max)
{
	text=document.form1.memo.value;

	if (text.length >= max)
	{
		document.form1.memo.value=text.substring(0,max-1);
	}
}	



