//		This script is for use on the web-sites where the maximum picture
//		size is dictated by download time to about 60-100 KB.  There is no point
//    in using the whole of the screen for high resolution monitors since this
//		will produce visible pixellation.
//		The full display process only works for N4 and IE4 and above, hence the 
//		work-around code

		var firstTime = 1;

      function displayPicture(picUrl, picH, picW, bgColour)
			{
				// browser sniffer
				var browserVersion = parseInt(navigator.appVersion);
				var BVMAX = 4;

				if (browserVersion < BVMAX)
				{
					var aw = 800;
					var ah = 600;
					if (firstTime)
					{
						alert("Your browser cannot implement the picture" +
								" display properly. I recommend that you" +
								" update it sometime soon.");
						firstTime = 0;
					}
				}
				else
				{
					var aw = screen.availWidth;
					var ah = screen.availHeight;
				}

				var aRMax = aw/ah;
				var winW, winH;
				var aR = picW/picH;
				if(bgColour==null){bgColour="#000000";}
				if (aR >= aRMax)
				{	winW = aw;
					winH = aw/aRMax;
				}
				else
				{	winH = ah;
					winW = ah*aRMax;
				}


				if (browserVersion < BVMAX )
				var newWin = window.open("", "newWindow",
			      	"width=" + winW + ",height=" + winH + ",resizable,scrollbars" );
				else
			      var newWin = window.open("", "newWindow",
			      	"width=" + winW + ",height=" + winH + 
						",screenX=0,screenY=0,left=0,top=0" );
				
				var dispW = winW * 0.95;
				var dispH = winH * 0.95;
				var vSp = 0;
				if (aw>800){
					var mag = aw/1000;
					dispW=picW*mag; dispH=picH*mag;
				}


				newWin.document.open();

				newWin.document.write("<HEAD><TITLE>Picture Display Window</TITLE></HEAD>");
				newWin.document.write("<BODY BGCOLOR=" + bgColour + ">");
				if (aw>800)
				{	for ( var i = 0; i<4*mag; i++ )
						newWin.document.write("<BR>");
				}
		
				newWin.document.write("<CENTER><IMG SRC=\"" + picUrl + "\"");
				newWin.document.write("HEIGHT=" + dispH);
				newWin.document.write("WIDTH=" + dispW );	
				newWin.document.write("></CENTER>");
				newWin.document.write("</BODY>");
				
				newWin.document.close();
			}


