function druckvorschau(id, lang)
{
	Fenster = window.open("druckansicht.php?id=" + id + "&lang=" + lang, "Druckversion", "width=420, height=460, resizable=yes, menubar=no, scrollbars=yes");
	Fenster.moveTo(50,50);
	Fenster.focus();
}

function Picture(pic,title,width,height)
{
    popup = window.open(pic, title, 'width='+width+', height='+height+', toolbar=no, directories=no, status=no, scrollbars=no, resizable=yes, menubar=no');
    popup.focus();
}

function checkAll(checkBox)
{
    var v = checkBox.checked;
    var f = checkBox.form;
    for (var i = 0; i < f.elements.length; i++) {
        if (f.elements[i].type == "checkbox") {
            f.elements[i].checked = v;
            }
        }
}

function clearText(thefield){
if (thefield.defaultValue==thefield.value)
thefield.value = ""
} 

function BImage (id, imageURL) {
  if (document.layers)
    document[id].background.src = imageURL == 'none' ? null : imageURL;
  else if (document.all) {
    document.all[id].style.backgroundImage = imageURL == 'none' ? 'none' : 'url(' + imageURL + ')';
    document.all[id].style.visibility = 'visible';
  }
  else if (document.getElementById)
    document.getElementById(id).style.backgroundImage = imageURL == 
'none' ? 'none' : 'url(' + imageURL + ')';
}

window.onload = function () {
if (document.forms[0].id_var.value=="75" || document.forms[0].id_var.value=="63") {document.getElementById('Kanzlei').style.background = "#E7E9C1"}
if (document.forms[0].id_var.value=="61" || document.forms[0].id_var.value=="62") {document.getElementById('Anwaelte').style.background = "#E7E9C1"}
if (document.forms[0].id_var.value=="64" || document.forms[0].id_var.value=="67" || document.forms[0].id_var.value=="68" || document.forms[0].id_var.value=="69" || document.forms[0].id_var.value=="70" || document.forms[0].id_var.value=="71" || document.forms[0].id_var.value=="72" || document.forms[0].id_var.value=="73" || document.forms[0].id_var.value=="84") {document.getElementById('Beratungsfelder').style.background = "#E7E9C1"}
if (document.forms[0].id_var.value=="65" || document.forms[0].id_var.value=="80" || document.forms[0].id_var.value=="81" || document.forms[0].id_var.value=="82" || document.forms[0].id_var.value=="83" || document.forms[0].id_var.value=="85" || document.forms[0].id_var.value=="86" || document.forms[0].id_var.value=="87" || document.forms[0].id_var.value=="89" || document.forms[0].id_var.value=="90") {document.getElementById('Aktuelles').style.background = "#E7E9C1"}
if (document.forms[0].id_var.value=="76" || document.forms[0].id_var.value=="77") {document.getElementById('Kontakt').style.background = "#E7E9C1"}
else {}}

/*	Disclaimer
	Script entwickelt von Xplain (http://www.xplain.de), Joern Hofer
	Freie Weitergabe nur mit diesem Disclaimer */

var ie = document.all;
var altTaste = false;
var linksFertig = false;
var akLinks = new Array();

function tasteGedrueckt() {
	if(linksFertig) {
		aktuelleTaste = parseInt(window.event.keyCode);
		if(aktuelleTaste == 18) {
			altTaste = true;
		} else {
			for(i = 0; i < akLinks.length; i++) {
				if(akLinks[i][0] == aktuelleTaste && altTaste) {
					document.location.href = akLinks[i][1];
					break;
				}
			}
			altTaste = false;
		}
	}
}

function alleAccesskeyLinks() {
	links = document.getElementsByTagName("a");
	zaehler = 0;
	if(links) {
		for(i = 0; i < links.length; i++) {
			accesskey = links[i].getAttribute("accesskey");
			accessLink = links[i].getAttribute("href");
			if(accesskey) {
				akLinks[zaehler] = new Array(2);
				akLinks[zaehler][0] = accesskey*1 + 48;
				akLinks[zaehler][1] = accessLink;
				zaehler++;
			}
		}
		linksFertig = true;
	}
}

window.document.onkeydown = tasteGedrueckt;

var counter = 0;
	tempAccess = window.onload;
	window.onload = function() {
						if(counter == 0) {
							if(typeof tempAccess == "function") tempAccess();
							alleAccesskeyLinks();
							counter++;
						}
					}