<?php
	$title = "smokinggun | SOURCE CODE";
	
	$nav_link = "/demos/index.php";
	$nav_image = "title_source.png";
	
# this should be stripped out when put on the live site
	require("../path_to_lib.php");

#
# tool for managaing catalog categories
# 

	require($path_to_lib."sg_main.php"); 		# main library

# include the html snippets for drawing the interface
	include($path_to_lib."html/public_html.php");

echo $public_header;

echo <<<HTML

<style type="text/css" id="stStyle">

/* THIS MUST BE THE FIRST STYLE */
.stText p {padding:0px; margin:0px}

.stText {
	position:absolute;  
	margin-right:14px;
	width:250px; 
	top:0px; 
	left:0px; 
	padding-right:5px;
	}

#story {}

#story DIV {}

#textParent {
	left:30px; 
	top:120px;
	overflow:hidden; 
	width:100%; 
	margin-left:0px; 
	z-index:1; 
	position:absolute;
	}

#imageViewer {
	position:absolute;
	overflow:auto;
	width:100%;
	top:100px;
	left:560px
	}

#imageViewer DIV 
	{
	margin:10px;
	}
	
.stHidden
	{
	display:none;
	visiblity:hidden;
	}
	
#printPane
	{
	display:none;
	}
/* printer version	*/
@media print
   {
   
   	#imageViewer
   		{
   		display:none;
   		visiblity:none;
   		}
   
	#printPane
		{
		display:block;
		visible:true;
		}
	
	#textParent
		{
		display:none;	
		}
	}

	
</style>

<script type="text/javascript" src="sg_layout_ini.js"></script>
<script type="text/javascript" src="sg_layout.js"></script>

<div>
	<a href="#" onclick="toggleObjectDisplay('info')">Info</a> |
	<a href="#" onclick="toggleObjectDisplay('source')">Source</a> |
	<a href="/perm/gnu.php">License</a>
</div>


<div>
	<span style="position:relative; top:0px; z-index:20">
	{ page <b id="P"></b> }
	{ text size <a href="javascript:st_fontLarger()"><b>+</b></a> <a href="javascript:st_fontSmaller()"><b>-</b></a> }
	{ <a href="javascript:st_screenPrevious()" id="pageprevious">previous</a> | <a href="javascript:st_screenNext()" id="pagenext">next</a> page }
	</span>
</div>

<div style="position:relative; z-index:1000; top:0px">


<fieldset id="source">
	<div class="legend">Source</div>
	Click to load or download <a href="sg_layout.js">sg_layout.js</a> and <a href="sg_layout_ini.js">sg_layout_ini.js</a><br>
	<samp>
	</samp>
</fieldset>


<fieldset  id="info">
	<div class="legend">Info</div>
	This is an early version of sg layout for public use.  There are still bugs in this version, but I wanted to get it into public viewing and use.  More documentation will be coming later.
	<p>
		<b>Notes</b>
		<ul>
			<li><b>Interface</b> To turn pages click on the first or last column.
			</li>
			<li><b>Cookies</b> Cookies are not implemented in this version to save font size.
			</li>
			<li><b>Copying Text</b> This is the one big downside to using this layout engine.  You can't copy text when the selection spans more than one column.
			</li>
			<li><b>Images</b> Images are now supported.  Images will appear in the image view element.  There are some bugs with this though.
			</li>
			<li>Thanks to Juerg Lehni {www.vectorama.org} {www.scratchdisk.com} for helping me finish this, improving some methods, and testing.
			</li>
		</ul>
	</p>
	<p>
	<b>Known Bugs</b><br>
	Please report bugs or questions to <a href="mailto:$EMAIL">$EMAIL</a>
	<ul>
		<li>
		<b>ART_HEIGHT</b> min and max values are ignored.  
		</li>
		<li>
		<b>Paragraph Detection</b> There is a bug in st_alignParagraphs when there are more than two columns.  
		</li>
		<li>
		<b>Single Column</b> Page turning does not work yet in single column mode.  
		</li>
		<li>
		<b>Images</b> There is a bug with image location detection in some versions of Mozilla.
		</li>
	</ul>
	</p>
	<p>
	<b>Setup</b>
		<blockquote>
		Coming later.
		</blockquote>
	
	</p>
</fieldset>
</div>

<div id="pageContents">
<!-- 
text must be between a tag, span, div, p, otherwise it will not resize in IE on the Mac 
avoid <p></p>'s there is a margin's problem in IE Mac and Mozilla
-->

HTML;

include("reader_text.php");

echo $text_p_image;

echo <<<HTML

</div>
<div id="textParent"></div>
<div id="imageViewer"></div>

HTML;

echo $public_footer;

?>