var c_el = new Array();
function change(id)
{
  c_el[id] = document.getElementById(id);
  if (c_el[id] != null && c_el[id] != '')
  {
    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";
  }
}


//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();
  }
}

//Text-Counter JS
function textCounter(field, cntfield, maxlimit) 
{
  if(field != null && cntfield != null)
  {
  if (field.value.length > maxlimit) 
    field.value = field.value.substring(0, maxlimit);
  else 
    cntfield.innerHTML = maxlimit - field.value.length;
  }
}



