// Image daughter window code
// some js functions to help when creating daughter windows with images.

function GetImageDims(ImageURL, H, W)
// Get dimensions of an image
{
	var img = new Image();
	img.src=ImageURL;
	H = img.height;
	W = img.width;
};
function GetImageHeight(ImageURL)
{
	var img = new Image();
	img.src=ImageURL;
	return img.height ;	
};
function GetImageWidth(ImageURL)
{
	var img = new Image();
	img.src=ImageURL;
	return img.width;
};
function WindowOpen(URL,W,H)
//opens widow based on Height and width provided in params
{
	window.open (URL, 'newwindow', 'height=' + H + ', width=' + W + ', toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no');
};
function WindowOpenToImageSize(URL)
//opens widow based on Height and width of Image - adds fudge factor to make up for browser
{
	window.open (URL, 'newwindow', 'height=' + (GetImageHeight(URL) + 20) + ', width=' + (GetImageWidth(URL) + 20) + ', toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no');
};
