/* <![CDATA[ */
function changeSortOrderx(tx) {
        if (document.getElementById("rname").className == "visix") {
		document.getElementById("rname").className = "invisix"
		document.getElementById("pname").className = "visix"
        } else {
		document.getElementById("rname").className = "visix"
		document.getElementById("pname").className = "invisix"
	}
} // changeSortOrder

function sortAn(an1, an2) {
	document.getElementById(an1).className = "visix"
	document.getElementById(an2).className = "invisix"
	
	
} // sortAn


function newRL (tx) {
	document.auth.maxipaxi.value = tx
	document.auth.submit()
} // newRL

function nein () {
	document.auth.maxipaxi.value = "start"
	document.auth.submit()
} // nein

function selan(tx) {
	document.auth.selfin.value = tx.value
} // selan

function thisan(tx) {
	document.auth.requan.value = tx
	newRL("altAn")
} // thisan

function backx () {
	history.go(-1)
} // backx

function newMem (tx) {
	var x =0;
	var s = "";
	var rex = /^\s*$/
	var pex = /^\s+/
	var pix = /\s+$/
	var mex = /\S+\@[a-z0-9\-]+\.[a-z0-9\-]+/i
	with (document.auth) {
		if (rex.exec(pname.value)) {
			s += "Der Name muss gesetzt werden\n"
			x++;
		}
		if (rex.exec(vorname.value)) {
			s += "Der Vorname muss gesetzt werden\n"
			x++;
		}
		if (rex.exec(login_id.value)) {
			s += "Der Login Name muss gesetzt werden\n"
			x++;
		}
		if (rex.exec(mail.value)) {
			s += "Die Mail Addresse muss gesetzt werden\n"
			x++;
		}
		if (!mex.exec(mail.value)) {
			s += "Das ist keine Mail Addresse\n"
			x++
		}
		passwort.value = passwort.value.replace(pex, "")
		passwort.value = passwort.value.replace(pix, "")
		if (rex.exec(passwort.value)) {
			s += "Das Passwort muss gesetzt werden\n"
			x++;
		}
		if (passwort.value.length < 6) {
			s += "Das Passwort muss mindestens 6 Zeichen enthalten\n"
			x++;
		}
	}
	
	if (x == 0 ) newRL(tx)
	else alert(s)
} // newMem

function editMem (tx) {
	var x =0;
	var s = "";
	var rex = /^\s*$/
	var pex = /^\s+/
	var pix = /\s+$/
	var mex = /\S+\@[a-z0-9\-]+\.[a-z0-9\-]+/i
	with (document.auth) {
		if (rex.exec(pname.value)) {
			s += "Der Name muss gesetzt werden\n"
			x++;
		}
		if (rex.exec(vorname.value)) {
			s += "Der Vorname muss gesetzt werden\n"
			x++;
		}
		if (rex.exec(login_id.value)) {
			s += "Der Login Name muss gesetzt werden\n"
			x++;
		}
		if (rex.exec(mail.value)) {
			s += "Die Mail Addresse muss gesetzt werden\n"
			x++;
		}
		if (!mex.exec(mail.value)) {
			s += "Das ist keine Mail Addresse\n"
			x++
		}
		passwort.value = passwort.value.replace(pex, "")
		passwort.value = passwort.value.replace(pix, "")
		if (rex.exec(passwort.value)) {
			s += "Das Passwort muss gesetzt werden\n"
			x++;
		}
		if (passwort.value.length < 5) {
			s += "Das Passwort muss mindestens 5 Zeichen enthalten\n"
			x++;
		}
	}
	
	if (x == 0 ) newRL(tx)
	else alert(s)
} // editMem

