	var druck_fenster=null;
	function druck_fenster_oeffnen(url,width,height)
	{
	widthval="width="+width;
	heightval='height='+height;
	if (druck_fenster==null || druck_fenster.closed)
	{
	druck_fenster=window.open(url,"",widthval+","+heightval+",scrollbars=no,toolbar=no,menubar=no,status=no,directories=no,locationbar=no,resizable=yes,dependent=yes,screenX=0,screenY=0");
	}
	else
	{
	druck_fenster.focus();
	druck_fenster.close();
	druck_fenster=window.open(url,"",widthval+","+heightval+",scrollbars=no,toolbar=no,menubar=no,status=no,directories=no,locationbar=no,resizable=yes,dependent=yes,screenX=0,screenY=0");
	}
	}


			function setHiddenFromList(fObjSel,fObjHid)	{	//
				l=fObjSel.length;
				fObjHid.value="";
				for (a=0;a<l;a++)	{
					fObjHid.value+=fObjSel.options[a].value+",";
				}
			}
			function setFormValueManipulate(fName,type)	{	//
				var formObj = setFormValue_getFObj(fName)
;
				if (formObj)	{
					var localArray_V = new Array();
					var localArray_L = new Array();
					var localArray_S = new Array();
					var fObjSel = formObj[fName+"_list"];
					var l=fObjSel.length;
					var c=0;
					if (type=="Remove" || type=="Top" || type=="Bottom")	{
						if (type=="Top")	{
							for (a=0;a<l;a++)	{
								if (fObjSel.options[a].selected==1)	{
									localArray_V[c]=fObjSel.options[a].value;
									localArray_L[c]=fObjSel.options[a].text;
									localArray_S[c]=1;
									c++;
								}
							}
						}
						for (a=0;a<l;a++)	{
							if (fObjSel.options[a].selected!=1)	{
								localArray_V[c]=fObjSel.options[a].value;
								localArray_L[c]=fObjSel.options[a].text;
								localArray_S[c]=0;
								c++;
							}
						}
						if (type=="Bottom")	{
							for (a=0;a<l;a++)	{
								if (fObjSel.options[a].selected==1)	{
									localArray_V[c]=fObjSel.options[a].value;
									localArray_L[c]=fObjSel.options[a].text;
									localArray_S[c]=1;
									c++;
								}
							}
						}
					}
					if (type=="Down")	{
						var tC = 0;
						var tA = new Array();

						for (a=0;a<l;a++)	{
							if (fObjSel.options[a].selected!=1)	{
									// Add non-selected element:
								localArray_V[c]=fObjSel.options[a].value;
								localArray_L[c]=fObjSel.options[a].text;
								localArray_S[c]=0;
								c++;

									// Transfer any accumulated and reset:
								if (tA.length > 0)	{
									for (aa=0;aa<tA.length;aa++)	{
										localArray_V[c]=fObjSel.options[tA[aa]].value;
										localArray_L[c]=fObjSel.options[tA[aa]].text;
										localArray_S[c]=1;
										c++;
									}

									var tC = 0;
									var tA = new Array();
								}
							} else {
								tA[tC] = a;
								tC++;
							}
						}
							// Transfer any remaining:
						if (tA.length > 0)	{
							for (aa=0;aa<tA.length;aa++)	{
								localArray_V[c]=fObjSel.options[tA[aa]].value;
								localArray_L[c]=fObjSel.options[tA[aa]].text;
								localArray_S[c]=1;
								c++;
							}
						}
					}
					if (type=="Up")	{
						var tC = 0;
						var tA = new Array();
						var c = l-1;

						for (a=l-1;a>=0;a--)	{
							if (fObjSel.options[a].selected!=1)	{

									// Add non-selected element:
								localArray_V[c]=fObjSel.options[a].value;
								localArray_L[c]=fObjSel.options[a].text;
								localArray_S[c]=0;
								c--;

									// Transfer any accumulated and reset:
								if (tA.length > 0)	{
									for (aa=0;aa<tA.length;aa++)	{
										localArray_V[c]=fObjSel.options[tA[aa]].value;
										localArray_L[c]=fObjSel.options[tA[aa]].text;
										localArray_S[c]=1;
										c--;
									}

									var tC = 0;
									var tA = new Array();
								}
							} else {
								tA[tC] = a;
								tC++;
							}
						}
							// Transfer any remaining:
						if (tA.length > 0)	{
							for (aa=0;aa<tA.length;aa++)	{
								localArray_V[c]=fObjSel.options[tA[aa]].value;
								localArray_L[c]=fObjSel.options[tA[aa]].text;
								localArray_S[c]=1;
								c--;
							}
						}
						c=l;	// Restore length value in "c"
					}

						// Transfer items in temporary storage to list object:
					fObjSel.length = c;
					for (a=0;a<c;a++)	{
						fObjSel.options[a].value = localArray_V[a];
						fObjSel.options[a].text = localArray_L[a];
						fObjSel.options[a].selected = localArray_S[a];
					}
					setHiddenFromList(fObjSel,formObj[fName]);

					TBE_EDITOR_fieldChanged_fName(fName,formObj[fName+"_list"]);
				}
			}
			function setFormValue_getFObj(fName)	{	//
				var formObj = document.editform;
				if (formObj)	{
					if (formObj[fName] && formObj[fName+"_list"] && formObj[fName+"_list"].type=="select-multiple")	{
						return formObj;
					} else {
						alert("Formfields missing:\n fName: "+formObj[fName]+"\n fName_list:"+formObj[fName+"_list"]+"\n type:"+formObj[fName+"_list"].type+"\n fName:"+fName);
					}
				}
				return "";
			}

