<!--
function openWindow(dateiname, name, width, height)
{
   window.open(dateiname, name, "width="+width+", height="+height+", dependent=yes, scrollbars=yes");
}

/*
     checks form if all required fields are filled
     pass name of form as first parameter, afterwards a combination of fieldname and error message
     e.g. onSubmit="return chkform('formName', 'fieldName1', 'errMsg1', 'fieldName2', 'errMsg2')"
     number of fields is unlimited
     a JavaScript-MsgBox tells the user about the error
*/
function chkForm(frm) {
 for (var i = 1; i < chkForm.arguments.length; i++){
   fld = chkForm.arguments[i];
   i++;
   txt = chkForm.arguments[i];
   if((document.forms[frm].elements[fld].value == ""))
   {
     alert(txt);
     document.forms[frm].elements[fld].focus();
     return false;
   }
 }
}


/*
  inserts the ID of in the form "newMaterial" in "auswahlInterneLinks" selected
  entries into "int_links" of the same form, multiple entries will be separated
  by comma
*/
function insertValueIntLinks()
{
    var myLinks = document.newMaterial.int_links;
    var myListBox = document.newMaterial.auswahlInterneLinks;

    if(myListBox.options.length > 0)
    {
        var chaineAj;
        if (myLinks.value == "")
            chaineAj = "";
        else
            chaineAj = ", ";
        var NbSelect = 0;
        for(var i=0; i<myListBox.options.length; i++) {
            if (myListBox.options[i].selected)
            {
                NbSelect++;
                if (NbSelect > 1)
                    chaineAj += ", ";
                chaineAj += myListBox.options[i].value;
            }
        }
        myLinks.value = myLinks.value + chaineAj;
    }
}

function SwitchFileInputBox(f)
{
   if (f.elements["unveraendert"].checked)
      f.elements["datei"].style.visibility = "hidden";
   else
      f.elements["datei"].style.visibility = "visible";
}

function ToggleElement(checkBox, elementId)
{
   if (checkBox.checked)
      document.getElementById(elementId).style.display = "none";
   else
      document.getElementById(elementId).style.display = "block";
}
//-->
