function admin_help_window() {

	var url = opener.window.location.href;

	if (url.match(/(admin.php\?file=help)/g)) {
		opener.window.history.back();
		window.focus();
	} else {
		opener.window.location.href = 'admin.php?file=help';
	}

}

function guided_window(number) {
	var left = (screen.availWidth/2) - 400;
	var top = (screen.availHeight/2) - 300;

	var colorWin = window.open("images/knowledge/guided_" + number + ".swf", number, 'scrollbars=1, toolbar=0, statusbar=0, width=800, height=600, left='+left+', top='+top);
}

function doWindowOpen(width, height, url, name) {
	var left = (screen.availWidth/2) - width/2;
	var top = (screen.availHeight/2) - height/2;
	
	var openWindow = window.open(url, name, 'menubar=1, scrollbars=1, toolbar=0, statusbar=1, width='+width+', height='+height+', left='+left+', top='+top);
}


function changeValue(x,y,q)
	{
	var countSchritt1 = 1;
	var countSchritt2 = 1;
	if(!y)
	y = 1;
	if(!q)
	q = 1;
	var z, min, max;
	if(q == 1)
	z = x.value-(-y*countSchritt1);
	else
	z = x.value-(-y*countSchritt2);
	if(!x.minvalue)
	min = Number.NEGATIVE_INFINITY;
	else
	min = x.minvalue;
	if(!x.maxvalue)
	max = Number.POSITIVE_INFINITY;
	else
	max = x.maxvalue;
	if(z >= min && z <= max)
	x.value = z;
}

function geht(x)
	{
	if(isNaN(String.fromCharCode(event.keyCode)))
	return false;
	else
	{
	var max;
	if(!x.maxvalue)
	max = Number.POSITIVE_INFINITY;
	else
	max = x.maxvalue;
	return (x.value.length < max.toString().length);
	}
}

function wertAnpassen(x)
	{
	var min, max;
	if(!x.minvalue)
	min = Number.NEGATIVE_INFINITY;
	else
	min = x.minvalue;
	if(!x.maxvalue)
	max = Number.POSITIVE_INFINITY;
	else
	max = x.maxvalue;
	if(Number(x.value) > max)
	x.value = max;
	else
	if(Number(x.value) < min)
	x.value = min;
}

function SetValue(text, field)
  {
    document.getElementById(field).value += text;
}

<!--Funktionen zum Zählen und Ausgeben der Anzahl von Zeichen in Inputfeldern -->
function countChars(minlength,e,placeholder){
	var theform=eval(placeholder)
	var lengthleft=theform.value.length
	var placeholderobj=document.all? document.all[placeholder] : document.getElementById(placeholder)
	if (window.event||e.target&&e.target==eval(placeholder)){
	if (lengthleft<0)
	theform.value=theform.value.substring(0,minlength)
	placeholderobj.innerHTML=lengthleft
	}
}

function displayChars(theform,thelimit){
	var limit_text='Anzahl Zeichen: <b><span id="'+theform.toString()+'">'+thelimit+'</span></b>'
	if (document.all||ns6)
	document.write(limit_text)
	if (document.all){
	eval(theform).onkeyup=function(){ countChars(thelimit,event,theform)}
	}
	else if (ns6){
	document.body.addEventListener('keyup', function(event) { countChars(thelimit,event,theform) }, true); 
	}
}

function restrictinput(maxlength,e,placeholder){
	if (window.event&&event.srcElement.value.length>=maxlength)
	return false
	else if (e.target&&e.target==eval(placeholder)&&e.target.value.length>=maxlength){
	var pressedkey=/[a-zA-Z0-9\.\,\/]/ 
	if (pressedkey.test(String.fromCharCode(e.which)))
	e.stopPropagation()
	}
}

function countlimit(maxlength,e,placeholder){
	var theform=eval(placeholder)
	var lengthleft=maxlength-theform.value.length
	var placeholderobj=document.all? document.all[placeholder] : document.getElementById(placeholder)
	if (window.event||e.target&&e.target==eval(placeholder)){
	if (lengthleft<0)
	theform.value=theform.value.substring(0,maxlength)
	placeholderobj.innerHTML=lengthleft
	}
}

function displaylimit(theform,thelimit){
	var feld=eval(theform)
	var lengthleft=thelimit-feld.value.length
	var limit_text='verfügbare Zeichen: <span id="'+theform.toString()+'">'+lengthleft+'</span>'
	if (document.all||ns6)
	document.write(limit_text)
	if (document.all){
	eval(theform).onkeypress=function(){ return restrictinput(thelimit,event,theform)}
	eval(theform).onkeyup=function(){ countlimit(thelimit,event,theform)}
	window.onload=function(){ return restrictinput(thelimit,event,theform)}
	window.onload=function(){ countlimit(thelimit,event,theform)}
	}
	else if (ns6){
	document.body.addEventListener('keypress', function(event) { restrictinput(thelimit,event,theform) }, true); 
	document.body.addEventListener('keyup', function(event) { countlimit(thelimit,event,theform) }, true); 
	}
}

<!--Funktion zum Ein- und Ausblenden von Inputfeldern -->
function toggleField (field) {
  if (document.all || document.getElementById)
    field.disabled = !field.disabled;
  else if (field.onfocus)
    field.onfocus = null
  else field.onfocus = skip;
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' muss eine gültige E-Mail Adresse sein.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' muss eine Zahl sein.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' muss eine Zahl zwischen '+min+' und '+max+' sein.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' ist erforderlich.\n'; }
  } if (errors) alert('Bitte beachten Sie folgende(n) Fehler:\n'+errors);
  document.MM_returnValue = (errors == '');
}

