//File: content.js
/*Doc*/
/*
Segments of the site are broken into functions. Two main functions thou must knoweth:
begin_content()
end_content()
On all of your pages you want to use the template for the rest of your site (i.e. ALL OF THEM) you absolutely must not call anything before begin_content()
These two functions are also the most important ones for you if you want to change the layout of the site. Study them.

You will see a variable called "page" a lot in this file. This variable stores the current number of the comic being viewed. It's empty if not being used.
*/


//File: head.js
function pageTitle()
{document.write("<title>"+siteTitle+" #"+page+" - "+dateString(page-pageBase)+"</title>")}


//File: header.js

function header()
{
document.write("<head>")
document.write("<style type=text/css>a:hover{color:"+hover+";}</style>") //font-weight:bold //possibly
document.write("<link rel=\"shortcut icon\" href="+site+"favicon.png type=image/x-png>") //to use .ico, change the extension to .ico and the type to image/x-ico. If you have no favicon comment this line out
document.write("</head>")

document.write("<body bgcolor=#"+bgcolor+" background="+site+iDir+imageBg+" link="+link+" vlink="+vlink+" text="+text+">")

document.write("<table><tr><td width=10px><img src="+site+iDir+imageLogo+" /></td>")
document.write("<td width=25><!--Spacing--></td>")
document.write("<td rowspan=2><iframe src="+site+"ad.html width=600 height=100 scrolling=no frameborder=0 valing=middle></iframe></td></tr>")
document.write("<tr><td width="+widthLogo+"><center>")
document.write("<p>The Photo-comic by "+authorString()+"<br>Updated Wed, Sun (maybe).</p>")
document.write("<p><a href=http://www.buzzcomix.net/in.php?ID=idiom target=_blank><img src="+site+iDir+"buzz.gif border=0></a></p>")
document.write("</center></td></tr></table>")
}


function buttons() //draws the nav buttons
{
w=widthButtons
h=heightButtons

document.write("<p><center>")
document.write("<table><tr>\n<td width="+w+" height="+h+">")

if(page!=pageBase)
	document.write("<a href="+site+"archive.html?p="+pageBase+"><img src="+site+iDir+imageFirst+" border=0 title=\"Go to the first comic\" alt=\"Go to the first comic\"  /></a>") //first button

document.write("</td><td width="+w+" height="+h+">")

if(page!=pageBase)
	document.write("<a href="+site+"archive.html?p="+(page-1)+"><img src="+site+iDir+imagePrevious+" border=0 title=\"Go to the previous comic\" alt=\"Go to the previous comic\"  /></a>") //previous button

document.write("</td><td width="+w+" height="+h+">")

//Imply if we're at the index or not (as in: do we draw the last 2 buttons?)
if(page<totalPages+1)
 {
	u="archive.html?p="+(page+1)
	if(page-pageBase==totalPages-1) u="index.html"
	document.write("<a href="+site+u+"><img src="+site+iDir+imageNext+" border=0 title=\"Go to the next comic\" alt=\"Go to the next comic\" /></a>") //next button
	}
document.write("</td><td width="+w+" height="+h+">")

if(page<totalPages+1)
	document.write("<a href="+site+"index.html><img src="+site+iDir+imageLast+" border=0 title=\"Go to the current comic\" alt=\"Go to the current comic\" /></a>") //Current button

document.write("</td></table></center></p>")
}


//File: comic.js

function nav()
{
document.write("<table border=1 width=75%>")
document.write("<tr><td><font color="+text2+"><h2>&nbsp;&nbsp;Navigation&nbsp;&nbsp;</h2></font></td></tr>\n")
document.write("<tr><td><font size=4><a href="+site+"index.html>Main</a></font></td></tr>\n")
document.write("<tr><td><font size=4><a href="+site+"archive.html>Archive</a></font></td></tr>\n")
//document.write("<tr><td><font size=4><a href=http://com3.runboard.com/bidiomsyndrome>Forum</a></font></td></tr>\n")
document.write("<tr><td><font size=4><a href="+site+"extras/index.html>Extras</a></font></td></tr>\n")
document.write("<tr><td><font size=4><a href="+site+"links/index.html>Links</a></font></td></tr>\n")
document.write("<tr><td><font size=4><a href="+site+"faq/index.html>FAQ</a></font></td></tr>\n")
//document.write("<tr><td><font size=4><a href="+site+"bio/index.html>Bio</a></font></td></tr>\n")
if(!pg)  document.write("<tr><td><font size=4><a href="+site+"javascript:pgNess()>PG Mode</a></font></td></tr>\n")
document.write("<tr><td>Jump to Comic:<br><form method=link action="+site+"archive.html><input type=text name=p size=10 maxlength=4 align=right onUnfocus=this.submit() /> <input type=submit value='Go!'></form></td></tr>") //NOTE THAT THE TEXT FIELD IS NAMED p!!1 WITHOUT THIS, OR AT LEAST WITHOUT IT MATCHING THE NAME OF THE VAL THAT globals.js PULLS OUT OF THE URL FOR THE PAGE, YOU'RE SCREWED
document.write("</table>")
}



