// JavaScript Document
popwin=null;

pStart='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\n<html><head><title>Apartments JB</title></head><body style="margin: 0; padding: 0; background-color:#ffd88b;"><img src="';
pEnd='" onclick="window.close();" id="image"></body></html>';

function popopen (url) {
		popwin=window.open ('','a','location=no,menubar=no,resizable=yes,scrollbares=no,toolbar=no,status=no,width=610,height=460',true);
		popwin.document.write (pStart+url+pEnd);
		popwin.document.close();
		img=popwin.document.getElementById('image');
		img.onload=function () {
			do {
			} while (!img.width);
			//popwin.resizeTo (img.width,img.height);
			popwin.focus();
			popwin.resizeTo (1000,800);
			//
			var myWidth = 0, myHeight = 0;
		  if( typeof( window.innerWidth ) == 'number' ) {
		    //Non-IE
		    myWidth = popwin.innerWidth;
		    myHeight = popwin.innerHeight;
		  } else if( popwin.document.documentElement &&
		      ( popwin.document.documentElement.clientWidth || popwin.document.documentElement.clientHeight ) ) {
		    //IE 6+ in 'standards compliant mode'
		    myWidth = popwin.document.documentElement.clientWidth;
		    myHeight = popwin.document.documentElement.clientHeight;
		  } else if( popwin.document.body && ( popwin.document.body.clientWidth || popwin.document.body.clientHeight ) ) {
		    //IE 4 compatible
		    myWidth = popwin.document.body.clientWidth;
		    myHeight = popwin.document.body.clientHeight;
		  }
			
			popwin.resizeBy (-(Math.abs(img.width-myWidth)),-(Math.abs(img.height-myHeight)));
			//window.alert( 'Width = ' + myWidth +'\n'+'Height = ' + myHeight );
		}
		popwin.onunload=function () {
			this.opener.popwin=null;
		}
}
