document.open();

document.writeln('			</DIV>'); // mainpage one
document.writeln('					</TD>');
document.writeln('				</TR>');

document.writeln('				<TR>');
document.writeln('					<TD>');
document.writeln('			<DIV id="divtopfooter">');
document.writeln('						<TABLE width=100% border=0 cellpadding=0>');

if (document.body.getAttribute("pagebottom") != undefined)
{
	if(document.body.getAttribute("pagebottom").indexOf("notop") == -1)
	{
		document.writeln('<TR><TD><a href="#Top">Top</a></TD></TR>');
	}
	if(document.body.getAttribute("pagebottom").indexOf("noswayle") == -1)
	{
		document.writeln('						<TR><TD>');
		if (document.body.getAttribute("sidebar") != "none")
		{
			document.writeln('						<IMAGE src="images/ISM_swayle.jpg"></IMAGE>');
		}
		else
		{
			document.writeln('						<IMAGE src="images/ISM_swayle_long.jpg"></IMAGE>');
		}
	}


}
else
{
document.writeln('						<TR><TD><a href="#Top">Top</a></TD></TR>');
document.writeln('						<TR><TD>');
if (document.body.getAttribute("sidebar") != "none")
{
	document.writeln('						<IMAGE src="images/ISM_swayle.jpg"></IMAGE>');
}
else
{
	document.writeln('						<IMAGE src="images/ISM_swayle_long.jpg"></IMAGE>');
}
}

document.writeln('						</TD></TR></TABLE>');
document.writeln('					</DIV>')
document.writeln('					</TD>');

document.writeln('				</TR>');

document.writeln('			</TABLE>');

document.writeln('		</TD>');

// Insert the sidebar image if required
// Check if we have a flash sidebar by looking at the extension - case sensitive!
if (document.body.getAttribute("sidebar").substring(document.body.getAttribute("sidebar").length - 3) == "swf")
{			
document.writeln('		<TD  valign=top>');
document.writeln('			<DIV id="divsidebar" class="sidebar">');
document.writeln('			<TABLE class="sidebarflash"><TR><TD valign=center align=center>');
document.writeln('			<embed class="sidebarflash" name="sideswf" src="movies/' + document.body.getAttribute("sidebar") + '"></embed>');
document.writeln('			</TD></TR>');
document.writeln('			</TABLE>');

document.writeln('			</DIV>');
document.writeln('		</TD>');

}
else if(document.body.getAttribute("sidebar") != "none")
{
document.writeln('		<TD  valign=top>');
document.writeln('			<DIV id="divsidebar_noscroll" class="sidebar">');
		

	if (document.body.getAttribute("sidebar") == "gallery")
	{
document.writeln('			<TABLE class="ISMGallery">');
document.writeln('				<TR class="ISMGalleryViewer"><TD align=center colspan=2>');		
document.writeln('				<DIV id="ISMGalleryHeader" class="ISMGalleryHeader">');
if (document.body.getAttribute("pictitle") != "" && document.body.getAttribute("pictitle") != null) 
{
document.writeln('				<h2>' + document.body.getAttribute("pictitle") + '</h2>');
}
else
{
document.writeln('				<h2>Gallery</h2>');
}
document.writeln('				<P class="caption">Hover on a picture to view a larger version</P></DIV>');

document.writeln('				<DIV id="ISMGalleryViewer" class="ISMGalleryViewer"><IMG class="ISMGalleryViewer" id="ISMGalleryViewerIMG"></IMG></DIV>');
document.writeln('				<DIV id="ISMGalleryCaption" class="ISMGalleryCaption"><TABLE><TR><TD align=center id="ISMGalleryCaptionTD"><P>PICTURE CAPTION</P></TD></TR></TABLE></DIV>');
document.writeln('				</TD></TR>');

		for (var i=1; i<=document.body.getAttribute("numberpics")*1; i++) 
		{
if (i%2 == 1)
{
document.writeln('				<TR class="ISMGallery">');
}
document.writeln('				<TD align=center class="ISMGallery">');		
document.writeln('				<img class="ISMGallery" id="photo' + i + '" src="images/' + document.body.getAttribute("picnames") + i + '.jpg" alt="ISM Gallery" onmouseover="swapphoto('+ i + ')">');
document.writeln('				</TD>');
if (i%2 == 0)
{
document.writeln('				</TR>');
}
		}

document.writeln('			</TABLE>');
	}
	else if (document.body.getAttribute("sidebar") == "gallery_full")
	{
document.writeln('			<TABLE class="ISMGallery_Full">');
document.writeln('				<TR class="ISMGalleryViewer"><TD align=center colspan=4>');		
document.writeln('				<DIV id="ISMGalleryHeader" class="ISMGalleryHeader">');
if (document.body.getAttribute("pictitle") != "" && document.body.getAttribute("pictitle") != null) 
{
document.writeln('				<h2>' + document.body.getAttribute("pictitle") + '</h2>');
}
else
{
document.writeln('				<h2>Gallery</h2>');
}
document.writeln('				<P class="caption">Hover on a picture to view a larger version</P></DIV>');
document.writeln('				<DIV id="ISMGalleryViewer" class="ISMGalleryViewer"><IMG class="ISMGalleryViewer" id="ISMGalleryViewerIMG"></IMG></DIV>');
document.writeln('				<DIV id="ISMGalleryCaption" class="ISMGalleryCaption"><TABLE><TR><TD align=center id="ISMGalleryCaptionTD"><P>PICTURE CAPTION</P></TD></TR></TABLE></DIV>');
document.writeln('				</TD></TR>');

		for (var i=1; i<=document.body.getAttribute("numberpics")*1; i++) 
		{
if (i%4 == 1)
{
document.writeln('				<TR class="ISMGallery">');
}
document.writeln('				<TD align=center class="ISMGallery_Full">');		
document.writeln('				<img class="ISMGallery" id="photo' + i + '" src="images/' + document.body.getAttribute("picnames") + i + '.jpg" alt="ISM Gallery" onmouseover="swapphoto('+ i + ')">');
document.writeln('				</TD>');
if (i%4 == 0)
{
document.writeln('				</TR>');
}
		}

document.writeln('			</TABLE>');
	}
	else
	{
	
document.writeln('			<TABLE class="ISMSide">');
document.writeln('				<TR><TD align=right  valign=top>');
document.writeln('				<Image id="sidebar" src="images/' + document.body.getAttribute("sidebar") + '" alt="ISM Side bar">');
document.writeln('				</TD></TR>');
document.writeln('			</TABLE>');


	}
document.writeln('			</DIV>');
document.writeln('		</TD>');
document.writeln('	</TR>');
document.writeln('	<TR>');
document.writeln('		<TD colspan=3>');
}
else
{
document.writeln('	</TR>');
document.writeln('	<TR>');
document.writeln('		<TD colspan=2>');
}

