function ex_set(tx, no, wi, st, htl, htm)
	{
	var tx, no, wi, st, htl, htm

	var t1 = '<table width="100%" align="center" border="0"  ' +
			 'bgcolor="#F5F5F5" cellpadding="0" cellspacing="10">'
	var ip = 'images/nines/'
	var i1a = '<td id="trans">'
	var i1b = '<a href="' + ip
	var i2al = wi + '_0' + no + '_s' + st + '_arr.jpg" target="_blank" onmouseover="this.T_WIDTH=240;'+
			  'return escape(\'This file is about 600x750px or 125K.\')">'
	var i2am = wi + '_0' + no + '_s' + st + '_arr.jpg" target="_blank" onmouseover="this.T_WIDTH=240;'+
			  'return escape(\'This file is about 1200x1500px or 500K.\')">'
	var i2ab = wi + '_0' + no + '_s' + st + '_arr.jpg" target="_blank" onmouseover="this.T_WIDTH=240;'+
			  'return escape(\'This file is about 2400x3000px or 2MB.\')">'
	var i2b = '<img src="' + ip
	var i3 = '_' + wi + '_0' + no + '_s' + st + '_arr.jpg" alt="logo" WIDTH=100 ' +
			 'HEIGHT=125 BORDER=0></a></td>'
			 
	var ptl = 'Low resoluton view of '
	var ptm = 'Mid resoluton view of '
	
	var adl = '<a href="ptm_display.html?title=' + ptl + ti + ', Stage ' + st + 
			  '&width=' + htl + '&height=256&file=xxsmall_' + wi + '_0' + 
			  no + '_s' + st + '.ptm" target="_blank" onmouseover="this.T_WIDTH=240;'+
			  'return escape(\'This file is about 500K.\')">'
	var adm = '<a href="ptm_display.html?title=' + ptm + ti + ', Stage ' + st + 
			  '&width=' + htm + '&height=512&file=xsmall_' + wi + '_0' + 
			  no + '_s' + st + '.ptm" target="_blank" onmouseover="this.T_WIDTH=240;'+
			  'return escape(\'This file is about 2MB.\')">'
	var adb = '<a href="files/' + wi + '_0' + no + '_s' + st + '.ptm" onmouseover="this.T_WIDTH=240;'+
			  'return escape(\'This file is about 7MB.\')">'

	var stuff = '' +
		t1 +
		'	<tr><td NOWRAP valign="top"><h4>Stage ' + st + ':</h4></td>' +
		'		<td width="100%" valign="top"><p>' + tx + '</p></td></tr></table>' +
		t1 +
		'</tr>' +
		'<tr align="center">' +
		'<td><p><b>Low Resolution</b></p></td>' +
		'<td><p><b>Medium Resolution</b></p></td>' +
		'<td><p><b>High Resolution</b></p></td>' +
		'</tr>'+
		'<tr align="center" valign="top">' +
		i1a + i1b + '600_' + i2al + i2b + 'crop_600' + i3 +
		i1a + i1b + '1200_' + i2am + i2b + 'crop_1200' + i3 +
		i1a + i1b + '' + i2ab + i2b + 'crop' + i3 +
		'<tr align="center">' +
		'<td><table><tr><td>' + i1b + '600_' + i2al + 
		'<p>View Image</p></a></td><td width="20"></td><td>' + adl + 
		'<p>View PTM</p></a></td></tr></table></td>' +
		'<td><table><tr><td>' + i1b + '1200_' + i2al + 
		'<p>View Image</p></a></td><td width="20"></td><td>' + adm + 
		'<p>View PTM</p></a></td></tr></table></td>' +
		'<td><table><tr><td>' + i1b + '' + i2al + 
		'<p>View Image</p></a></td><td width="20"></td><td>' + adb + 
		'<p>Download PTM</p></a></td></tr></table></td>' +
		'</tr>' +
		'</table><br>'

	return stuff
	}

function ex_page(ti, no, s1, s2, s3, s4, co, wi, htl, htm)
	{
	var ti, no, s1, s2, s3, s4, co, wi, htl, htm

	var block_1 = '' +
	'<table width="100%" align="center" border="0" cellpadding="0" cellspacing="10">' +
	'<tr><td>' +
	'	<h4>Introduction:</h4></td></tr>' +
	'<tr><td> '

	var block_2a = '' +
	'	<p>All of the canvas samples have been produced by stretching a medium weight ' +
	'un-primed linen canvas over a small stretcher (~20x25cm), priming it with white ' +
	'acrylic gesso and then painting it with alkyd colours.</p>'

	var block_2b = '' +
	'	<p>All of the panel samples have been prepared on a thin oak panel (~22×25cm), ' +
	'which was then primed with white acrylic gesso and then painted with alkyd colours.</p>'

	if (wi == 'canvas')
		{block_2 = block_2a}
	else
		{block_2 = block_2b}

	var block_3 = '' +
	'	<p>In addition to the PTM file a composite image showing the eight high-raking ' +
	'light images and an image created by averaging all twenty four captured images has ' +
	'been made available for download, at high, medium and low resolutions. </td></tr>' +
	'<tr><td><p><b>NB:</b> Downloaded the PTMs can be viewed with the ' +
	'<a href="http://www.hpl.hp.com/research/ptm/downloads/agreement.html">HP viewer</a>' +
	'.</p></td></tr>' +
	'<tr><td>' +
	'	<h4>' + ti + ':</h4></td></tr>' +
	'<tr><td>' +
	'	<p>' + co + '</p></td></tr>' +
	'</table><br><br><table width="60%" align="center"><tr align="center"><td>'

	var block_4 = '</td></tr></table>'

	var a1 = ex_set(s4, no, wi, '4', htl, htm)
	var a2 = ex_set(s3, no, wi, '3', htl, htm)
	var a3 = ex_set(s2, no, wi, '2', htl, htm)
	var a4 = ex_set(s1, no, wi, '1', htl, htm)

	var stuff = block_1 + block_2 + block_3 + a1 + a2 + a3 + a4 + block_4
	return stuff
	}

