<?xml version="1.0" ?> 
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl"
xmlns:doc="http://www.bayes.co.uk/sdc"
>
<!--
**WARNING begin**
To make this work I have used the xmlns:xsl="http://www.w3.org/TR/WD-xsl"
namespace on the stylesheet. For historical reasons this allows this 
stylesheet to work in your IE browser regardless of the xsl processor
you have installed. However the correct way to do it and make it 
compatable with future versions of IE and NS is to use 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" and the correct 
stylesheet is available at http://www.bayes.co.uk/xml/styles/toc.xslt
**WARNING end**
BTW it is often more expedient to JFDI rather than write elegant 
code. DO NOT TAKE THIS AS AN EXAMPLE OF ANYTHING OTHER THAN SOMETHING 
THAT WORKS. It has been hacked around a lot over the last few years.
-->
<doc:doc>
	<doc:stylesheet_name>toc.xsl</doc:stylesheet_name>
	<doc:author>Chris Bayes</doc:author>
	<doc:params>None.</doc:params>
	<doc:description>XML/XSL Portal stylesheet</doc:description>
	<doc:copyright>
		Copyright (C) 1998 Chris Bayes.
		    
	    This program is free software; you can redistribute it and/or modify
		it under the terms of the GNU General Public License as published by
		the Free Software Foundation; either version 2 of the License, or
		(at your option) any later version.

		This program is distributed in the hope that it will be useful,
		but WITHOUT ANY WARRANTY; without even the implied warranty of
		MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
		GNU General Public License for more details.

		You should have received a copy of the GNU General Public License
		along with this program; if not, write to the Free Software
		Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
	</doc:copyright>
</doc:doc>
<xsl:template match="*" xml:space="preserve"><xsl:apply-templates/></xsl:template>
<!-- Identity transform template -->
<xsl:template><xsl:copy><xsl:apply-templates select="@* | * | comment() | pi() | text()"/></xsl:copy></xsl:template>
<xsl:template match="/">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="page">
	<html bgcolor="black">
	<head>
	<title>XML/XSL Portal</title>
	<script Language="JavaScript" src="/xml/scripts/toc.js"></script>
	<script language="JavaScript" for="window" event="onunload">savePState("http://" + document.location.hostname + "/cgi-bin/benbayes/xmlconfig.pl", "m");</script>
	<script language="JavaScript" for="window" event="onload">loadPState();</script>
	<script language="JavaScript" src="/xml/scripts/sniffer.js"></script>
	<!--
	Include the changestylesheet scripts just in case someone clicks the MSS logo.
	-->
	<script language="JavaScript" src="/xml/scripts/changestylesheet.js"></script>
	<!--
	Include the domtodom scripts just in case someone is interested in SVG.
	-->
	<script language="JavaScript" src="/xml/utils/domtodom.js" id="domtodomjs"></script>
	<link REL="stylesheet" TYPE="text/css" HREF="/xml/styles/pnav.css"></link>
	<META HTTP-EQUIV="Pragma" CONTENT="no-cache" />
	<META HTTP-EQUIV="Expires" CONTENT="-1" />
	</head>
	<body>
	<!--XML id="XMLDATA" src="/xml/config/toc.xml"></XML-->
	<table height="100%" width="100%" border="0" style="margin-top:10px;">
	<!--THEAD height="1%"-->
	<tr height="1%"><td colspan="3"><xsl:apply-templates select="*//header"/></td></tr>
	<!--/THEAD-->
	<tr height="99%">
	<xsl:apply-templates />
	</tr></table>
	<div id="tocMenu" class="tocMenu" style="width:10%">
		<div class="tocMenuItem" onclick="">Open</div>
		<hr />
		<div class="tocMenuItem" onclick="deleteToc(this)">Delete</div>
		<hr />
		<div class="tocMenuItem" onclick="">View XML</div>
		<div class="tocMenuItem" onclick="">View XSL</div>
		<hr />
		
	</div>
	
	</body><error why="This seems to be an IE5 error. Please Refresh." />
	</html>
</xsl:template>
<xsl:template match="pagehead">
	<!--xsl:apply-templates /-->
