function stat_screen(adr) {
 var breite = screen.width;
 var hoehe = screen.height;
 /*
 var stat = new Image(); 
 var stat_src = adr;
 stat_src += "&breite="+breite+"&hoehe="+hoehe+"";
 stat.src = stat_src; */
 
 window.frames["scrstat"].location.href = ""+adr+"&breite="+breite+"&hoehe="+hoehe+"";
}

function getAnzeigeBereich(adr)
{
  var breite = 0;
  var hoehe = 0;
  // alle ausser Explorer
  if (self.innerHeight)
  {
	breite = self.innerWidth;
	hoehe = self.innerHeight;
  }
  // Explorer 6 Strict Mode
  else if (document.documentElement && document.documentElement.clientHeight)
  {
	breite = document.documentElement.clientWidth;
  	hoehe = document.documentElement.clientHeight;
  }
  // andere Explorers
  else if (document.body)
  {
    breite = document.body.clientWidth;
    hoehe = document.body.clientHeight;
  }
  window.frames["scrstat"].location.href = ""+adr+"&breite="+breite+"&hoehe="+hoehe+"";
}

function wechsle(a,b)
{
 parent['navigation'].document.location.href = a;
 parent['data'].document.location.href = b;
}

function aendereFrame(adr, framename) {
  parent[framename].location.href = adr;
}

function navtree(id)
{
	var img = id + '_img';
	if(document.getElementById(id).style.display == 'none') {
		document.getElementById(id).style.display = 'block';
		document.getElementById(img).src = './grafik/minus12x12.gif';
	} else {
		document.getElementById(id).style.display = 'none';
		document.getElementById(img).src = './grafik/plus12x12.gif';
	}
}

function Fenster(link)
{
	var f = window.location.href = link;
}

function neuesFenster(link,fenstername,breite,hoehe,menubar,toolbar)
{
	var f = window.open(link,fenstername,'width='+breite+',height='+hoehe+',resizable=yes,scrollbars=yes,menubar='+menubar+',toolbar='+toolbar);
	f.focus();
}

function setOpacity() {
	setOpacity = arguments[0].filters ?
		function(elem,level){elem.style.filter = "alpha(opacity="+level+")"} :
		function(elem,level){elem.style.opacity = level / 100}
	setOpacity(arguments[0],arguments[1]);
}

function abgedunkelteEbene(link,titel) {
    var x = 0;
    var y = 0;
    var scroll_x = 0;
    var scroll_y = 0;
    var ebene = document.getElementById("opacity_ebene");
    var inhalt = document.getElementById("inhalt_ebene");
    var hauptinhalt = document.getElementById("hauptinhalt2");
    
    window.frames["ebene_fenster"].location.href = "./dynscripts.php?"+link+"&ebene=ok";
    document.getElementById("schliessleiste_titel").innerHTML = '<span style="line-height:33px; font-size:13px;"><strong>'+titel+'</strong></span>';

    // Breite und Hoehe des Fensters
    // alle ausser Explorer
    if (window.innerWidth) {
        x = window.innerWidth;
        y = window.innerHeight;
    }
    // Explorer 6 Strict
    else if ( document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
        x = document.documentElement.clientWidth;
        y = document.documentElement.clientHeight;
    }
    // andere Explorers
    else if (document.body && (document.body.clientWidth || document.body.clientHeight )) {
        x = document.body.clientWidth;
        y = document.body.clientHeight;
    }

    // Wieviel wurde gescrollt
    // alle ausser Explorer
    if (window.pageYOffset) {
        scroll_x = window.pageXOffset;
        scroll_y = window.pageYOffset;
    }
    // Explorer 6 Strict
    else if (document.documentElement && document.documentElement.scrollTop) {
        scroll_x = document.documentElement.scrollLeft;
        scroll_y = document.documentElement.scrollTop;
    }
    // andere Explorers
    else if (document.body) {
        scroll_x = document.body.scrollLeft;
        scroll_y = document.body.scrollTop;
    }
    
    var hauptinhalt_breite = parseInt(document.getElementById("hauptinhalt2").offsetWidth);
    var div_breite = hauptinhalt_breite+50;
    var div_hoehe = y-200;

    // Positionswerte bestimmen
    var pos_x = (x - div_breite) / 2 + scroll_x;
    var pos_y = (y - div_hoehe) / 2 + scroll_y;

    pos_x = (pos_x < 0 ) ? 0 : pos_x;
    pos_y = (pos_y < 0 ) ? 0 : pos_y;

    // Seite abdunkeln
    if (ebene != null) {
    	//setOpacity(ebene,50);
        ebene.style.visibility = "visible";
        //ebene.style.height = "2500px";
        //ebene.style.height = y;
    }
    // Fenster anzeigen
    
    inhalt.style.position = "absolute";
    inhalt.style.overflow = "hidden";
    inhalt.style.width = div_breite;
    inhalt.style.height = div_hoehe;
    inhalt.style.display = "block";
    inhalt.style.zIndex = 101;
    inhalt.style.left = pos_x + "px";
    inhalt.style.top = pos_y + "px";
}

function schliessen()
{
	document.getElementById('opacity_ebene').style.visibility = 'hidden';
	document.getElementById("inhalt_ebene").style.display = 'none';
	window.frames["ebene_fenster"].location.href = "./warten.html"; // Eine leere Seite als Inhalt
}

function schliessen_neuladen()
{
	document.forms["artbestell"].submit();
	//parent.document.getElementById('opacity_ebene').style.visibility = 'hidden';
	//parent.document.getElementById("inhalt_ebene").style.display = 'none';
	//parent.window.frames["ebene_fenster"].location.href = "./warten.html";
	//parent.document.location.reload();
}

//jQuery
/*
$(document).ready(
    function()
    {
    	$("#rgb_anzeige").children().click(
    		function() {
    			var link = $(this).attr("href");
    			var url = link.split("?");
    			$("#hauptinhalt").load("./dynscripts.php?act=propart&"+url[1]);
    		}
    	);
    }
);
*/
