var c_el = new Array();
function change(id, force)
{
  c_el[id] = document.getElementById(id);
  if (c_el[id] != null && c_el[id] != '')
  {
    if(force == "block" || force == "none")
    {
      c_el[id].style.display = force;
    }
    else
    {
      if(c_el[id].style.display == "none" || c_el[id].style.display == "") //|| c_el[id].style.display == ""
        c_el[id].style.display = "block"; //block nicht, damit es in tabellen geht!
      else
        c_el[id].style.display = "none";
    }
  }
}

function show(id)
{
  c_el[id] = document.getElementById(id);
  if (c_el[id] != null && c_el[id] != '')
  {
    c_el[id].style.display = "block"; //block nicht, damit es in tabellen geht!
  }
}
function hide(id)
{
  c_el[id] = document.getElementById(id);
  if (c_el[id] != null && c_el[id] != '')
  {
    c_el[id].style.display = "none";
  }
}


function toggler2(showid, elementstr)
{
  for (i = 0; i < 200; i++)
  { 
    c = document.getElementById(elementstr+i);
    if (c != null && c != '')
    {
       if(elementstr+i == elementstr+showid) 
        c.style.display = "block"; 
      else
        c.style.display = "none";
    }
  }
}

function toggler(showid, elementstr)
{
  for (i = 0; i < 200; i++)
  {
    if(getE(elementstr+i))
    {
      if(elementstr+i == elementstr+showid)
      {
        if(getE(elementstr+i).style.display == "block")
          getE(elementstr+i).style.display = "none";
        else
          getE(elementstr+i).style.display = "block";
      }
      else
        getE(elementstr+i).style.display = "none";
    }
  }
}

function colorer(showid, elementstr, colorold, colornew)
{
  for (i = 0; i < 200; i++)
  { 
    c = document.getElementById(elementstr+i);
    if (c != null && c != '')
    {
      if(elementstr+i == elementstr+showid) { 
        if(c.style.fontWeight != 'bold'){
          c.style.background = colornew; 
          c.style.fontWeight = 'bold';
        } else {
		  c.style.background = colorold;
          c.style.fontWeight = 'normal';        
        } 
      }
      else {
        c.style.background = colorold;
        c.style.fontWeight = 'normal'; 
      }
    }
  }
}

//dependent, immer im selben popup öffnen!
function popup(loc, width, height, scroll)
{
  if(width != null && height != null && scroll != null)
  {  
    p = window.open(loc,'popup','toolbar=no,width='+width+',height='+height+',screenX=25,screenY=25,left=25,top=25,scrollbars='+scroll+',resizable=yes,status=no,menubar=no,directories=no,location=no,dependent=yes');
    p.focus();
  }
}


function htmlPopup(imageloc, width, height, scroll)
{
  if(width != null && height != null && scroll != null)
  {  
  HTML = "<!DOCTYPE html PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>\n<html><head><meta http-equiv='content-type' content='text/html; charset=ISO-8859-1'><style>body, html{margin:0;padding:0;background-color:#FFFFFF;}</style></head><body><img src='"+ imageloc +"'/><br/></body></html>";
  popupImage = window.open("",'htmlpopup','width='+width+',height='+height+',screenX=25,screenY=25,left=25,top=25,toolbar=no,scrollbars='+scroll+',resizable=yes,status=no,menubar=no,directories=no,location=no,dependent=yes');
  popupImage.document.open();
  popupImage.document.write(HTML);
  popupImage.document.close();
  }
}


var arrParams = new Array();
var locationstring = document.location.toString();
if (locationstring) 
{
  var pos = locationstring.indexOf('?params=');
  if (pos > 0) 
  {
    paramlist = locationstring.substring(pos+8);
    arrParams = paramlist.split(",");
  } 
}

//TOOL: leading zeros
function LZ(x) {return(x<0||x>9?"":"0")+x} 

//TOOL: getElementById
function getE(myel_id){if(document.getElementById(myel_id) != null && document.getElementById(myel_id) != '' && document.getElementById(myel_id) != 'undefined') return document.getElementById(myel_id);}



