/*
 * utils.js - General javascript utility functions
 * Author: Dan Wilson
 */

 function popPic(id) {
	mypic = window.open('pic.php?id='+id, 'pic', 'height=200,width=200,resizable,scrollbars');
	//mypic = window.open('pic.php?id='+id, 'pic'+id, 'height=200,width=200,resizable,scrollbars');
 }

 function resizeWindow() {
 	window.resizeTo(200,200);

	var bodyTag = document.getElementById('bodytag');
	var prev = document.getElementById('picprev');
	var close = document.getElementById('picclose');
	var next = document.getElementById('picnext');

	width_1 = document.getElementById('disp_image').width;
	width_2 = window.screen.availWidth - 20;
	width = (width_1 > width_2) ? width_2 : width_1;

	height_1 = document.getElementById('disp_image').height;
	height_2 = window.screen.availHeight || (window.screen.height - 20);
	height = (height_1 > height_2) ? height_2 : height_1;

	bodyTag.style.width = width;
	prev.style.width = (width / 3) - 10;
	close.style.width = (width / 3) - 10;
	next.style.width = (width / 3) - 10;

	if (document.all) {
		width += 80;
		height += 70;
	}

	window.resizeTo(width + 20, height + 200);
	window.focus();
};
