// used to open new window for photo
function open_photo(photo)
{
	var win = window.open(photo, 'photo_window', 'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,resizable=1,width=400,height=400');
	win.focus();
}

// loads new photo that is passed through query string
function load_image(image, load_image)
{
	if (image)
	{
		load_image.src = image;
	}
	else
	{
		alert('Sorry, you must supply a photo');
	}
}

// loads and resizes window to photo
function resize_window(loaded_photo, photo)
{
	var width;
	
	if (loaded_photo.width >= 300)
	{
		width = loaded_photo.width;
	}
	else
	{
		width = 300;
	}
	
	parent.window.resizeTo(width + 63,loaded_photo.height + 145);
	photo.src = loaded_photo.src;
}

// scrolls through all the different photos
function rotate_img(img, new_img)
{
	document.getElementById('img' + img).style.display = "none";
	document.getElementById('count' + img).style.display = "none";
	document.getElementById('previous' + img).style.display = "none";
	document.getElementById('enlarge' + img).style.display = "none";
	document.getElementById('next' + img).style.display = "none";

	document.getElementById('img' + new_img).style.display = "";
	document.getElementById('count' + new_img).style.display = "";
	document.getElementById('previous' + new_img).style.display = "";
	document.getElementById('enlarge' + new_img).style.display = "";
	document.getElementById('next' + new_img).style.display = "";
}