<!--

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


function Menu(opt, vari, page, qs){
	val = opt.options[opt.selectedIndex].value;
	if (qs == '')
		document.location = page + "?" + vari + "=" + val;
	else
		document.location = page + "?" + vari + "=" + val + qs;
}

function showhide(elem) {
	if (document.getElementById(elem).style.display == 'none')
	{
		document.getElementById(elem).style.display = 'block';
		/*
    for (i=0;i<1000;i=i+.05)
		{
      window.scrollTo(0,i);
    }*/
	}
	else
	{
		document.getElementById(elem).style.display = 'none';
	}
}

function changeColor(elem,color)
{
  for (i=0;i<elem.cells.length;i++)
    elem.cells[i].style.backgroundColor=color;
}




function add2Form(pid,level,name)
{
  
  
  parent.frames['basefrm'].document.categories.category_id.value = pid;
  parent.frames['basefrm'].document.categories.level.value = level;
  parent.frames['basefrm'].document.categories.elementname.value = name;
  
  //alert (parent.frames['basefrm'].document.categories.swapelements.checked);
  
}

function addCategory(cat_type)
{
  var d = document.objekt;
  if ("main" == cat_type) {
	  var objF = d.maincats;
	  var objForm = d.c_maincategories;
  }
  else {
	  var objF = d.subcats;
	  var objForm = d.c_categories;
  }
  
  pid = objF.options[objF.selectedIndex].value;
  name = objF.options[objF.selectedIndex].text;
  
  var alreadyin = false;
  if (objForm.length>0)
  {
    for(i=0;i<objForm.length;i++)
    {
      if (objForm.options[i].value==pid)
      {
        alreadyin=true;
        break;
      }
    }
  }
  if (!alreadyin)
  {
    name = name.replace(/-/g,'');
    newEntry = new Option(name,pid, false, false);
    objForm.options[objForm.length] = newEntry;
  }
  updateHiddenField(objForm)
}

function RemoveItem(elem)
{
  objForm = document.getElementById(elem);
  deleteValue = objForm.selectedIndex;
  objForm.remove(deleteValue);
  updateHiddenField(objForm)
  // HIER NOCH ABFANGEN
}



function updateHiddenField(objForm)
{
  var l = objForm.length;
  var n = objForm.name;
  var d = document.objekt;
  var hfname = n.substr(2);
  //alert(hfname);
  var data = "";
  for (i=0;i<l;i++)
  {
    data += objForm.options[i].value + ",";
  }
  
  data = data.substr(0,data.length-1);
  //objHForm = document.getElementById(hfname);
  
  var objHForm = d.elements[hfname];
  objHForm.value = data;
  //alert(objHForm.value);
}

function changeColor(elem,color)
{
  
  //alert(elem.cells.length) 
  //elem.style.backgroundColor=color;
  for (i=0;i<elem.cells.length;i++)
    elem.cells[i].style.backgroundColor=color;
}

function confirmDelete(url)
{
  check = confirm("Daten wirklich löschen ?");
  if (check)
    self.location.href=url;

}

function putISSN(frm)
{
  var felem = document.objekt.issn_number;
  var issn = (frm.options[frm.selectedIndex].value);
  for (i=0;i<felem.length;i++)
  {
    if (felem.options[i].value==issn)
      felem.options[i].selected=true;
  }
  
}



function showCatSubNav()
{
  document.getElementById('catsubnav').style.display = 'block';
}
function closeCatSubNav()
{
  document.getElementById('catsubnav').style.display = 'none';
}


//-->
