function del_platz(n,i,a) {
	if(confirm("Soll der Platz \""+n+"\" gelöscht werden?\nDamit gehen auch alle Buchungen für diesen Platz verloren.")) {
		self.location = "?a="+a+"&action=plaetze&delplatz="+i;
	} 
}
function del_gruppe(n,i,a) {
	if(confirm("Soll die Gruppe \""+n+"\" gelöscht werden?\nDamit gehen auch alle Buchungen für diese Gruppe und deren Plätze verloren.")) {
		self.location = "?a="+a+"&action=plaetze&delgruppe="+i;
	} 
}
function del_artikel(n,i,a) {
	if(confirm("Soll der Artikel \""+n+"\" gelöscht werden?\nDamit gehen auch alle Verkaufszahlen für diesen Artikel verloren.")) {
		self.location = "?a="+a+"&action=artikel&delartikel="+i;
	} 
}
function del_artikelgruppe(n,i,a) {
	if(confirm("Soll die Artikelgruppe \""+n+"\" gelöscht werden?\nDamit gehen auch alle Verkaufszahlen für diese Gruppe und deren Artikel verloren.")) {
		self.location = "?a="+a+"&action=artikel&delartikelgruppe="+i;
	} 
}
function del_zeit(n,i,zs,a) {
	if(confirm("Soll die Zeit \""+n+"\" gelöscht werden?\nDamit gehen auch alle Buchungen für diese Zeit verloren.")) {
		self.location = "?a="+a+"&action=zeiten&zeitset_id="+zs+"&delzeit="+i;
	} 
}
function del_asl(n,i,a) {
	if(confirm("Soll die Benutzer-Kategorie \""+n+"\" gelöscht werden?\nDamit gehen auch alle Buchungen und Preissets für diese Kategorie verloren.")) {
		self.location = "?a="+a+"&action=asl&delasl="+i;
	} 
}
function del_bf(n,i,a) {
	if(confirm("Soll die Buchungsform \""+n+"\" gelöscht werden?")) {
		self.location = "?a="+a+"&action=buchungsformen&delbf="+i;
	} 
}
function del_sr(n,i,b,a) {
	if(confirm("Soll das Spezialrecht \""+n+"\" gelöscht werden?")) {
		self.location = "?a="+a+"&action=spezialrechte&benutzer="+b+"&delbf="+i;
	} 
}
function del_bezahlform(n,i,a) {
	if(confirm("Soll die Bezahlform \""+n+"\" gelöscht werden?")) {
		self.location = "?a="+a+"&action=bezahlformen&delbezahlform="+i;
	} 
}
function del_orderform(i,a) {
	if(confirm("Soll das Bestellformular gelöscht werden?")) {
		self.location = "?a="+a+"&action=orderforms&delorderform="+i;
	} 
}
function del_statistikset(n,i,a) {
	if(confirm("Soll die Themengruppe \""+n+"\" gelöscht werden?")) {
		self.location = "?a="+a+"&action=statistikset&delstatistikset="+i;
	} 
}
function del_statistikzeiten(n,i,a) {
	if(confirm("Soll der Statistik-Zeitraum \""+n+"\" gelöscht werden?")) {
		self.location = "?a="+a+"&action=statistikset&delstatistikzeiten="+i;
	} 
}
function del_buchungskat(n,i,a) {
	if(confirm("Soll die Buchungskategorie \""+n+"\" gelöscht werden?")) {
		self.location = "?a="+a+"&action=buchungskat&delbuchungskat="+i;
	} 
}
function del_buchungsfenster(n,i,a) {
	if(confirm("Soll das Buchungsfenster \""+n+"\" gelöscht werden?")) {
		self.location = "?a="+a+"&action=buchungsfenster&delbuchungsfenster="+i;
	} 
}
function del_turnier(n,i,a) {
	if(confirm("Soll das Turnier \""+n+"\" gelöscht werden?")) {
		self.location = "?a="+a+"&action=turniere&delturnier="+i;
	} 
}
function del_zeitset(n,i,a) {
	if(confirm("Soll das Zeitset \""+n+"\" gelöscht werden?\nDamit gehen auch alle Buchungen für dieses Zeitset verloren.")) {
		self.location = "?a="+a+"&action=zeiten&delzeitset="+i;
	} 
}
function del_benutzer(n,i,a) {
	if(confirm("Soll der Benutzer \""+n+"\" gelöscht werden?\nDamit gehen auch alle künftigen, unbezahlten Buchungen dieses Benutzers verloren.")) {
		self.location = "?a="+a+"&action=benutzer&admin=1&delbenutzer="+i;
	} 
}
function del_team(n,i,a) {
	if(confirm("Soll das Team \""+n+"\" gelöscht werden?\nDamit gehen auch alle künftigen, unbezahlten Buchungen dieses Teams verloren.")) {
		self.location = "?a="+a+"&action=benutzer&admin=1&delbenutzer="+i;
	} 
}
function del_preisset(n,i,a) {
	if(confirm("Soll das Preisset \""+n+"\" gelöscht werden?\nDamit gehen auch alle Buchungen für dieses Preisset verloren.")) {
		self.location = "?a="+a+"&action=preise&delpreisset="+i;
	} 
}
function del_zeitplatz(i,a) {
	if(confirm("Soll diese Zuordnung gelöscht werden?")) {
		self.location = "?a="+a+"&action=zeitplatz&delzeitplatz="+i;
	} 
}
function del_account(accountname,a) {
	if(confirm("Soll der Account \""+accountname+"\" gelöscht werden?")) {
		self.location = "?a="+a+"&action=accounts&delaccount=1";
	} 
}
function datumJump(targ,selObj,restore){ 
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function goto(targ, url) {
  eval(targ+".location='"+url+"'");
}
function goto_flyout(url) {
  window.flyout.location=url;
}
function stopError() {
	return true;
}
function setMarker(id,color) {
	document.getElementById(id).style.backgroundColor=color;
}
function tipp(id,f) {
	if(f==1) {
		document.getElementById('tipp_'+id).style.display = 'block';
	} else {
		document.getElementById('tipp_'+id).style.display = 'none';
	}
}
function ac(id) {
		document.getElementById(id).checked = true;
		document.getElementById("label_"+id).style.backgroundColor = '#d00';
		document.getElementById("label_"+id).style.color = '#fff';
		document.getElementById("label_"+id).style.padding = '6px';
	/*
	ch = document.getElementById(id).checked;
	if(ch==true) { 
		document.getElementById(id).checked = false;
		document.getElementById("label_"+id).style.backgroundColor = '#fff';
		document.getElementById("label_"+id).style.color = '#000';
		document.getElementById("label_"+id).style.padding = '0';
	} else {
		document.getElementById(id).checked = true;
		document.getElementById("label_"+id).style.backgroundColor = '#d00';
		document.getElementById("label_"+id).style.color = '#fff';
		document.getElementById("label_"+id).style.padding = '6px';
	}*/
}
function ac_plaetze(id) {
		document.getElementById(id).checked = true;
}
function delconf(mess) {
	if(confirm(mess)) { document.getElementById('delform').submit(); } 
}
function delconf2(mess) {
	if(confirm(mess)) { document.getElementById('delform2').submit(); } 
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function MM_effectAppearFade(targetElement, duration, from, to, toggle)
{
	Spry.Effect.DoFade(targetElement, {duration: duration, from: from, to: to, toggle: toggle});
}
function messagefade(dauer) {
	window.setTimeout("fade()",dauer);
}
function fade() {
	MM_effectAppearFade('message', 1000, 100, 0, false);
}
function aufzu(id) {
	h = document.getElementById('form_'+id).style.height;
	if(h=="auto") {
		document.getElementById('form_'+id).style.height = "50px";
		document.getElementById('butt_'+id).src = "obo_icons/tab_add.png";
	} else {
		document.getElementById('form_'+id).style.height = "auto";
		document.getElementById('butt_'+id).src = "obo_icons/tab_delete.png";
	}
}

function preispaste(asl,preise) {
	var pr = preise.split("*");
	for(i=0;i<pr.length;i++) {
		//document.write(pr[i]);
		var p = pr[i].split("=");
		document.getElementById(p[0]+'_'+asl).value=p[1];
		//if(i==pr.length) { break; }
	}
	document.getElementById('save_'+asl).style.padding='5px';
}

function trim (string) {
  return string.replace (/^\s+/, '').replace (/\s+$/, '');
}

