﻿// LOCAL and REMOTE version:
path='./pictures_3/'

// function newCH(pic) {window.open(path+pic, 'newCH', 'scrollbars=0,resizable=1,width=760,height=520');}
// pic 720 x 480 
//function newCV(pic) {window.open(path+pic, 'newCV', 'scrollbars=1,resizable=1,width=460,height=670');}
// pic 420 x 630
//function newH(pic) {window.open(path+pic, 'newH', 'scrollbars=0,resizable=1,width=680,height=520');}    
//pic 640 x 480
// function newV(pic) {window.open(path+pic, 'newV', 'scrollbars=1,resizable=1,width=520,height=680');}
//pic 480 x 640

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;			//new window height
	x_new=parseInt(z*(x/y));	//new window width
	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 less than screen height
	b=parseInt(t*(u/v));		//image width reduced
	}

p_number=pic.substring(1,4)

var popup=window.open('','fullscreen','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=0,status=0,titlebar=0');
//popup.location.href = '';	     required for safari 3 bug??
popup.document.open();
popup.document.write("<html><head><title>Piemont Immobilien P"+p_number+"<\/title><\/head>");
popup.document.write("<body bgcolor='#ffffff' style='font-family:verdana;font-size:12px;'><center>");
popup.document.write("<img src="+path+pic+" height="+a+" width="+b+"><br>"+legend+"<br><br>");
popup.document.write("<a href='javascript:window.close();'>Schliessen<\/a>");	
popup.document.write("<\/center><\/body><\/html>");	
popup.document.close();
popup.moveTo(0,0);
popup.resizeTo(x_new,y_new);
popup.focus();
}