function ShowRegio(loc) {
	var formField = document.getElementById('formField').value;
	var layoutField = document.getElementById('layoutField').value;
	var layoutWhat = document.getElementById('layoutWhat').value;
	var activ = document.getElementById('activ').value;

	if (loc!='' && layoutWhat!='BG' && layoutWhat!='FC' && layoutWhat!='LC' && activ=='on'){
		return alertLink('ACHTUNG: Bitte aktivieren Sie erst den Bereich,\nfür den die Farbe '+loc+' hinterlegt werden soll!')
	}

	if(activ=='off'){
		return;
	}

	if (loc!='')
		document.getElementById(formField).value=loc;
	else
		loc=document.getElementById(formField).value;

	if (document.getElementById('layoutWhat').value=='BG'){
		if (layoutField=='Z.OPF'){
			document.getElementsByName('option')[0].style.background=loc;
			document.getElementsByName('option')[1].style.background=loc;
			document.getElementsByName('option')[2].style.background=loc;
			document.getElementsByName('option')[3].style.background=loc;
		}else{
			document.getElementById(layoutField).style.background=loc;
		}
	}

	if (document.getElementById('layoutWhat').value=='FC'){
		if (layoutField=='Z.OPF'){
			document.getElementsByName('option')[0].style.color=loc;
			document.getElementsByName('option')[1].style.color=loc;
			document.getElementsByName('option')[2].style.color=loc;
			document.getElementsByName('option')[3].style.color=loc;
		}else{
			document.getElementById(layoutField).style.color=loc;
		}
	}

	if (document.getElementById('layoutWhat').value=='LC'){
		if (layoutField=='Z.OPF'){
			document.getElementsByName('option')[0].style.color=loc;
			document.getElementsByName('option')[1].style.color=loc;
			document.getElementsByName('option')[2].style.color=loc;
			document.getElementsByName('option')[3].style.color=loc;
		}else{
			layoutField = layoutField + '.L';
			
			document.getElementById(layoutField).style.color=loc;
		}
	}
}

function setMain(auswForm,auswLayout,auswWhat) {
	document.getElementById('formField').value=auswForm;
	//document.getElementById('formField').value=fieldList[0];
	document.getElementById('layoutField').value=auswLayout;
	document.getElementById('layoutWhat').value=auswWhat;

	for (i = 0; i < fieldList.length; i++) {
		var id=fieldList[i];
		if(id!=auswForm){
			document.getElementById(id).disabled=1;
		}else{
			document.getElementById(id).disabled=0;
		}
	}

	if(auswWhat=='BG' || auswWhat=='FC' || auswWhat=='LC'){
		document.getElementById('activ').value='on';
	}else{
		document.getElementById('activ').value='';
	}
	//document.getElementById(auswForm).disabled=1;
} 

