function OC(id)
{
  OCAll(id);

  if (!window.document.getElementById("div" + id).style.visibility || window.document.getElementById("div" + id).style.visibility == "hidden") {
		window.document.getElementById("div" + id).style.display = "block";
		window.document.getElementById("div" + id).style.visibility = "visible";
		window.document.getElementById("div" + id).style.position = "static";
		window.document.getElementById("a" + id).className = "tab_a_selected";
	}
}

function OCAll(id)
{
  for (i = 1; i <= NOE; i++) {
    if (id != i && window.document.getElementById("div" + i).style.visibility && window.document.getElementById("div" + i).style.visibility == "visible") {
		  window.document.getElementById("div" + i).style.display = "none";
		  window.document.getElementById("div" + i).style.visibility = "hidden";
		  window.document.getElementById("div" + i).style.position = "absolute";
		  window.document.getElementById("a" + i).className = "tab_a";
	  }
  }
}

// Setzt den Cursor-Focus auf das übergebene Element.
// @param elementID ID des Elements.
function FokusSetzen(elementID)
{
  if (elementID) {
    if (window && window.focus) {
	    if (window.document.getElementById && window.document.getElementById(elementID)) {
	      window.focus();
		    window.document.getElementById(elementID).focus();
		    
		    if (window.document.getElementById(elementID).select) {
          window.document.getElementById(elementID).select();
        }
	    }
    }
  }
}

function UnCryptMailto( s )
{
  var n = 0;
  var r = "";
  
  for(var i = 0; i < s.length; i++){
    n = s.charCodeAt(i);
    
    if(n >= 8364) {
      n = 128;
    }
    
    r += String.fromCharCode(n - 1);
  }
  return r;
}

function UCMailto(s)
{
  window.location.href = UnCryptMailto(s);
}

function BGOeffnen(url)
{
  var height = "550";
  var width = "700";
  
  var top = screen.height / 2 - height / 2;
  var left = screen.width / 2 - width / 2;
  
  window.fcm_bg = window.open(url, "fcm_bg", "resizable=1,toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,height=" + height + ",width=" + width + ",top=" + top + ",left=" + left);
  window.fcm_bg.focus();
}

function BGSchliessen()
{
  if (window.fcm_bg && !window.fcm_bg.closed) {
    window.fcm_bg.close();
  }
}

function DLOeffnen(url)
{
  var height = "500";
  var width = "600";
  
  var top = screen.height / 2 - height / 2;
  var left = screen.width / 2 - width / 2;
  
  window.fcm_dl = window.open(url, "fcm_dl", "resizable=1,toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,height=" + height + ",width=" + width + ",top=" + top + ",left=" + left);
  window.fcm_dl.focus();
}

function DLSchliessen()
{
  if (window.fcm_dl && !window.fcm_dl.closed) {
    window.fcm_dl.close();
  }
}
