pictures = new Array();
var picCount = 0;

function preLoad(name, first, second)
{
	pictures[picCount] = new Array(3);
	pictures[picCount][0] = new Image();
	pictures[picCount][0].src = first;
	pictures[picCount][1] = new Image();
	pictures[picCount][1].src = second;
	pictures[picCount][2] = name;
	picCount++;
}

function submitbutton(pressbutton, formName) {
	submitform(pressbutton, formName);
}

function submitform(pressbutton, formName) {
	var f = eval("document." + formName);
	f.action.value = pressbutton;

	try {
		f.onsubmit();
	} catch(e){}
	f.submit();
}

function viewPhoto(path, width, height)
{
	width += 20;
	height += 30;
	
	left_pos = (screen.width - (1 * width)) / 2;
	top_pos = (screen.height - (1 * height)) / 2 - 10;
	
	set_scrollbars = "no";
	
	win_add_w = 0;
	if (left_pos < 40) {
		left_pos = 40;
		width = screen.width - 80;
		set_scrollbars = "yes";
	};
	
	tt_win_w = 1 * width;
	if (top_pos < 40) {
		top_pos = 10;
		height = screen.height - 80;
		if (set_scrollbars == "no") tt_win_w += 18;
		set_scrollbars = "yes";
	};
	
	doc_text = "<html><head><title>" + page_title + "</title><link rel='stylesheet' type='text/css' href='/styles/styles.css' title='site styles'></head>";
	
	doc_text += "<body marginwidth='0' marginheight='0' leftmargin='5' rightmargin='5' topmargin='5' bgcolor='white'>";

	doc_text += "<table width='100%' border='0' cellpadding='0' cellspacing='0'>";
	doc_text += "<tr><td align='center'><img src='" + path + "' border='0'></td></tr>";
	doc_text += "<tr><td align='center'><a href='javascript: window.close();'>" + window_close_text + "</a></td>";
	doc_text += "</tr></table>";

	doc_text += "</body></html>";

	result = open("", "displayWindow","width=" + tt_win_w + ",height=" + height + ",left=" + left_pos + ",top=" + top_pos + ",resizable=yes,status=no,toolbar=no,menubar=no,scrollbars=" + set_scrollbars);
	result.document.open();
	result.document.write(doc_text);
	result.document.close();
	result.focus();
}