function checkMem(tx) {
	var x =0;
	var rex = /^\s*$/
	with (document.auth) {
		if (rex.exec(pname.value + vorname.value)) {
			document.getElementById("pname").value = "Hier"
			document.getElementById("pname").style.color = "red"
			document.getElementById("vorname").value = "und hier"
			document.getElementById("vorname").style.color = "red"
			alert("Gib für den Check mindestens Deinen Namen und Vornamen an in der Maske und dann klicke wieder auf Bin ich vielleicht schon registriert")
			x++;
		}
	}
	if (x == 0) newRL(tx)
}	// checkMem
		
function checkPass(tx) {
	var x =0;
	var rex = /^\s*$/
	with (document.auth) {
		if (rex.exec(pname.value + vorname.value)) {
			document.getElementById("pname").value = "Hier"
			document.getElementById("pname").style.color = "red"
			document.getElementById("vorname").value = "und hier"
			document.getElementById("vorname").style.color = "red"
			alert("Gib für den Check mindestens Deinen Namen und Vornamen an in der Maske und dann klicke wieder auf Ich habe mein Passwort vergessen")
			x++;
		}
	}
	if (x == 0) newRL(tx)
}	// checkPass
		

function newGru (tx) {
	var x = 0;
	var rex = /^\s*$/
	if (rex.exec(document.auth.gname.value)) {
		alert("Der Name muss gesetzt werden")
		x++;
	}
	if (x == 0 ) newRL(tx)
} // newMem

function checkDate(tx) {
	var jahr = ""
	var xdt = ""
	jahr = document.auth.jahred.value
	xdt = document.auth.date_von.value
	var rex = new RegExp(jahr + "\\-\\d{2}\\-\\d{2}")
	if (!rex.exec(xdt)) {
		alert ("Das ist kein Datum aus dem Jahr " + jahr)
		return
	}
	newRL(tx)
}	// end checkDate

function checkKurs(tx) {
	var x = "";
	var rex = new RegExp("\\d{4}\\-\\d{2}\\-\\d{2}") 
	if (!rex.exec(document.auth.start.value)) {
		x += "Bitte Start Datum angeben\n"
	}
	if (!rex.exec(document.auth.end.value)){
		x += "Bitte End Datum angeben\n"
	}
	rex = new RegExp("^\\s*$")
	if (rex.exec(document.auth.descript.value)) {
		x += "Bitte Beschreibung angeben\n"
	}
	if (x != "") {
		alert(x)
		return
	}
	newRL(tx)
}	// end checkKurs

function checkRAL (tx) {
	var x = "";
	var rex = new RegExp("\\d{4}\\-\\d{2}\\-\\d{2}") 
	if (!rex.exec(document.auth.start.value)) {
		x += "Bitte Start Datum angeben\n"
	}
	if (!rex.exec(document.auth.end.value)){
		x += "Bitte End Datum angeben\n"
	}
	rex = new RegExp("^\\s*$")
	if (rex.exec(document.auth.wo.value)) {
		x += "Bitte Flugplatz angeben\n"
	}
	if (x != "") {
		alert(x)
		return
	}
	newRL(tx)
	
}	// end checkRAL

function mitlist (tx) {
	document.auth.pmemsa.value = tx
	newRL("altanp")
} // mitlist

function mitdel (tx) {
	document.auth.pmemsa.value = tx
	newRL("altmeng")
} // mitdel
	
function mitsm (tx) {
	document.auth.pmemsa.value = tx
	newRL("altsm")
} // mitdel
	
function mitgrup (tx) {
	document.auth.gmensa.value = tx
	newRL("grulo")
} // mitgrup

function mutgrup (tx) {
	document.auth.gmensa.value = tx
	newRL("grupo")
} // mutgrup

function fludilei_anmelden (tx) {
	document.auth.gmensa.value = tx
	newRL("fanmelden")
} // fludilei_anmelden

function jahr_gewechselt() {
        if (document.getElementById("jahresdiv").className == "visix") {
                document.getElementById("jahresdiv").className = "invisix"
        } else {
                document.getElementById("jahresdiv").className = "visix"
        }
} // jahr gewechselt

var cY = 0; var rY = 0; 
var remid = ""

function UpdateCursorPosition(e){ cY = e.pageY;} 

