var width,height
var image
var hmargin=60,vmargin=135
var wleft=20,wtop=20
var fill=0.85

function transferview(image,width,height) {
	if (width+hmargin+wleft>=fill*screen.width) width=fill*(screen.width-wleft)
    else width=width+hmargin;
  if (height+vmargin+wtop>=fill*screen.height) height=fill*(screen.height-wtop)
    else height=height+vmargin;

	RitPopWin=window.open("","ritwin","toolbar=no,scrollbars=yes,resizable=yes,menubar=no,width=10,height=10");

	var s1 ="<TITLE>Image</TITLE>"
	var s15=""
	var s2 ="<CENTER><IMG SRC='"+image+"' BORDER=0>"
	var s3 ="<FORM><INPUT TYPE='BUTTON' VALUE='Close Window' onClick='self.close()' style='background:#FF0080;color:#FFFF00;font:bold'>"
	var s4 ="</FORM></CENTER>"

	RitPopWin.window.moveTo(wleft,wtop);
	RitPopWin.window.resizeTo(width,height);
	RitPopWin.document.write(s1+s15+s2+s3+s4);
	RitPopWin.document.close();
	RitPopWin.focus();
}