</xsl:template>
<xsl:template match="header">
	<xsl:apply-templates />
	<TABLE class="tabs" border="1" width="100%">
		<TR>
			<TD class="arrow" align="center" onclick="naFlash(this, 'navLeft')" onmouseover="this.style.cursor='hand';" onmouseout="this.style.cursor='default';" width="25%"><img src="/xml/images/hide.gif" alt="Hide" /></TD>
			<TD align="center" class="pageTitle"><xsl:value-of select="//page/@title" /></TD>
			<TD class="arrow" align="center" onclick="naFlash(this, 'navRight')" onmouseover="this.style.cursor='hand';" onmouseout="this.style.cursor='default';" width="25%"><img src="/xml/images/hide.gif" alt="Hide" /></TD>
		</TR>
	</TABLE>
</xsl:template>
<xsl:template match="pagetoc">
	<TD id="navLeft" width="20%" valign="top"><xsl:apply-templates /></TD>
</xsl:template>
<xsl:template match="pagemain">
	<TD width="60%" border="1" valign="top"><DIV id="content" style="height:100%;z-index:-1;"><xsl:apply-templates /></DIV></TD>
</xsl:template>
<xsl:template match="pageright">
	<TD id="navRight" width="20%" valign="top"><xsl:apply-templates /></TD>
</xsl:template>
<xsl:template match="pNav|rNav|uNav">
	<DIV class="tocCont">
		<xsl:apply-templates />
	</DIV>
</xsl:template>
<xsl:template match="tocSection">
	<DIV CLASS="tocSecCont">
		
		<DIV CLASS="tocHead" onclick="fnFlash(this)" onmousedown="displayMenu(this)" onmouseup="menuMouseUp(this);" ondrop="dragend(this)" ondragover="dragover(this)">
			<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
			+ <xsl:value-of select="sectionTitle"/>
		</DIV>
		<DIV>
			<xsl:attribute name="id">canvas</xsl:attribute>
			<DIV CLASS="Slider">
				<xsl:attribute name="sHeight"><xsl:value-of select="@sHeight"/></xsl:attribute>

				<xsl:choose>
				<xsl:when test=".[@state = 'open']">
					<DIV CLASS="tocItemShow">
						<xsl:attribute name="id">c_<xsl:value-of select="@id"/></xsl:attribute>
						<xsl:apply-templates />
					</DIV>
				</xsl:when>
				<xsl:otherwise>
					<DIV CLASS="tocItemHide">
						<xsl:attribute name="id">c_<xsl:value-of select="@id"/></xsl:attribute>
						<xsl:apply-templates />
					</DIV>
				</xsl:otherwise>
			</xsl:choose>
			</DIV>
		</DIV>
		<DIV CLASS="tocFoot" onmousedown="mouseDown(this);">
		</DIV>
	</DIV>
</xsl:template>

<xsl:template match="tocItem|newsItem">
    <DIV CLASS="tocItem">
		<xsl:choose>
			<xsl:when test=".[@type = 'external']">
				<a target="xxx">
					<xsl:attribute name="onclick">outlink(this, '<xsl:value-of select="@href"/>');</xsl:attribute>
					<xsl:attribute name="onmouseover">itemOver(this, '<xsl:value-of select="@href"/>');</xsl:attribute>
					<xsl:attribute name="onmouseout">itemOut(this, '');</xsl:attribute>
					<xsl:if test="@src">
					    <img height="16px" width="50px"><xsl:attribute name="ssrc">
							<xsl:value-of select="@src"/></xsl:attribute>	
					   </img>
					</xsl:if>
					<xsl:apply-templates /><img border="0" src="/xml/images/leave-site.gif" />
				</a>
			</xsl:when>
			<xsl:when test=".[@type = 'replace']">
				<a>
					<xsl:attribute name="onclick">inlink(this, '<xsl:value-of select="@href"/>');</xsl:attribute>
					<xsl:attribute name="onmouseover">itemOver(this, '<xsl:value-of select="@href"/>');</xsl:attribute>
					<xsl:attribute name="onmouseout">itemOut(this, '');</xsl:attribute>
					<xsl:if test="@src">
					    <img height="16px" width="50px"><xsl:attribute name="ssrc">
							<xsl:value-of select="@src"/></xsl:attribute>	
					   </img>
					</xsl:if>
					<xsl:apply-templates />
				</a>
			</xsl:when>
			<xsl:when test=".[@type = 'internal']">
				<xsl:choose>
					<xsl:when test="@style">
						<a><xsl:attribute name="onclick">changeContent2('<xsl:value-of select="@href"/>', '<xsl:value-of select="@style"/>');</xsl:attribute>
							<xsl:attribute name="onmouseover">itemOver(this, '<xsl:value-of select="@href"/>');</xsl:attribute>
							<xsl:attribute name="onmouseout">itemOut(this, '');</xsl:attribute>
							<xsl:apply-templates />
						</a>
					</xsl:when>
					<xsl:otherwise>
						<a><xsl:attribute name="onclick">changeContent1('<xsl:value-of select="@href"/>');</xsl:attribute>
							<xsl:attribute name="onmouseover">itemOver(this, '<xsl:value-of select="@href"/>');</xsl:attribute>
							<xsl:attribute name="onmouseout">itemOut(this, '');</xsl:attribute>
							<xsl:if test="@src">
							    <img height="16px" width="50px"><xsl:attribute name="ssrc">
									<xsl:value-of select="@src"/></xsl:attribute>	
								</img>
							</xsl:if>
							<xsl:apply-templates />
						</a>
					</xsl:otherwise>
				</xsl:choose>
			</xsl:when>
			<xsl:when test="@remote">
				<xsl:attribute name="remote"><xsl:value-of select="@remote"/></xsl:attribute>
				<xsl:attribute name="remote-content"><xsl:value-of select="@remote-content"/></xsl:attribute>
			</xsl:when>
		</xsl:choose>
    </DIV>
