function ShowMenu(which, nr)
{
	which.style.backgroundColor='#7f7f7f';
	var img = document.getElementById('menu' + nr);
	img.src="images/hm_schatten.gif"
}

function HideMenu(which, nr)
{
	which.style.backgroundColor='#BfBfBf';
	var img = document.getElementById('menu' + nr);
	img.src="images/leer.gif";
}

function GoTo(nr)
{
	document.location.href = urls[nr-1];	
}

var urls = new Array();
urls[0] = "kanzlei.htm";
urls[1] = "leistungen.htm";
urls[2] = "personen.htm";
urls[3] = "aktuelles.htm";
urls[4] = "anfahrt.htm";
urls[5] = "impressum.htm";
urls[9] = "index.htm";


function ShowPopup(abdeckerid, divid, tableid)
{       
    toggleDiv(abdeckerid, 1);
    toggleDiv(divid, 1);
    toggleDiv(tableid, 1);
}

function HidePopup(abdeckerid, divid, tableid)
{
    toggleDiv(abdeckerid, 0);
    toggleDiv(divid, 0);
    toggleDiv(tableid, 0);
}

function ShowText(toshow, tohide) 
{
    toggleDiv(toshow, 1);
    toggleDiv(tohide, 0);
}

function toggleDiv(id, flagit) 
{
    var pos = getScrollXY();

    if (flagit=="1")
    {
        if (document.layers)
        {
            document.layers[''+id+''].visibility = "show";
        }
        else if (document.all) 
        {
            document.all[''+id+''].style.visibility = "visible";
            document.all[''+id+''].style.display = "block";
            document.all[''+id+''].style.top = pos[1];
        }
        else if (document.getElementById) 
        {
            document.getElementById(''+id+'').style.visibility = "visible";
            document.getElementById(''+id+'').style.display = "block";
            document.getElementById(''+id+'').style.top = pos[1];
        }
    }
    else if (flagit=="0")
    {
        if (document.layers)
        {
            document.layers[''+id+''].visibility = "hide";
        }
        else if (document.all) 
        {
            document.all[''+id+''].style.visibility = "hidden";
            document.all[''+id+''].style.display = "none";
        }
        else if (document.getElementById)
        {
            document.getElementById(''+id+'').style.visibility = "hidden";
            document.getElementById(''+id+'').style.display = "none";
        }
    }
}

function getScrollXY() {
    var x = 0, y = 0;
    if( typeof( window.pageYOffset ) == 'number' ) {
        // Netscape
        x = window.pageXOffset;
        y = window.pageYOffset;
    } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
        // DOM
        x = document.body.scrollLeft;
        y = document.body.scrollTop;
    } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
        // IE6 standards compliant mode
        x = document.documentElement.scrollLeft;
        y = document.documentElement.scrollTop;
    }
    return [x, y];
}
            
function setScrollXY(x, y) {
    window.scrollTo(x, y);
}

function justify(abdeckerid, divid, tableid)
{
    var pos = getScrollXY();
    
    justifyX(abdeckerid, pos[1]);
    justifyX(divid, pos[1]);
    justifyX(tableid, pos[1]);
}

function justifyconf(logoid)
{
    var pos = getScrollXY();
    
    if (document.all) 
        document.all[''+logoid+''].style.bottom = 30 - pos[1];
    else if (document.getElementById) 
        document.getElementById(''+logoid+'').style.bottom = 30 - pos[1];
}

function justifyX(id, pos)
{
    if (document.layers)
    {
        document.layers[''+id+''].visibility = "show";
    }
    else if (document.all) 
    {
        if (document.all[''+id+''].style.visibility == "hidden") return;
        document.all[''+id+''].style.top = pos;
    }
    else if (document.getElementById) 
    {
        if (document.getElementById(''+id+'').style.visibility == "hidden") return;
        document.getElementById(''+id+'').style.top = pos;
    }
}

var Bildsourcen = new Array();
Bildsourcen[0] = "images/1.jpg";
Bildsourcen[1] = "images/2.jpg";
Bildsourcen[2] = "images/3.jpg";
Bildsourcen[3] = "images/4.jpg";
Bildsourcen[4] = "images/5.jpg";
Bildsourcen[5] = "images/6.jpg";
var Bild = 0;

function Bildwechsel()
{
  	document.all.DynBild.filters.blendTrans.Apply();
  	document.all.DynBild.src = Bildsourcen[Bild];
  	document.all.DynBild.filters.blendTrans.Play();
  	
  	Bild++;
  	if (Bild == 6) Bild = 0;
    window.setTimeout(Bildwechsel, 8000);
}
