// JavaScript Document
var x, y;
function deselectEntry() {
	elem = document.getElementsByTagName("td");
	for(i=0;i<elem.length;i++) {
		if(elem.item(i).name=="menuEntry") {
		elem.item(i).className="menuEntry";
		}
	}
	elem = document.getElementsByName("menuEntry");
	for(i=0; i<	elem.length; i++) {
		elem.item(i).setAttribute("class","menuEntry");
	}
	 
}

document.onmousedown = Mausklick;
function Mausklick (Ereignis) {
	if(!Ereignis) {
		Ereignis=window.event;
	}
	x=Ereignis.clientX;
	y=Ereignis.clientY;
}




function showImage(image, width, height) {
	var left=0;
	var top=0;
	var dwidth=0;
	var dheight=0;
	var tmp=0;
	dwidth=window.document.body.clientWidth;
	dheight=window.document.body.clientHeight;
	
	if (width>dwidth) {
		tmp=height/width;
   		width=dwidth;
		height=width*tmp;
	}
	if(height>dheight) {
		tmp=width/height;
		height=dheight;
		width=height*tmp;
	}
	imgBox = document.getElementById("imageViewerBox");
	img = document.getElementById("imageViewer");
	img.src="./images/"+image;
	top=Math.round((window.document.body.clientHeight*0.5) - (height/2));
	left=Math.round((window.document.body.clientWidth*0.5) - (width/2));
	
	imgBox.setAttribute("onClick", "this.className='imageViewer_hide'; document.getElementById('imageViewer').src='';");	
	imgBox.setAttribute("class", "imageViewer_show");
	imgBox.style.backgroundColor="#CC9";
	imgBox.style.width=width+"px";
	imgBox.style.height=height+"px";
	
	img.height=height;
	img.width=width;
	img.style.margin="auto";
	imgBox.style.margin="auto";
	imgBox.style.left=left+"px";
	imgBox.style.top=top+"px";
//	imgBox.style.marginLeft=left+"px";



}