/***********************************************************************/
/*Everything unique to a page goes between calls to these two next functions*/
/*These mere things provide the great template that is so nice about this whole package*/
/*Hack them as you wish*/
/***********************************************************************/


function begin_content()
{
header()
document.write("<p align=center>")
document.write("<table width=100%>")
document.write("<tr>\n<td align=center valign=middle width=20%>")
nav()
document.write("</td>\n") //first left box
document.write("<td align=left valign=top rowspan=5>") //<content box> (where page specific stuff goes, in this table cell). The rowspan is so that it covers all the table cells to the left for things like nav bars, links, or other. You can change it if you need to.
}

function end_content()
{
document.write("</td>\n") //</content box>
//document.write("<td width=10% rowspan=5></td>") //right hand column for spacing. Attempted removal due to problems on lowres screens. Failed.
document.write("\n</tr>\n\n")
document.write("<tr>\n<td align=center height="+ys[page-pageBase]*0.55+">")
li.printShort(10,1)
document.write("</td>\n</tr>\n\n") //spacing box in middle
document.write("<tr>\n<td align=center valign=middle>")
nav()
document.write("</td>\n</tr>\n\n")//second nav box
document.write("</table>\n\n\n")
document.write("</p>")
if(!isIndex) credits()
}


/*comic - Displays a comic, it's title, and the buttons in it's own seperate table so the entire affair may be aligned as one object*/

function comic()
{
document.write("<center><table width="+(widthButtons*4)+"><tr><td>"); //the width must be the size of all four buttons*button_width so it's consistent across all pages (namely, the index and first page look the same as the ones with all the buttons). UNUSED!!! Only implemented in trying to get rid of horizontal scrollbar on 800*600 screens
buttons()
document.write("<center><font color="+text2+"><h2>#"+page+": "+titles[page-pageBase]+"</h2></font><br>") //alternate version (avec ""): document.write("<h2>#"+page+": \""+titles[page-pageBase]+"\"</h3><br></center>")
document.write("<img src="+site+cDir+images[page-pageBase]+" height="+ys[page-pageBase]+" width="+xs[page-pageBase]+" name=comic_image />") //ignore "name=comic_image", that's just because I was trying to pull off a little trick in zInfo and I needed the image to be accessable to me in javascript
if(notes[page-pageBase]) document.write("<p /><center><font color="+text2+">"+notes[page-pageBase]+"</font></center>\n\n")
buttons()
document.write("</td></tr></table></center>")
}




//File: credits.js

//This function is completely hackable. Put whatever you need to.
function credits()
{
document.write("<center><font size=2 color=FFFFFF><i>")
document.write("<p />"+siteTitle+" and all related materials (including everything on this site) are Copyright © 2003 "+authorString()+" except where specifically noted or you where you would sue us otherwise. Muah (which is a *laff*, <u><b>not</b></u> a kiss "+(pg?"for sure":"goddamnit all, you bastards")+". Booyah.)<p />")

//Liscense
document.write("<a href=http://creativecommons.org/licenses/by/1.0/><img title=\"Creative Commons License\" border=0 src="+site+iDir+"somerights.gif /></a>")
document.write("<p />This work is licensed under a <a href=http://creativecommons.org/licenses/by-nc/1.0/>Creative Commons License</a>.")
document.write("<p />Note: If you are using Opera and the archives are not working, check what you are having it identify itself as.<br>If this is anything other that Opera or Internet Explorer (MSIE) the archives don't work and there is no way around this (the browser's lying to us! How can we do anything?!).")
if(pg) document.write("<p><a href=javascript:pgNess()>Non-PG Mode</a>, hidden all the way down here.</p>")
document.write("<p />Idiom Syndrome is hosted on <a href=http://www.keenspace.com>Keenspace</a>, a free webhosting and site automation service for webcomics.")

document.write("</i></font></center>")

document.writeln("<!--")
document.writeln("<rdf:RDF xmlns=http://web.resource.org/cc/")
document.writeln("    xmlns:dc=http://purl.org/dc/elements/1.1/")
document.writeln("    xmlns:rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns#>")
document.writeln("<Work rdf:about=''>")
document.writeln("<license rdf:resource=http://creativecommons.org/licenses/by-nc/1.0/ />")
document.writeln("</Work>")

document.writeln("<License rdf:about=http://creativecommons.org/licenses/by/1.0/>")
document.writeln("   <requires rdf:resource=http://web.resource.org/cc/Attribution />")
document.writeln("   <permits rdf:resource=http://web.resource.org/cc/Reproduction />")
document.writeln("   <permits rdf:resource=http://web.resource.org/cc/Distribution />")
document.writeln("   <permits rdf:resource=http://web.resource.org/cc/DerivativeWorks />")
document.writeln("   <prohibits rdf:resource=http://web.resource.org/cc/CommercialUse />")
document.writeln("   <requires rdf:resource=http://web.resource.org/cc/Notice />")
document.writeln("</License>")

document.writeln("</rdf:RDF>")

document.writeln("-->")
}
