﻿var openWindow = 0;
var ImgHeight = new Array();
var ImgWidth = new Array();
var newImg = new Array();

function getImgSize(imgSrc,x){
		newImg[x] = new Image();
		newImg[x].onload = function(){  
			ImgHeight[this.item] = this.height + 20;
			ImgWidth[this.item] = this.width + 20; 
		}
		newImg[x].src = imgSrc;
		newImg[x].item = x;  // Image object addition
}
	
function loadPhotoSize(){  //set global image sizes.
	ImgHeight[this.item] = this.height + 20;
	alert('z:  ' + this.item + ' Height=' +   ImgHeight[this.item]);
	ImgWidth[this.item] = this.width + 20; 
	alert('z:  ' + this.item + ' Width='  +  ImgWidth[this.item]);
}

function popup(mylink, windowname, y)
{
	if(openWindow) openWindow.close();
	if (! window.focus)return true;
	var href;
	if (typeof(mylink) == 'string')
	   href=mylink;
	else
	   href=mylink.href;
	openWindow = window.open(href, windowname, 'width=' + ImgWidth[y]  + ',height=' + ImgHeight[y]  + ',status=no,scrollbars=no,menubar=no,top=100,left=100');
	return false;
}



