
function viewLarge(img){
	var wd,ht,i_wd,i_ht;
	var landscape = img.width > img.height;
	if(landscape){
		wd = 500;
		ht = 500;
		i_wd = 500;
		i_ht = 320;
	} else {
		wd = 500;
		ht = 500;
		i_wd = 320;
		i_ht = 500;
	}
	
	var i_src = img.src.substr(0,img.src.lastIndexOf("."))+"_win.jpg";
	var w = window.open("","Gallery","width="+wd+",height="+ht);
	var d = w.document;
	d.writeln('<?xml version="1.0" encoding="iso-8859-1"?>');
	d.writeln('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
	d.writeln('<html xmlns="http://www.w3.org/1999/xhtml">');
	d.writeln('<head>');
	d.writeln('<title>'+img.title+'</title>');
	d.writeln('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />');
	d.writeln('<base href="' + window.location.href + '">'); 
	d.writeln('<link href="css/main.css" rel="stylesheet" type="text/css" /><link rel="stylesheet" type="text/css" href="css/scrollbar-h.css">');
	d.writeln('</head>');
	d.writeln('<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">');
	d.writeln('<table width="'+wd+'" border="0" cellpadding="0" cellspacing="0">');
	d.writeln('<tr>');
	var imgRows = 1 + !landscape;
	var imgCols = 1 + landscape;
	d.writeln('<td rowspan="'+imgRows+'" colspan="'+imgCols+'" width="'+i_wd+'" height="'+i_ht+'"><img src="'+i_src+'" width="'+i_wd+'" height="'+i_ht+'" alt="'+img.title+'"></td>');
	if(landscape){
		d.writeln('</tr>\n<tr>');
		d.writeln('<td height="'+(ht - i_ht)+'" rowspan="2"><img src="images/spacer.gif" width="1" height="'+(ht - i_ht)+'"></td>');
	}
	d.writeln('<td valign="top" id="win-caption"><p>&nbsp;</p><h4>'+img.title+'</h4><p>'+img.alt+'</p></td>');
	d.writeln('</tr>\n<tr>');
	d.writeln('<td align="center" valign="bottom"><a href="#" onClick="window.close()">click here to close this window</a></td>');
	d.writeln('</td></tr></table>');
	d.writeln('</body>');
	d.writeln('</html>');
	d.close();
}