self.focus();

function removeChar(str,delim){
arr = str.split(delim);
return arr[0];
}
function Oeffne(ziel)
{
if(opener) {
if(opener.closed) self.location.href = ziel;
else opener.location.href = ziel;
}
else zielfenster = self.location.href = ziel;
}
function WindowSettings(n,a,x,y,w,h){
this.name = n;
this.appearance = a;
this.xPos = x;
this.yPos = y;
this.width = w;
this.height = h;
this.openWindow = WindowSettings_openWindow;
}
function WindowSettings_openWindow(opt_URL){
if(!opt_URL) opt_URL = "about:blank";
var d=self.document, de=d.documentElement, ie=d.all;
var winX = ie ? self.screenLeft : self.screenX;
var winWidth = ie ? (de && de.clientWidth ? de.clientWidth : d.body.clientWidth) : self.outerWidth;
var winY = ie ? self.screenTop : self.screenY;
var winHeight = ie ? (de && de.clientHeight ? de.clientHeight : d.body.clientHeight) : self.outerHeight;
var x, y, w, h;
if(isNaN(this.xPos)){
w = this.width;
if(this.xPos == "CenteredOnWindow"){
x= winX + ((winWidth - w)/2);
}else if(this.xPos == "CenteredOnScreen"){
x= winX + ((winWidth - w)/2);
}
}else{
x = this.xPos;
if(!isNaN(this.width))
w = this.width;
else{
if(this.width == "WholeScreen")
w = screen.width - x;
}
}
if(isNaN(this.yPos)){
h = this.height;
if(this.yPos == "CenteredOnWindow"){
y = winY + ((winHeight - h)/2);
}else if(this.yPos == "CenteredOnScreen"){
y = winY + ((winHeight - h)/2);	
}
}else{
y = this.yPos;
if(!isNaN(this.height))
h = this.height;
else{
if(this.height == "WholeScreen")
h = screen.height - y - 200;
}
}
var w = window.open(opt_URL, this.name, "top="+y+",left="+x+",width="+w+",height="+h+","+this.appearance);
w.focus();
return w;
}
// -- Standard-Fenster-Typen - Definition --
var TinyCentered = new WindowSettings("popup", "location=no,menubar=no,resizeable=no,scrollbars=no,status=no,toolbar=no", "CenteredOnWindow", "CenteredOnWindow", 250, 150);
var SmallCentered = new WindowSettings("popup", "location=no,menubar=no,resizeable=no,scrollbars=no,status=no,toolbar=no", "CenteredOnWindow", "CenteredOnWindow", 400, 250);
var MiddleCentered = new WindowSettings("popup", "location=no,menubar=no,resizeable=no,scrollbars=no,status=no,toolbar=no", "CenteredOnWindow", "CenteredOnWindow", 400, 450);
var LeftFullHeight = new WindowSettings("klein", "location=yes,menubar=yes,scrollbars=yes,toolbar=yes,status=yes,resizable=yes", 10, 0, 650, "WholeScreen");
var LeftFullHeight_2 = new WindowSettings("klein2", "location=yes,menubar=yes,scrollbars=yes,toolbar=yes,status=yes,resizable=yes", 50, 0, 650, "WholeScreen");
var LeftFullHeight_Print = new WindowSettings("druck", "location=yes,menubar=yes,scrollbars=yes,toolbar=yes,status=yes,resizable=yes", 10, 0, 650, "WholeScreen");
function ONW(settings, opt_URL, opt_formName, opt_doSubmit){
var URL, formRef;
if(!settings){
alert("ONW(): No 'settings' were passed.");
return;
}
URL = opt_URL ? opt_URL : 'about:blank';
if(opt_formName){
if(document.forms[opt_formName].name)
formRef = document.forms[opt_formName];
}
var newWin = settings.openWindow(formRef ? 'about:blank' : URL);

if(formRef){
formRef.target = settings.name;
if(opt_doSubmit) formRef.submit();
}
//return newWin;
}
function CallONW(typ,URL,form, submit){
switch(typ){
case "P":
typ=LeftFullHeight_Print;break;
case 1:
typ=LeftFullHeight;break;
case 2:
typ=TinyCentered;break;
case 3:
typ=SmallCentered;break;
case 4:
typ=LeftFullHeight_2;break;
}
var fn=!form || !form.name?null:form.name;
if(URL && form) form.action=URL;
ONW(typ,URL,fn,submit != "return");
}
// #####################################
function SField(e,t,m){
this.elementName=e;
this.type=t;
this.message=m;
}
function validate(formName, items, opt_onw){
var f=document.forms[formName];
var l=items.length;
for(var i=0;i<l;i++){
var er=false;
var e=f.elements[items[i].elementName];
if(items[i].type.toLowerCase() == 'required'){
if(!requiredFormfieldCheck(e)) er=true;
}else if(items[i].type.toLowerCase() == 'email'){
var r=/^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z0-9.-]{2,4}$/;
er = (e.value!='' && !r.test(e.value));
}
if(er){
alert(items[i].message);
if(e[0] && e[0].type=='radio') e[0].focus(); else e.focus();
return false;
}
}if(opt_onw) ONW(opt_onw, '', formName);
return true;
}
function requiredFormfieldCheck(e){
var t = e.type ? e.type : (e.length && e.length>0 ? e[0].type : null);
switch(t){
case "text": case "textarea": case "password":
return e.value != "";
break;
case "select-one":
return e.options[e.selectedIndex].value != "";
break;
case "select-multiple":
return !(e.selectedIndex == -1);
break;
case "checkbox":
return e.checked;
break;
case "radio":
var l=e.length;
var c = false;
for(var i=0; i<l; i++){
if(e[i].checked){
c = true;
break;
}
}
return c;
break;
}
return true;
}