<!-- Begin



// Bringt 2 Boxen mit id auf gleiche Höhe
function gleicheHoehe(id1,id2) {
	var einshoehe = document.getElementById(id1).offsetHeight;
	var zweihoehe = document.getElementById(id2).offsetHeight;
	if (einshoehe >= zweihoehe) {
		document.getElementById(id2).style.height = einshoehe-2+"px";
	} else {
		document.getElementById(id1).style.height = zweihoehe-2+"px";
	} 
}
/*
function box_update(script,element) {
  new Ajax.Updater(element,script, {
  method: 'get',
  encoding: 'utf-8'
    //encoding: 'iso-8859-1'
//  insertion: Insertion.Bottom
  });
}


function box_update2(script,element) {
	box_update(script,element);
	alert(1);
	gleicheHoehe('boxtop5','boxveranstaltungen');
	alert(2);
}
*/
function change_focus(obj)
{
	if(obj.id < "i3")
	{
		if(obj.value.length >= 2)
		{
			obj.blur();
			if(obj.id == "i1") { var x = "i2";}
			if(obj.id == "i2") { var x = "i3";}
			document.getElementById((x)+"").focus();
		}
	}
	else
	{
		if(obj.value.length >= 5)
		{
			alert("ende");
		}
	}
}


function disable_submit() {
	document.userdata.submit_form.disabled = "true";
	return true;
}

  function chkkontaktform()
   {
            if(window.document.kontaktform.Name.value == "")  {
             alert("Bitte Feld *Name* ausfüllen.");
			 document.kontaktform.Name.focus();
             return false;
             }
           if(window.document.kontaktform.Email.value == "")  {
             alert("Bitte Feld *Email* ausfüllen.");
             document.kontaktform.Email.focus();
             return false;
             }
           if(window.document.kontaktform.Mitteilung.value == "")  {
             alert("Bitte Feld *Mitteilung* ausfüllen.");
             document.kontaktform.Mitteilung.focus();
             return false;
             }
           if(window.document.kontaktform.txtCode.value == "")  {
             alert("Bitte geben Sie den *Sicherheitscode* ein.");
             document.kontaktform.txtCode.focus();
             return false;
             }

}
   
  function chkkommentarform()
   {
            if(window.document.kommentarform.Name.value == "")  {
             alert("Bitte Feld *Name* ausfüllen.");
             document.kommentarform.Name.focus();
             return false;
             }
           if(window.document.kommentarform.Email.value == "")  {
             alert("Bitte Feld *Email* ausfüllen.");
             document.kommentarform.Email.focus();
             return false;
             }
           if(window.document.kommentarform.Kommentar.value == "")  {
             alert("Bitte Feld *Kommentar* ausfüllen.");
             document.kommentarform.Kommentar.focus();
             return false;
             }
           if(window.document.kommentarform.txtCode.value == "")  {
             alert("Bitte geben Sie den *Sicherheitscode* ein.");
             document.kommentarform.txtCode.focus();
             return false;
             }
   }

  function chkempfehlungform()
   {
            if(window.document.empfehlungform.Absendername.value == "")  {
             alert("Bitte Feld *Name* ausfüllen.");
             document.empfehlungform.Absendername.focus();
             return false;
             }
           if(window.document.empfehlungform.Absendermail.value == "")  {
             alert("Bitte Feld *Absender-Email* ausfüllen.");
             document.empfehlungform.Absendermail.focus();
             return false;
             }
           if(window.document.empfehlungform.Empfaengermail.value == "")  {
             alert("Bitte Feld *Emfänger-Email* ausfüllen.");
             document.empfehlungform.Empfaengermail.focus();
             return false;
             }
           if(window.document.empfehlungform.Code.value == "")  {
             alert("Bitte geben Sie den *Sicherheitscode* ein.");
             document.empfehlungform.Code.focus();
             return false;
             }
   }




//-----------------------------------------


function fixDate(date) {
  var base = new Date(0);
  var skew = base.getTime();
  if (skew > 0)
    date.setTime(date.getTime() - skew);
}
/*
function audioplayerAnzeigen(aid,pfad) {
	var id1 = 'audiobox_'+aid;
	document.getElementById(id1).style.display = "block";
	var id2 = 'link_'+aid;
	document.getElementById(id2).style.display = "none";
	box_update('../audio/count2.php?p='+pfad,'dummy')
	return true;
}

*/
function aufundzu(abschnitt) {
	if (document.getElementById(abschnitt).style.display == 'block') {
		document.getElementById(abschnitt).style.display = 'none';
	} else {
		document.getElementById(abschnitt).style.display = 'block';
		window.location.href = "#A"+abschnitt;
	}
}




function klapp(name_der_id,select_id,rubrik_id) {
	if (document.getElementById) {
		if (document.getElementById(select_id).value == '1') {
			document.getElementById(name_der_id).style.display = 'block';
		} else {
			document.getElementById(name_der_id).style.display = 'none';
			
			document.getElementById(rubrik_id).value = document.getElementById(select_id).value;
		}
		//if (document.getElementById(name_der_id).style.display == 'block') { wert = 0; } // Box ausgeklaptt
		//if (document.getElementById(name_der_id).style.display == 'none') { wert = 1; } // Box eingeklappt

		//setCookie(name_der_id,wert);	

		//var x = getCookie(name_der_id);
		//alert(x);
	}
}

function RestlicheZeichenErmitteln(id_name,id_rest,max_value)
{
	if(document.getElementById(id_name).value.length > max_value)
		document.getElementById(id_name).value = document.getElementById(id_name).value.substr(0,max_value);
	document.getElementById(id_rest).innerHTML = max_value - document.getElementById(id_name).value.length;
}


// End -->