var windowHandle = null;
var NewWindow = null;
var globalImage = null;
var globalImageWidth = null;
var globalImageHeight = null;
var globalCaption = null;

//Version with (c) FD loads in Photo.html
function myOpen(localImage,localCaption,imageWidth,imageHeight)
	{
	globalImage = localImage;
	globalCaption = localCaption;
	globalImageWidth = imageWidth;
	globalImageHeight = imageHeight;
	windowWidth = imageWidth + 34;
	if (imageHeight > screen.height - 140)		
		{
		windowHeight = screen.height - 50;
		}
	else
		{
		windowHeight = imageHeight + 110;
		}
	posX = screen.width/2 - imageWidth/2 - 20;
	windowHandle = 
	window.open('photo.html','windowName','toolbar=no,location=no,status=no, scrollbars=yes,resizable=no,width='+ windowWidth +',height='+ windowHeight +',top=0,left='+ posX );
	}

//Version without copyright FD loads in Photo1.html. Size is also different.
function myOpen1(localImage,localCaption,imageWidth,imageHeight)
	{
	globalImage = localImage;
	globalCaption = localCaption;
	globalImageWidth = imageWidth;
	globalImageHeight = imageHeight;
	windowWidth = imageWidth + 34;
	if (imageHeight > screen.height - 110)		
	 	{
		windowHeight = screen.height - 50;
		}
	else
		{
		windowHeight = imageHeight + 80;
		}
	posX = screen.width/2 - imageWidth/2 - 20;		
	windowHandle = 
window.open('photo1.html','windowName','toolbar=no,location=no,status=no,scrollbars=yes,resizable=no,width='+ windowWidth +',height='+ windowHeight +',top=0,left='+ posX );
}

//Version for simple window with text only (added width on 1 June 2008)
function myOpen2(localImage,imageWidth)
	{
	globalImage = localImage;
	posX = screen.width/2 - imageWidth/2 - 20;		
	windowWidth = imageWidth + 34;
	windowHandle = 
	window.open(globalImage,'popup','toolbar=yes,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width='+ windowWidth +',top=0,left='+ posX );
	}

//Version with &copy; FD loads in Photo3.html
function myOpen3(localImage,localCaption,imageWidth,imageHeight){
	globalImage3 = localImage;
	globalCaption3 = localCaption;
	globalImageWidth3 = imageWidth;
	globalImageHeight3 = imageHeight;
	windowWidth = imageWidth + 34;
	if (imageHeight > screen.height - 160)		
		{
		windowHeight = screen.height - 40;
		}
	else
		{
		windowHeight = imageHeight + 150;
		}
	posX = screen.width - imageWidth;		// Right
	NewWindow = 
	window.open('photo3.html','windowName3','toolbar=no,location=no,status=no,scrollbars=yes,resizable=no,width='+ windowWidth +',height='+ windowHeight +',top=0,left='+ posX );
}

//Version with image as background loads in Photo4.html 
function myOpen4(localImage,localCaption){
	globalImage4 = localImage;
	globalCaption4 = localCaption;
	posX = screen.width/2 - 380;		// Center
	NewWindow = window.open('photo4.html','windowName4','toolbar=no,location=no,status=no,scrollbars=yes,resizable=yes,width=760,top=0,left='+ posX );
}

function changeIt(MyImage1, MyImage2) 
	{ 
	if (document.images) 
		{ 
		document[MyImage1].src = MyImage2;
		}
} 

function displayNavigator(){
	var myText=null;
	myText ='Your browser is: ' + navigator.appName + '\n' + 'Version ';
	myText += navigator.appVersion + '\n';
	myText +='Your screen width is '+ screen.width+' pixels'+'\n';
	myText +='Colour depth is '+ screen.colorDepth+' bits';
	alert(myText);
	}

// -------------------------------------------------------
//  newUntil ()
//  Dynamic News
//  Written by Jerry Aman, Optima System, Aug 31, 1996. 
//  Part of the PageSpinner distribution.
//  Input:	year, month (1-12) and day (1-31)   
// 		Until the last day the new image should be displayed
// -------------------------------------------------------

function newUntil_img (year, month, day)
{
	now = new Date();
	expire = new Date (year, month-1, day, 
		now.getHours(), now.getMinutes(), now.getSeconds()+1 );

	if ( expire.getTime()  >=  now.getTime())
		{
		document.write(	
		'<IMG SRC="images/New1.gif" ALIGN="TOP" ALT="NEW!">' );
		}
}

function newUntil_txt (year, month, day)
{
	now = new Date();
	expire = new Date (year, month-1, day, 
		now.getHours(), now.getMinutes(), now.getSeconds()+1 );

	if ( expire.getTime()  >=  now.getTime())
		{
		document.write(	'<FONT color="#dd0022"><B> (New) </B></FONT>');
		}
}

function updateUntil_img (year, month, day)
{
	now = new Date();
	expire = new Date (year, month-1, day, 
		now.getHours(), now.getMinutes(), now.getSeconds()+1 );

	if ( expire.getTime()  >=  now.getTime())
		{
		document.write(	
	'<IMG SRC="images/Updated.gif" ALIGN="TOP" ALT="Updated!">' );
		}
}

function updateUntil_txt (year, month, day)
{
	now = new Date();
	expire = new Date (year, month-1, day, 
		now.getHours(), now.getMinutes(), now.getSeconds()+1 );

	if ( expire.getTime()  >=  now.getTime())
		{
		document.write(	'<FONT color="#000099"><B> (Updated) </B></FONT>');
		}
}