function UpdateCursorPositionDocAll(e){ cY = event.clientY;} 

if(document.all) { document.onmousemove = UpdateCursorPositionDocAll; } 
else { document.onmousemove = UpdateCursorPosition; } 

function AssignPosition(d) { 
if(self.pageYOffset) { 
rY = self.pageYOffset; 
} 
else if(document.documentElement && document.documentElement.scrollTop) { 
rY = document.documentElement.scrollTop; 
} 
else if(document.body) { 
rY = document.body.scrollTop; 
} 
if(document.all) { 
cY += rY; 
} 
d.style.top = (cY-130) + "px"; 
}	// AssignPosition 


function HideContent(d) { 
if(d.length < 1) { return; } 
document.getElementById(d).style.display = "none"; 
document.getElementById(d).style.visibility = "hidden"; 
} 

function ShowContent(d) { 
if(d.length < 1) { return; } 
var dd = document.getElementById(d); 
AssignPosition(dd); 
dd.style.display = "block"; 
dd.style.visibility = "visible"
} 

function ReverseContentDisplay(d) { 
if(d.length < 1) { return; } 
var dd = document.getElementById(d); 
AssignPosition(dd); 
if(dd.style.display == "none") { dd.style.display = "block"; } 
else { dd.style.display = "none"; } 
} 

function showDetails(tx) {
	if(remid == "") HideContent("d0")
	else HideContent(remid)
	ShowContent(tx)
	remid = tx
} // showDetails

function showDetailsp(tx) {
	var p = "p" + tx
	if(remid != "") HideContent(remid)
	ShowContent(p)
	remid = p
} // showDetails

function showEntryx(tx) {
	var p = "p" + tx
	if(remid != "") HideContent(remid)
	var dd = document.getElementById(p)
	dd.style.display = "block"
	dd.style.visibility = "visible"
	remid = p
} // showEntryx

function checkEnter(e, tx) {
	var characterCode
	characterCode = e.keyCode
	if (characterCode == 13) {
		newRL(tx)
	} else {
		return true
	}
}	// checkEnter

function flein(tx) {
	document.auth.tabid.value = tx
	if (typeof document.auth.blink != "undefined") document.auth.blink.value= "blink"
	if (document.auth.dipers.value == 0) {
		newRL("fl_comp")
	} else newRL("fl_dazu")
}	// flein

function fdaus(tx, px) {
	document.auth.fdein.value = tx
	document.auth.fdein2.value = px
	newRL("fdaus")
}	// fdaus

function fdein(tx, px) {
	document.auth.fdein.value = tx
	document.auth.fdein2.value = px
	newRL("fdein")
}	// fdein

function setSchlepppilot() {
	newRL("fl_dazu")
}	// setSchlepppilot

function menofd(tx, px) {
	document.auth.mefd1.value = tx
	document.auth.mefd2.value = px
	newRL("mich_abmelden");
}	// menofd

function repblacky(tx, px) {
	if (typeof document.auth.fdein == "undefined") {
		document.auth.mefd1.value = tx
		document.auth.mefd2.value = px
	} else {
		document.auth.fdein.value = tx
		document.auth.fdein2.value = px
	}
	newRL("blacky_ersetzen");
}	// replacky

function blacky_replace(tx) {
	document.auth.tabid.value = tx
	newRL("blacky_replace")
} 

function mefd(tx, px, qx) {
	document.auth.mefd1.value = tx
	document.auth.mefd2.value = px
	document.auth.mefd3.value = qx
	newRL("fanmelden");
}	// mefd

function flaus(tx) {
	document.auth.tabid.value = tx
	newRL("fl_weg")
}

function miein(tx) {
	document.auth.tabid.value = tx
	newRL("fl_dazu")
}

function dvdb_test(tx) {
	newRL(tx)
} 

function diesen_wahlen(tx) {
	document.auth.dipers.value = tx
	newRL("fl_dazu")
}

