function OpenNewWindow(picture, width, height) {
    xsize = width + 35;
    ysize = height + 50;
    ScreenWidth = screen.width;
    ScreenHeight = screen.height;

    xpos = (ScreenWidth / 2) - (xsize / 2);
    ypos = (ScreenHeight / 2) - (ysize / 2);

    Bildpopup = window.open("","picture","height=" + ysize + ",width=" + xsize + ",scrollbars=no,resizeable=no,toolbar=no,menubar=no,location=no,top=" + ypos + ",left=" + xpos);
    Bildpopup.document.write("<html><head><title>Bildanzeige</title></head>");
    Bildpopup.document.write("<body bgcolor='#dddbcd' onload='focus();'>");
    Bildpopup.document.write("<table align='center' border='0'><tr>");
    Bildpopup.document.write("<td align='center' valign='top'>");
    Bildpopup.document.write("<img src='" + picture + "' border='1'>");
    Bildpopup.document.write("</td></tr><tr>");
    Bildpopup.document.write("<td align='center' valign='bottom'>");
    Bildpopup.document.write("<input type='button' value='Fenster schliessen' style='font-family: verdana; font-size: 10px' onclick='self.close()'>");
    Bildpopup.document.write("</td></tr></table>");
    Bildpopup.document.write("</body></html>");
    Bildpopup.document.close();
}
var offsetfrommouse=[10,10]; //image x,y offsets from cursor position in pixels. Enter 0,0 for no offset

var defaultimageheight = 180;	// maximum image size.
var defaultimagewidth = 240;	// maximum image size.

var mypageheight = 592;	// page size.
var mypagewidth = 987;	// page size.

function truebody(){
return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;
}

function rcp_pview(rcp_pic){

	rcp_setpos();
	document.onmousemove=rcp_setpos; 
	document.getElementById("rcp_poverbig").style.display="block";
	document.getElementById("rcp_poverbig").style.background= "url("+rcp_pic+") top left no-repeat";
}
function rcp_phide(){
	document.getElementById("rcp_poverbig").style.display="none";
	document.onmousemove="";
}
function rcp_setpos(e){

	var xcoord=offsetfrommouse[0];
	var ycoord=offsetfrommouse[1];

	var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15;
	var docheight=document.all? Math.min(truebody().scrollHeight, truebody().clientHeight) : Math.min(window.innerHeight);

	if (typeof e != "undefined"){
		if (docwidth - e.pageX < defaultimagewidth + offsetfrommouse[0]){
			xcoord = e.pageX - offsetfrommouse[0]- defaultimagewidth; // Move to the left side of the cursor
		} else {
			xcoord += e.pageX;
		}
		if (docheight - e.pageY < defaultimageheight + offsetfrommouse[1]){
			ycoord = e.pageY - offsetfrommouse[1]- defaultimageheight; // Move to the left side of the cursor
		} else {
			ycoord += e.pageY;
		}

	} else if (typeof window.event != "undefined"){
		if (docwidth - event.clientX < defaultimagewidth + offsetfrommouse[0]){
			xcoord = event.clientX + truebody().scrollLeft - xcoord - defaultimagewidth; // Move to the left side of the cursor
		} else {
			xcoord += truebody().scrollLeft+event.clientX
		}
		if (docheight - event.clientY < (defaultimageheight + offsetfrommouse[1])){
			ycoord += event.clientY + truebody().scrollTop - Math.max(0,(2*offsetfrommouse[1] + defaultimageheight + event.clientY - docheight));
		} else {
			ycoord += truebody().scrollTop + event.clientY;
		}
	}
	document.getElementById("rcp_poverbig").style.left=xcoord+"px";
	document.getElementById("rcp_poverbig").style.top=ycoord+"px";

}