</xsl:template>

<xsl:template match="globe">
	<img border="0" src="/xml/images/leave-site.gif" />
</xsl:template>
<xsl:template match="sectionTitle">
	<!--xsl:apply-templates /-->
</xsl:template>


<xsl:template match="tocSection[@type='vote']">
	<DIV CLASS="tocSecCont">
	<DIV CLASS="tocHead" onclick="fnFlash(this)">
		<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
		+ <xsl:value-of select="sectionTitle"/>
	</DIV>
	<xsl:choose>
		<xsl:when match=".[@state = 'open']">
			<DIV CLASS="tocItemHide">
				<xsl:attribute name="id">c_<xsl:value-of select="@id"/></xsl:attribute>
				<FORM style="margin: 0; padding: 0" method="POST">
					<xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute><xsl:attribute name="action"><xsl:eval>unescape(this.attributes[2].nodeValue)</xsl:eval></xsl:attribute>
					<xsl:apply-templates />
					<CENTER><INPUT type="submit" value="submit" class="tocItem" /></CENTER>
				</FORM>
			</DIV>
		</xsl:when>
		<xsl:when match=".[@state = 'closed']">
			<DIV CLASS="tocItemHide">
				<xsl:attribute name="id">c_<xsl:value-of select="@id"/></xsl:attribute>
				<FORM style="margin: 0; padding: 0" method="POST">
					<xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute><xsl:attribute name="action"><xsl:eval>unescape(this.attributes[2].nodeValue)</xsl:eval></xsl:attribute>
					<xsl:apply-templates />
					<CENTER><INPUT type="submit" value="submit" class="tocItem" /></CENTER>
				</FORM>
			</DIV>
		</xsl:when>>
	</xsl:choose>
	</DIV>
</xsl:template>
<xsl:template match="voteAnswer">
    <DIV CLASS="tocItem">
		<INPUT type="radio"><xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute><xsl:attribute name="value"><xsl:value-of select="@value"/></xsl:attribute><xsl:value-of select="text()" /></INPUT>
	</DIV>
	<!--xsl:apply-templates /-->	
</xsl:template>
<xsl:template match="result">
    <DIV CLASS="AVoteR" style="position:relative;width:100%;">
		<xsl:value-of select="text()" />
		- <xsl:value-of select="@cast"/>
	</DIV>
	<DIV CLASS="tocItem"  style="position:relative;width:80%;">
		<DIV CLASS="tocItem" >
			<xsl:attribute name="style">
				width:<xsl:value-of select="@width"/>;background-color:<xsl:value-of select="@color"/>;position:absolute;top:0;left:10;</xsl:attribute>
			<BR/>
		</DIV>
		<BR />
	</DIV>

	<!--xsl:apply-templates /-->	