function enableAll(){
	for (i = 0; i < fieldList.length; i++) {
		var id=fieldList[i];
		document.getElementById(id).disabled=0;
	}
}
function SwitchStatus(){
	var formField = document.getElementById('formField').value;
	var layoutField = document.getElementById('layoutField').value;
	var layoutWhat = document.getElementById('layoutWhat').value;
	var activ = document.getElementById('activ').value;

	if (activ=='on'){
		document.getElementById('activ').value='';
		 disableAll();
	}else{
		document.getElementById('activ').value='on';
	}
	var activ = document.getElementById('activ').value;
}

function checkStatus($color){
	var activ = document.getElementById('activ').value;
	if (activ=='on'){
		ShowRegio('$color');
		document.getElementById('activ').value='off';
	}else{
		document.getElementById('activ').value='on';
	}
	var activ = document.getElementById('activ').value;
	alert(activ);
}


function disableAll(){
	document.getElementById('formField').value='';
	document.getElementById('layoutField').value='';
	document.getElementById('layoutWhat').value='';

	for (i = 0; i < fieldList.length; i++) {
		var id=fieldList[i];
		document.getElementById(id).disabled=1;
	}
//checkStatus();
}

function changeClassProperty(classname,prop,val)
{
  var rules,docstyle=document.styleSheets.item(0);
  if(docstyle.rules)rules=docstyle.rules;
  if(docstyle.cssRules)rules=docstyle.cssRules;
  var rl=rules.length;
  for(var i=0;i<rl;i++)
  {
alert(rules.item(i).selectorText);
    if(rules.item(i).selectorText=="."+classname)rules.item(i).style[prop]=val;
  }
}

function setFonts(ausw) {
	var formField = document.getElementById('formField').value;
	var layoutField = document.getElementById('layoutField').value;

	if (document.getElementById('layoutWhat').value=='FS'){
		if (layoutField=='Z.OPF'){
			document.getElementsByName('option')[0].style.fontSize=ausw;
			document.getElementsByName('option')[1].style.fontSize=ausw;
			document.getElementsByName('option')[2].style.fontSize=ausw;
			document.getElementsByName('option')[3].style.fontSize=ausw;
		}else{
			document.getElementById(layoutField).style.fontSize=ausw;
		}
	}

	if (document.getElementById('layoutWhat').value=='FW'){
		if (layoutField=='Z.OPF'){
			document.getElementsByName('option')[0].style.fontWeight=ausw;
			document.getElementsByName('option')[1].style.fontWeight=ausw;
			document.getElementsByName('option')[2].style.fontWeight=ausw;
			document.getElementsByName('option')[3].style.fontWeight=ausw;
		}else{
			document.getElementById(layoutField).style.fontWeight=ausw;
		}
	}

	if (document.getElementById('layoutWhat').value=='ST'){
		if (layoutField=='Z.OPF'){
			document.getElementsByName('option')[0].style.fontStyle=ausw;
			document.getElementsByName('option')[1].style.fontStyle=ausw;
			document.getElementsByName('option')[2].style.fontStyle=ausw;
			document.getElementsByName('option')[3].style.fontStyle=ausw;
		}else{
			document.getElementById(layoutField).style.fontStyle=ausw;
		}
	}
} 

function setTables(ausw) {
	var formField = document.getElementById('formField').value;
	var layoutField = document.getElementById('layoutField').value;
	if (document.getElementById('layoutWhat').value=='BORDER')
		document.getElementById(layoutField).border=ausw;
	if (document.getElementById('layoutWhat').value=='CELLPADDING')
		document.getElementById(layoutField).margin=ausw;

		//KLAPPTNICHT$out.= "	if (document.getElementById('layoutWhat').value=='WIDTH')
		//$out.= "		document.getElementById(layoutField).width=ausw;


} 










