// DummyGif für erzwungene Tabellenlänge einfügen.
function insertTableHeight(){
var d=document;
var a=476; 	// Kleinstmögliche Höhenausdehnung des Fensters, bei der es noch gut aussieht.
var proz=65;	// Prozentangabe der Höhe
var fensterhoehe=innerHeight;
var bildhoehe=d.images["dummy"].height;
//alert(innerHeight+'/'+outerHeight+'/'+pageYOffset);
	if(fensterhoehe && bildhoehe && fensterhoehe>=a){
	var x=(proz*fensterhoehe)/100;
	d.images["dummy"].height=x;
	}
	else if(fensterhoehe && bildhoehe && fensterhoehe<=a){
	return 0;
	}
	else alert("..is there any case left?");

}
// Ebenenansicht toggeln
function switchLayer(id){
var d=document.getElementById(id);
	if(d && d.style.visibility=='hidden'){
		d.style.visibility='visible';
	}
	else
		d.style.visibility='hidden';
}

// Fenster aufgehen lassen
function winopen(URL,popUpSizeX,popUpSizeY) {
        var popUpLocationX=((screen.availWidth / 2) - (popUpSizeX / 2));
        var popUpLocationY=((screen.availHeight / 2) - (popUpSizeY / 2));
        var popUpURL=URL;
        neues_Fenster=window.open(popUpURL,"x",height=10,width=10,locationbar=0,status=0,menubar=0,scrollbars=0,resizable=1);
        neues_Fenster.resizeTo(popUpSizeX,popUpSizeY);
        neues_Fenster.moveTo(popUpLocationX,popUpLocationY);
        neues_Fenster.focus();
}
// Bilder vorladen - von http://www.js4all.de/java/vorladen2.htm
function preload_start() {}
// Liste der Bilder
var preload_images =
[
  "pictures/regen-vorsch.jpg",
  "pictures/himmel-vorsch.jpg",
  "pictures/bogen-vorsch.jpg"
]
// intern benoetigte Parameter
var load_next = 5 // Zeit in ms zwischen zwei Ladevorgaengen
var pos_array = 0

// Ladefunktion
function preload()
{
  // Naechstes Bild laden
  var new_image = new Image()
  new_image.src = preload_images[pos_array]
  // Noch Bilder zu laden?
  pos_array++
  if(pos_array < preload_images.length)
    setTimeout('preload()', load_next)
}
// Start der Vorladefunktion
function preload_start()
{
  // Bilder vorhanden?
  if(preload_images.length == 0)
    return
  // Pruefroutine starten
  setTimeout('preload()', load_next)
}

//Sidebar für N6
function addToBar() {
if(window.sidebar&&window.sidebar.addPanel)
window.sidebar.addPanel("N. Beuermann - Links","http://www.nico-beuermann.de/sidebar.html","");
else
alert('This works for Netscape 6 only.');
}

// Positionierung
function dynpos(id, pos) {
switch(pos){
case "mitte":
        var d=document.getElementById(id).style;
                if((document.getElementById)&& (!document.all)&& (document.documentElement)) {
                        d.position = "absolute";
                        d.top = (window.innerHeight / 2) - (parseInt(getCS(id, 'width')) / 2 ) +"px";
                        d.width = getCS(id, 'width')+"px";
                        d.left = (window.innerWidth / 2) - (parseInt(getCS(id, 'width')) / 2 ) +"px";
                        d.height = getCS(id, 'height')+"px";
                        }
                        else if(navigator.appName.indexOf("Explorer") != -1) {
                                document.all[id].style.position = "absolute";
                                document.all[id].style.top = (document.all.tabelle.offsetHeight / 2 ) - (document.all.ChangeArea.offsetHeight / 2 ) - document.all.tabelle.offsetTop +"px";
                                document.all[id].style.left = (document.all.tabelle.offsetWidth / 2) - (document.all.ChangeArea.offsetWidth / 2 ) + document.all.tabelle.offsetLeft +"px";
                                document.all[id].style.height = "50px";
                                document.all[id].style.width = "50px";
                        }
                        else        {
                                d.visibility = "hidden";
                        }
        break;
case "rechts_oben":
        var d=document.getElementById(id).style;
                if(navigator.appCodeName.indexOf("Mozilla") != -1) {
                        d.position = "fixed";
                        d.top = window.innerHeight * 0.55 +"px";
                        d.left = window.innerWidth * 0.8 +"px";
                        d.height = "142px";
                        d.width = "100px";
                        }
                        else if(navigator.appName.indexOf("Explorer") != -1){
								d.position = "fixed";
                        d.top = window.innerHeight * 0.55 +"px";
                        d.left = window.innerWidth * 0.8 +"px";
                        d.height = "142px";
                        d.width = "100px";
                        }
                        else{
                        d.visibility = "hidden";
                        }
        break;
case "rechts_mitte":
        var d=document.getElementById(id).style;
                if( (document.getElementById) && (!document.all) && (document.documentElement) && (navigator.appName.indexOf("Netscape"))!= -1) {
                        d.position = "absolute";
                        d.top = window.outerHeight * 0.13 +"px";
                        d.left = window.outerWidth * 0.5+"px";
                        d.height = getCS(id, 'height')+"px";
                        d.width = getCS(id, 'width')+"px";
                        }
                        else if( navigator.appName.indexOf("Explärer") && document.all && window.offscreenBuffering != -1 ) {
                        document.all[id].style.position = "absolute";
                        document.all[id].style.top = (document.all.tabelle.offsetHeight * 0.2) +"px";
                        document.all[id].style.left = (document.all.tabelle.offsetWidth * 0.5) + document.all.tabelle.offsetLeft +"px";
                        document.all[id].style.height = document.all[id].offsetHeight +"px";
                        document.all[id].style.width = document.all[id].offsetWidth +"px";
                        }
                        else        {
                        return false;

                                }
        break;}

}

// holt berechnete CSS Eigenschaften
function getCS(objid,prop)
{
  var obj, propval;
  if (document.documentElement && document.defaultView)
  {
    obj=document.getElementById(objid);
    propval=document.defaultView.getComputedStyle(obj,"").getPropertyValue(prop);
    //alert(prop+": "+propval);
         return propval;
  }
  else
  {
    return 0;
  }
}
// Schreibt dynamisch Inhalt in ein DOM Objekt.
function schreibe(x, id){
komm = new Array(3)
			komm[1] = "Unser Debüt - im Rahmen einer Ausstellung im Garten der HdK Berlin.";
			komm[2] = "Eine Symbiose von Akustik und Architektur.";
			komm[3] = "Eine beeindruckende Konstruktion aus Lautsprechern, Drahtseilen und Baumstämmen.";

if((x == 1) && (document.getElementById(id).innerHTML)){
	document.getElementById(id).innerHTML = komm[1];
	;
	}
	else if((x == 2) && (document.getElementById(id).innerHTML)){
		document.getElementById(id).innerHTML = komm[2];
	}
	else if((x == 3) && (document.getElementById(id).innerHTML)){
		document.getElementById(id).innerHTML = komm[3];
	}
}