</xsl:template>
<xsl:template match="outlink">
	<a class="download">
		<xsl:attribute name="target">xxxdownload</xsl:attribute>
		<xsl:attribute name="onclick">JavaScript:outlink(this, '<xsl:value-of select="@href"/>');</xsl:attribute>
		<xsl:attribute name="onmouseout">status='';</xsl:attribute>
		<xsl:apply-templates />
	</a>
</xsl:template>
<xsl:template match="download">
	<a class="download">
		<xsl:attribute name="target">xxx</xsl:attribute>
		<xsl:attribute name="onclick">JavaScript:download(this, '<xsl:value-of select="@href"/>');</xsl:attribute>
		<xsl:attribute name="onmouseover">status='<xsl:value-of select="@href"/>';</xsl:attribute>
		<xsl:attribute name="onmouseout">status='';</xsl:attribute>
		<xsl:apply-templates />
	</a>
</xsl:template>
<xsl:template match="inlink">
	<a class="download">
		<xsl:attribute name="target">xxx</xsl:attribute>
		<xsl:attribute name="onclick">JavaScript:inlink(this, '<xsl:value-of select="@href"/>');</xsl:attribute>
		<xsl:attribute name="onmouseover">status='<xsl:value-of select="@href"/>';</xsl:attribute>
		<xsl:attribute name="onmouseout">status='';</xsl:attribute>
		<xsl:apply-templates />
	</a>
</xsl:template>
<xsl:template match="changeContent">
	<a class="download"><xsl:attribute name="onclick">changeContent1('<xsl:value-of select="@href"/>');</xsl:attribute>
		<xsl:attribute name="onmouseover">itemOver(this, '<xsl:value-of select="@href"/>');</xsl:attribute>
		<xsl:attribute name="onmouseout">itemOut(this, '');</xsl:attribute>
		<xsl:apply-templates />
	</a>
</xsl:template>
<xsl:template match="code">
	<p class="code"><xsl:apply-templates /></p>
</xsl:template>
<xsl:template match="rdf:RDF">
</xsl:template>
<!--RSS-->
<xsl:template match="channel">
	<DIV CLASS="tocSecCont">
		
		<DIV CLASS="tocHead" onclick="fnFlash(this)">
			<xsl:attribute name="id"><xsl:value-of select="title"/></xsl:attribute>
			+ <xsl:value-of select="title"/>
		</DIV>
		<DIV>
			<xsl:attribute name="id">canvas</xsl:attribute>
			<DIV CLASS="Slider">
				<xsl:attribute name="sHeight">200</xsl:attribute>
				<DIV CLASS="tocItemShow">
					<xsl:attribute name="id">c_<xsl:value-of select="title"/></xsl:attribute>
					<xsl:apply-templates />
				</DIV>
			</DIV>
		</DIV>
		<DIV CLASS="tocFoot" onmousedown="mouseDown(this);">
		</DIV>
	</DIV>
</xsl:template>
<xsl:template match="channel/item">
	 <DIV CLASS="tocItem">
				<a>
					<xsl:attribute name="target">xxx</xsl:attribute>
					<xsl:attribute name="onclick">outlink(this, '<xsl:value-of select="link"/>');</xsl:attribute>
					<xsl:attribute name="onmouseover">status='<xsl:value-of select="link"/>';</xsl:attribute>
					<xsl:attribute name="onmouseout">status='';</xsl:attribute>
					<xsl:apply-templates />
				</a>
    </DIV>
</xsl:template>
<xsl:template match="channel/image">
</xsl:template>
<xsl:template match="channel/item/title">
	<br /><b><xsl:value-of select="."/></b><br /><br />
</xsl:template>
<xsl:template match="channel/item/description">
	<xsl:value-of select="."/><br />
</xsl:template>
<xsl:template match="channel/item/category">
</xsl:template>
<xsl:template match="channel/item/link">
</xsl:template>
<xsl:template match="channel/language">
</xsl:template>
<xsl:template match="channel/copyright">
</xsl:template>
<xsl:template match="channel/managingEditor">
</xsl:template>
<xsl:template match="channel/webMaster">
</xsl:template>
<xsl:template match="channel/description">
</xsl:template>
<xsl:template match="channel/link">
</xsl:template>
<xsl:template match="channel/textinput">
</xsl:template>
</xsl:stylesheet>