document.writeln('<DIV id="divfooter">');
document.writeln('<TABLE align=center>');
document.writeln('	<TR>');
document.writeln('		<TD colspan=3 valign=top align=center>');
document.writeln('			<Image id="footer" src="images/ISM_Footer.jpg" alt="ISM Footer">');
document.writeln('		</TD>');
document.writeln('	</TR>');
document.writeln('</TABLE>');

document.writeln('<TABLE align=center width=85%>');
document.writeln('	<TR>');
document.writeln('			<TD align=left>');
document.writeln('			<TABLE><TR><TD align=right class="footertext"><a href="index.html">Home</a></TD><TD class="footertext" align=left><a href="index.html"><Image src="images/Icon_Home.jpg" alt="Home"></a></TD></TR></TABLE>');
document.writeln('			</TD>');
document.writeln('			<TD align=center>');
document.writeln('			<TABLE><TR><TD align=right class="footertext"><a href="ISM_Want_To_Get_In_Touch.html">Contact Us</a></TD><TD class="footertext" align=left><a href="ISM_Want_To_Get_In_Touch.html"><Image src="images/Icon_Contact_Us.jpg" alt="Contact Us"></a></TD></TR></TABLE>');
document.writeln('			</TD>');
document.writeln('			<TD align=center>');
document.writeln('			<TABLE><TR><TD align=right class="footertext"><a href="ISM_Downloads.html">Downloads</a></TD><TD class="footertext" align=left><a href="ISM_Downloads.html"><Image src="images/Icon_Downloads.jpg" alt="Downloadable Information"></a></TD></TR></TABLE>');
document.writeln('			</TD>');
document.writeln('			<TD align=right>');
document.writeln('			<TABLE><TR><TD align=right class="footertext"><a href="ISM_Site_Map.html">Site Map</a></TD><TD class="footertext" align=left><a href="ISM_Site_Map.html"><Image src="images/Icon_Site_Map.gif" alt="Site Map"></a></TD></TR></TABLE>');
document.writeln('			</TD>');
document.writeln('	</TR>');
document.writeln('</TABLE>');
document.writeln('			<DIV id="divfooter">');

document.writeln('		</TD>');
document.writeln('	</TR>');
document.writeln('</TABLE>');

// Make sure the sidebar and menus are always visible
keepvisible();

// Load the thread bar
getThread();

document.close();