// js form validation stuff
var errorMsg0   = 'Das Formular ist leer !';
var errorMsg1   = 'Das ist keine Zahl!';
var errorMsg2   = ' ist keine gültige Zeilennummer!';
var noDropDbMsg = 'Die Anweisung "DROP DATABASE" wurde deaktiviert.';
var confirmMsg  = 'Möchten Sie wirklich diese Action ausführen ';
var confirmDelMsg  = 'Löschung bestätigen ';
var confirmMsgDropDB  = 'Sie sind dabei eine komplette Datenbank zu ZERSTÖREN!';

/**
 * Displays an confirmation box before to submit a "DROP/DELETE/ALTER" query.
 * This function is called while clicking links
 *
 * @param   object   the link
 * @param   object   the sql query to submit
 *
 * @return  boolean  whether to run the query or not
 */

function alertLink(theMessage)
{
    // Confirmation is not required in the configuration file
    // or browser is Opera (crappy js implementation)
    if (confirmMsg == '' || typeof(window.opera) != 'undefined') {
        return true;
    }

    var is_confirmed = alert(theMessage);
    if (is_confirmed) {
        theLink.href += '&is_js_confirmed=1';
    }

    return is_confirmed;
} // end of the 'confirmLink()' function

function confirmLink(theLink, theAction)
{
    // Confirmation is not required in the configuration file
    // or browser is Opera (crappy js implementation)
    if (confirmMsg == '' || typeof(window.opera) != 'undefined') {
        return true;
    }

    var is_confirmed = confirm(confirmMsg + ' :\n' + theAction);
    if (is_confirmed) {
        theLink.href += '&is_js_confirmed=1';
    }

    return is_confirmed;
} // end of the 'confirmLink()' function

function confirmDelLink(theLink, theAction)
{
    // Confirmation is not required in the configuration file
    // or browser is Opera (crappy js implementation)
    if (confirmDelMsg == '' || typeof(window.opera) != 'undefined') {
        return true;
    }

    var is_confirmed = confirm(confirmDelMsg + ' :\n' + theAction);
    if (is_confirmed) {
        theLink.href += '&is_js_confirmed=1';
    }

    return is_confirmed;
} // end of the 'confirmLink()' function

/**
 * The global array below will be used inside the "setPointer()" function
 */
var markedRow = new Array();


/**
 * Sets/unsets the pointer in browse mode
 *
 * @param   object   the table row
 * @param   object   the color to use for this row
 * @param   object   the background color
 *
 * @return  boolean  whether pointer is set or not
 */

function setPointer(theRow, thePointerColor, theNormalBgColor)
{
    var theCells = null;

    if (thePointerColor == '' || typeof(theRow.style) == 'undefined') {
        return false;
    }
    if (typeof(document.getElementsByTagName) != 'undefined') {
        theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        theCells = theRow.cells;
    }
    else {
        return false;
    }

    var rowCellsCnt  = theCells.length;
    var currentColor = null;
    var newColor     = null;
    // Opera does not return valid values with "getAttribute"
    if (typeof(window.opera) == 'undefined' && typeof(theCells[0].getAttribute) != 'undefined' && typeof(theCells[0].getAttribute) != 'undefined') {
        currentColor = theCells[0].getAttribute('bgcolor');
		if (currentColor == null) currentColor = theCells[0].style.backgroundColor; // mein Fix für Netscpae (C.B.)
        newColor     = (currentColor.toLowerCase() == thePointerColor.toLowerCase())
                     ? theNormalBgColor
                     : thePointerColor;
        for (var c = 0; c < rowCellsCnt; c++) {
            theCells[c].setAttribute('bgcolor', newColor, 0);
        } // end for
    }
    else {
        currentColor = theCells[0].style.backgroundColor;
        newColor     = (currentColor.toLowerCase() == thePointerColor.toLowerCase())
                     ? theNormalBgColor
                     : thePointerColor;
        for (var c = 0; c < rowCellsCnt; c++) {
            theCells[c].style.backgroundColor = newColor;
        }
    }

    return true;
} // end of the 'setPointer()' function
