

function bildgross(name,text) {
		namen="images/"+name;
			var arrayPageSize = getPageSize();
			document.getElementById("dunkel").style.width=arrayPageSize[0]+"px";	
			document.getElementById("dunkel").style.height=arrayPageSize[1]+"px";
			Fadeout("dunkel", 400);
			Fadein("bild1", 400);
	
		document.getElementById("bild1").innerHTML="<div align='right' style='cursor:pointer' onclick='document.getElementById(\"bild1\").style.display=\"none\";document.getElementById(\"dunkel\").style.display=\"none\";'>schliessen |x|</div><div><b>"+text+"&nbsp;&nbsp;</b></div><img src='"+namen+"' border='0'>";

}

function Fadeout(id, geschwindigkeit) {
        var fps = Math.round(geschwindigkeit / 100); 
        var tmp = 0;
    for(i = 1; i <= 50; i++) {
        setTimeout("Fadeout_fade('" + id + "'," + i + ")", (tmp * fps));
        tmp++;
    }
}
function Fadeout_fade(id, pas) {
        var heurix = document.getElementById(id).style;
        if(pas < 50) {
               heurix.opacity = (0.01 * pas);
               heurix.MozOpacity = (0.01 * pas);

if(pas == 1){document.getElementById(id).style.display="block";}

               heurix.KhtmlOpacity = (0.01 * pas);
               heurix.filter = "alpha(opacity=" + (1 * pas) + ")"; 
        } else {
               heurix.display = "block";
        }
}



function Fadein(id, geschwindigkeit) {


               document.getElementById(id).style.opacity = 0.1;
               document.getElementById(id).style.MozOpacity = 0.1;
               document.getElementById(id).style.KhtmlOpacity = 0.1;
               document.getElementById(id).style.filter = "alpha(opacity=1)";

	document.getElementById(id).style.display="block";

        var fps = Math.round(geschwindigkeit / 100); 
        var tmp = 0;
    for(i = 0; i <= 100; i++) {
        setTimeout("Fadein_fade('" + id + "'," + i + ")", (tmp * fps));
        tmp++;
    }
}
function Fadein_fade(id, pas) {
        var heurix = document.getElementById(id).style;
        if(pas < 100) {



               heurix.opacity = (0.01 * pas);
               heurix.MozOpacity = (0.01 * pas);
               heurix.KhtmlOpacity = (0.01 * pas);
               heurix.filter = "alpha(opacity=" + (1 * pas) + ")"; 
        } else {
               heurix.display = "block";
        }
}

function getPageSize(){
	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = window.innerWidth + window.scrollMaxX;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	

	var windowWidth, windowHeight;
	
//	console.log(self.innerWidth);
//	console.log(document.documentElement.clientWidth);

	if (self.innerHeight) {	// all except Explorer
		if(document.documentElement.clientWidth){
			windowWidth = document.documentElement.clientWidth; 
		} else {
			windowWidth = self.innerWidth;
		}
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

	//console.log("xScroll " + xScroll)
	//console.log("windowWidth " + windowWidth)

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = xScroll;		
	} else {
		pageWidth = windowWidth;
	}
//	console.log("pageWidth " + pageWidth)

	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}
