// JavaScript Document

//Initialise an array of images and their sizes. Could be built out of info in the IMAGES array, but this is free, so keeping it easy...

var pics = new Array();
//repeat this for each new image...
var dim = new Array();
dim["width"]=536;
dim["height"]=389;
pics["flight"]=dim;
var dim1 = new Array();
dim1["width"]=684;
dim1["height"]=484;
pics["seventysecond"]=dim1;
var dim2 = new Array();
dim2["width"]=638;
dim2["height"]=410;
pics["Halton"]=dim2;
var dim3 = new Array();
dim3["width"]=633;
dim3["height"]=436;
pics["pass1"]=dim3;
var dim4 = new Array();
dim4["width"]=595;
dim4["height"]=473;
pics["pass2"]=dim4;
var dim5 = new Array();
dim5["width"]=695;
dim5["height"]=312;
pics["Pband"]=dim5;
var dim6 = new Array();
dim6["width"]=640;
dim6["height"]=399;
pics["rugbyteam"]=dim6;
var dim7 = new Array();
dim7["width"]=279;
dim7["height"]=484;
pics["t1reeplantingsept02"]=dim7;
var dim8 = new Array();
dim8["width"]=400;
dim8["height"]=223;
pics["t2reeplantingsept02"]=dim8;
var dim9 = new Array();
dim9["width"]=400;
dim9["height"]=232;
pics["t3reeplantingsept02"]=dim9;
var dim10 = new Array();
dim10["width"]=400;
dim10["height"]=276;
pics["Group"]=dim10;
//

function zoomPics(imgName){
//get the image object from the DOM ...
	img = document.getElementById(imgName);
	//use the replace method to remove the string 'thumbs' from the src path name and thus create the path name to 
	//the detail image.
	newSrc = img.src.replace('/thumbs/','/');
	//get the dimensions for this image from the array...
	width = pics[imgName]["width"];
	height = pics[imgName]["height"];	
	//establish top left corner for image...
	sHeight=screen.availHeight;
	sWidth=screen.availWidth;
	t=(sHeight - height)/2;
	l=(sWidth - width)/2;
	//create the window that will display the detail photo...
	newWindow = window.open("images/gallery/photo.htm","halton","width="+width+",height="+height+",scrollbars=no,top="+t+", left="+l);
	//to overcome potential problems with calling window objects before they've been created, wait about 50 milliseconds...
	setTimeout("display('"+newSrc+"','"+width+"','"+height+"')",150);

	
}
function display(newSrc,width, height){
	//this function is called 50 milliseconds after the display window is created. It simply amends properties of the img tag to display
	//the relevant image. The image tag has the id 'photo'. The properties are held in global variables that are set in the calling function...
	newWindow.document.photo.src = newSrc;
	newWindow.document.photo.width = width;
	newWindow.document.photo.height = height;
	//make sure the window comes to the front..
	newWindow.focus();

	}