if (window.location.protocol=='file:')
	{path='./deutsch/pictures_2/'}
else
	//remote version
	{path='http://www.piemontimmobilien.ch/pictures_2/'}

function display(pic,pic_width,pic_height,legend) {

x=screen.width;
y=screen.height;
u=eval(pic_width);
v=eval(pic_height);
w=200;		//text-area height - min 180, but see Opera at 1280x1024
z=(v+w);		//temp variable used for small picture
t=(y-w);		//temp variable used for large picture

if (z<y)	{			// small picture
	y_new=z;			//window height reduced to picture height + text height
	x_new=parseInt(z*(x/y));	//window width reduced in proportion
	a=v;           	 	// image height unchanged
	b=u;			// image width unchanged
	}
else	{			//large picture		
	y_new=y;			//window height unchanged
	x_new=x;			//window width unchanged
	a=t;			//image height reduced to screen height - text height
	b=parseInt(t*(u/v));		//image width reduced in proportion
	}

p_number=pic.substring(1,4)

// Jul 2011 - changed to scrollbars=1 and resizable=1. With Opera 11 you can't FORCE a new window: but a new tab is not resized to the full screen
var popup=window.open('','fullscreen','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=1,resizable=1,status=0,titlebar=0');
//popup.location.href = '';	     required for safari 3 bug??
popup.document.open();  // nb escape ALL forward slashes
popup.document.write("<html><head><title>Piedmont Properties P"+p_number+"<\/title><\/head>");
popup.document.write("<body bgcolor='#ffffff' style='font-family:verdana;font-size:12px;' onUnload='window.blur()'>");
popup.document.write("<center><img src='"+path+pic+"' height='"+a+"' width='"+b+"'><br>"+legend);
popup.document.write("<br><br><a href='javascript:window.close();'>Close<\/a>");	
popup.document.write("<\/center><\/body><\/html>");	
popup.document.close();
popup.moveTo(0,0);
popup.resizeTo(x_new,y_new);
popup.focus();
}
