function viewer(countTotal, hitsHeute, hitsGestern){
	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;
	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;
	}	
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}
	if(xScroll < windowWidth){	
		pageWidth = xScroll;		
	} else {
		pageWidth = windowWidth;
	}

	var gray = document.createElement("div");
	gray.id = "gray";
	gray.setAttribute("onclick","closeViewer();");
	gray.style.height = pageHeight+"px";
	gray.style.width = windowWidth+"px";

	var inhalt = document.createElement("div");
	inhalt.id = "viewer";
	inhalt.style.width = "300px";
	inhalt.style.height = "180px";
	inhalt.style.left = (windowWidth/2)-150+"px";
	inhalt.style.top = (pageHeight-((windowHeight/2)+90))+"px";
	
	var	text = document.createElement("h1");
	var mytext = document.createTextNode("Besucherzahlen");
	text.appendChild(mytext);
	inhalt.appendChild(text);
	
	text = document.createElement("p");
	mytext = document.createTextNode("Besucher seit dem 01.07.08: "+countTotal);
	text.appendChild(mytext);
	inhalt.appendChild(text);
	
	text = document.createElement("p");
	mytext = document.createTextNode("Besucherstand am 30.06.08: 11716");
	text.appendChild(mytext);
	inhalt.appendChild(text);
	
	text = document.createElement("p");
	mytext = document.createTextNode("Besucher heute: "+hitsHeute);
	text.appendChild(mytext);
	inhalt.appendChild(text);
	
	text = document.createElement("p");
	mytext = document.createTextNode("Besucher Gestern: "+hitsGestern);
	text.appendChild(mytext);
	inhalt.appendChild(text);
	
	text = document.createElement("a");
	text.href="javascript:closeViewer();";
	mytext = document.createTextNode("X");
	text.appendChild(mytext);
	inhalt.appendChild(text);
	document.getElementsByTagName("body")[0].appendChild(gray);
	document.getElementsByTagName("body")[0].appendChild(inhalt);
}

function closeViewer() {
	document.getElementsByTagName("body")[0].removeChild(document.getElementById("gray"));
	document.getElementsByTagName("body")[0].removeChild(document.getElementById("viewer"));
}