function delineate(at, an, b, str)
{
theleft = str.indexOf(at) + an
theright = str.lastIndexOf(b)
return(str.substring(theleft, theright))
}

function delineate2(str)
{
point = str.lastIndexOf("=")
return(str.substring(point+1,str.length))
}

function ptm_view(title, width, height, ptm)
	{
	var title, width, height, ptm
	
	if (width < 500)
		{box_width = 500}
	else
		{box_width = width}
	
	if (height < 500)
		{box_height = 500}
	else
		{box_height = height}
		
	var stuff = '' +
'<table align="center" width="800" border="0" cellpadding="0" cellspacing="0">' +
'	<tr>' +
'		<td valign="top">' +
'			<img src="images/tl.png" alt="tl" width="25" height="25"></td>' +
'		<td valign="top" height="25" width="100%" background="images/hzt.png">' +
'			<img src="images/hzt.png" alt="hzt"  height="25"></td>' +
'		<td valign="top">' +
'			<img src="images/tr.png" alt="tr" width="25" height="25"></td>' +
'	</tr>' +
'	<tr>' +
'		<td align="left" width=25 background="images/vrl.png">' +
'			<img src="images/vrl.png" alt="vrl" width="25" height="100%"></td>' +
'		<td align="center">' +

'			<table align="center">' +
'				<tr>' +
'					<td align="left" valign="top">' +
'						<a href="http://www.java.com/">' +
'							<img src="images/java_logo.png" alt="logo" border="0"></a></td>' +
'					<td align="center"><h3>Java PTM Viewer:</h3><h4>' + title + '</h4></td>' +
'					<td align="right" valign="top">' +
'						<a href="http://www.java.com/">' +
'							<img src="images/java_logo.png" alt="logo" border="0"></a></td>' +
'				</tr>'+
'				<tr>' +
'					<td colspan="3" align="left"><p><br><b>Instructions:</b> The direction of the light ' +
'					can be adjusted by holding down the left mouse button and dragging ' +
'					the pointer across the image.  Further option can be accessed through ' +
'					the right mouse button menu, full details of which are given <a ' +
'					href="ptm_instructions.html" target="_blank">HERE</a><\p></td>' +
'				</tr>'+
'				<tr>' +
'					<td colspan="3" align="left"><p><b>Please be patient, loading can take ' +
'					a while</b>, also errors can occur due to the memory limits, if the viewer stops working ' +
'					you will have to wait and try again later, or <a href="JPView/' + ptm + '">download</a> the PTM and view it with the ' +
'					<a href="http://www.hpl.hp.com/research/ptm/downloads/agreement.html">HP viewer</a>.</p><br></td>' +
'				</tr>'+
'				<tr>'+
'					<td  colspan="3" align="center">' +
'	    				<applet archive="envlib.jar" code="jpview/gui/Standalone.class" ' +
'							height="' + box_height + '" width="' + box_width + '">' +
'	  						<param name="ptmfile" value="../../JPView/' + ptm + '"> ' +
'							<param name="bg_red" value="235"> ' +
'							<param name="bg_green" value="235">' +
'							<param name="bg_blue" value="235"> ' +
'							<param name="pw" value="' + width + '"> ' +
'							<param name="ph" value="' + height + '"></applet> ' +
'					</td>' +
'				</tr>' +
'				<tr>' +
'					<td colspan="3" align="left"><p><br><b>If the viewer does not work at all please ensure you have a ' +
'					recent version of java.  The latest java plugins can be downloaded <a href="http://www.java.com/">HERE</a></p></td>' +
'				</tr>'+
'				<tr>' +
'					<td colspan="3" valign="bottom" align="center"><br><b>The viewer was developed by Clifford Lyon, contact details and ' +
					'examples of the latest version of the viewer can be seen <a href="http://materialobjects.com/ptm/">HERE</a>' +
'					</b></td>' +
'				</tr>'+
'				<tr>' +
'					<td align="center" colspan="3">' +
'						<br><i>For further information please contact: joseph.padfield@ng-london.org.uk</i>' +
'					</td>' +
'				</tr>' +
'			</table>' +
'		</td>' +
'		<td align="right" width=25 background="images/vrr.png">' +
'			<img src="images/vrr.png" alt="vrr" width="25" height="100%"></td>' +
'	</tr>' +
'	<tr>' +
'		<td valign="top">' +
'			<img src="images/bl.png" alt="bl" width="25" height="25"></td>' +
'		<td valign="top" background="images/hzb.png" height="25">' +
'			<img src="images/hzb.png" alt="hzb" height="25"></td>' +
'		<td valign="top">' +
'			<img src="images/br.png" alt="br" width="25" height="25"></td>' +
'	</tr>' +
'</table>'

	return stuff
	}

