function neu()
{
	if(document.all.button1.value=='Neue Veranstaltung')
		var neue=window.open("/verwaltung/neuVeranstaltung.php","neu","height=600px , width=screen.availWidth , directories=no 		                             location=no, menubar=no, status=no, toolbar=no ,resizable=yes");
	else
		var neue=window.open("/verwaltung/neuNews.php","neu","height=600px , width=screen.availWidth , directories=no 		                             location=no, menubar=no, status=no, toolbar=no ,resizable=yes");
}

function aendern()
{
var anzahl=parseInt(document.all.anzahlDS.value);
var i;
	if(document.all.button1.value=='Neue Veranstaltung')
	{
		document.aendern_loeschen.action="/verwaltung/aendern.php";	
	}
	else
	{
		document.aendern_loeschen.action="/verwaltung/aendern_News.php";	
	}
	for(i = 1; i <= anzahl; i++)
  	{
		if(eval("document.all.auswahl" + i + ".checked"))
		{
			document.aendern_loeschen.ds_id.value=eval("document.all.id" +i + ".innerText");
			document.aendern_loeschen.submit();
		}
	}
}

function loeschen()
{
var anzahl=parseInt(document.all.anzahlDS.value);
  var i=1;
  	if(document.all.button3.value=='Veranstaltung Löschen')
	{
		document.aendern_loeschen.action="loeschen.php";
	}
	else
	{
		document.aendern_loeschen.action="/verwaltung/loeschen_News.php";	
	}

for(i = 1; i <= anzahl; i++)
  	{
		ausgewaehlt = eval("document.all.auswahl" + i + ".checked");
		if(ausgewaehlt)
		{
			document.aendern_loeschen.ds_id.value=eval("document.all.id" +i + ".innerText");
			document.aendern_loeschen.submit();
		}
	}
}

function zurueck()
{
	history.back();	
}

// Aufruf bei Änderung eines DS in aendern.php
function datenuebernahme(veranst_id, motto, thema, inhalt, begin_dat, begin_time, end_dat, end_time, anazhl_stunden, preis_1, preis_2, durchf_Ort, bemerkungen )
{
	document.all.veranst_id.value=veranst_id;
	document.all.motto.value=motto
	document.all.thema.value=thema
	document.all.inhalt.value=inhalt
	document.all.begin_dat.value=begin_dat
	document.all.begin_time.value=begin_time
	document.all.end_dat.value=end_dat
	document.all.end_time.value=end_time
	document.all.anzahl_stunden.value=anazhl_stunden
	document.all.preis_1.value=preis_1
	document.all.preis_2.value=preis_2
	document.all.bemerkungen.value=bemerkungen
	document.all.durchf_Ort.value=durchf_Ort
	document.all.button_1.value="Änderung übernehmen"
	document.all.button_3.value="Zurück zur Veranstaltungsverwaltung"
	document.all.button_3.onClick="javascript:window.location.href = 'index.php';"
}

function datenuebernahme_News(news_id, kategorie, thema, text, datum)
{
	document.all.news_id.value=news_id;
	document.all.kategorie.value=kategorie
	document.all.thema.value=thema
	document.all.text.value=text
	document.all.datum.value=datum
	
	document.all.button_1.value="Änderung übernehmen"
	document.all.button_3.value="Zurück zur News- Verwaltung"
	document.all.button_3.onClick="javascript:window.location.href = 'index_Neuigkeiten.php';"
}

function button__3()
{
	switch(document.all.button_3.value)
	{
		case "Fenster schließen" :	self.close();
		break;
		case "Zurück zur Veranstaltungsverwaltung" : window.location.href = "../verwaltung/index.php";
		break;
		case "Zurück zur News- Verwaltung" : window.location.href = "../verwaltung/index_Neuigkeiten.php";
	}
}

function schliessen()
{
	self.close();	
}

function umschalten_News_Veranstaltungen()
{
	if(document.all.button1.value=='Neue Veranstaltung')
	{
		window.location.href = "../verwaltung/index_Neuigkeiten.php"
		document.all.button1.value='Neue Neuigkeit';
		document.all.button2.value='Neuigkeit Ändern';
		document.all.button3.value='Neuigkeit Löschen';
		document.all.button4.value='Bearbeite Veranstaltungen';
	}
	else
	{
		window.location.href = "../verwaltung/index.php"
		document.all.button1.value='Neue Veranstaltung';
		document.all.button2.value='Veranstaltung Ändern';
		document.all.button3.value='Veranstaltung Löschen';
		document.all.button4.value='Bearbeite News'	;
	}
}