function winden_ein(tx) {
	document.auth.datum_id.value = tx
	newRL("winden_ein")
}	// winden_ein 

function winden_aus(tx) {
	document.auth.datum_id.value = tx
	newRL("winden_aus")
}	// winden_aus

function calcLoginId () {
        with (document.auth) {
                if (pname.value != "" && vorname.value != "")  {
                        login_id.value = vorname.value.toLowerCase() + "." + pname.value.toLowerCase()
                }
        }
}	// calcLoginId

function pdf (tx) {
	document.location = tx
}	// function pdf

function submit_to(tx) {
	document.auth.action = tx
	document.auth.submit()
}	// submit_to

function authorix(tx) {
	if (document.auth.authori.value == 0) {
		alert("Welche Authorisierung?")
		return
	}
	if (document.auth.dipers.value == 0) {
		alert("Wem soll ich die Authorisierung zuordnen?") 
		return
	}
	newRL(tx)
}	// authori

function authoweg(tx) {
	if (document.auth.authory.value == 0) {
		alert("Welche Authorisierung löschen?")
		return
	}
	if (document.auth.diperx.value == 0) {
		alert("Bei welcher Person löschen?")
		return
	}
	newRL(tx)		
}	// authoweg

function daix(tx) {
	document.auth.dilo.value = tx
}	// daix

function daig(tx) {
	document.auth.dilg.value = tx
}

function dilax(tx) {
	document.auth.dilar.value = tx
}	// dilax

function wilax(tx) {
	document.auth.dilax.value = tx
}	// wilax

function editThis(tx) {
	document.auth.schlepp.value = tx
	newRL("updateSchlepp")
}	// editThis

function editSchul(tx) {
	document.auth.schul.value = tx
	newRL("editschul")
}	// editSchul

function loschSchul(tx) {
	document.auth.schul.value = tx
	newRL("loschschul")
}	// loschSchul

function eraseSchul(tx) {
	document.auth.schul.value = tx
	newRL("eraseschul")
}	// eraseSchul

function neuSchul(tx, ty) {
	document.auth.schul.value = tx
	document.auth.schulung.value = ty
	newRL("schulneu")
}	// neuSchul

function insertSchul(tx, ty) {
	document.auth.schul.value = tx
	document.auth.schulung.value = ty
	newRL("insertschul")
}	// insertSchul

function mutSchul(tx, ty) {
	document.auth.schul.value = tx
	document.auth.schulung.value = ty
	newRL("mutschul")
}	// mutSchul

function ofo() {
	var Wochentag = new Array("Sonntag", "Montag", "Dienstag", "Mittwoch",
                          "Donnerstag", "Freitag", "Samstag");
	document.auth.zeit.value = ""
	for (i = 0; i<Wochentag.length; i++) {
		var dix = "zdiv"+i
		document.getElementById(dix).className = "invisir"
	}
	r = /\s*(\d{4})\-(\d{2})\-(\d{2})/
	r.exec(document.auth.angulv.value)
	var dix = new Date()
	var y = parseInt(RegExp.$1, 10)
	var m = parseInt(RegExp.$2, 10)-1
	var d = parseInt(RegExp.$3, 10)
	dix.setFullYear(y)
	dix.setMonth(m)
	dix.setDate(d)
	var dax = dix.getDay()
	var sex = "zdiv"+dax
	document.getElementById(sex).className = "visir"
}	// ofo

function setT(tx) {
	document.auth.zeit.value = tx
}	// setT

function sts(tx) {
	//sendScrollPosition();setfocuselement(this);showDetailsp(tx)
	sendScrollPosition();showDetailsp(tx)
}	// sts

function sortOther() {
	if(document.getElementById("dsort1").className == "visix") {
		document.getElementById("dsort1").className = "invisix"
		document.getElementById("dsort2").className = "visix"
	} else {
		document.getElementById("dsort1").className = "visix"
		document.getElementById("dsort2").className = "invisix"
	}
}	// sortOther

/* ]]> */
