<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
xmlns:str="http://www.ora.com/XSLTCookbook/namespaces/strings" extension-element-prefixes="str">
<xsl:output method="xml" version="1.0" indent="yes" cdata-section-elements="htmlfragment"/>

<xsl:variable name="spotlight1padding">
	<xsl:choose>
		<xsl:when test="/data/spotlight1margin"><xsl:value-of select="/data/spotlight1margin" /></xsl:when>
		<xsl:otherwise>10</xsl:otherwise>
	</xsl:choose>
</xsl:variable>

<xsl:variable name="templatetype"><xsl:value-of select="/data/pagetype"/></xsl:variable>
<xsl:variable name="templateCSSClass">CSS<xsl:value-of select="/data/browser/@cssmajorversion"/></xsl:variable>

<xsl:variable name="onePixelSpacerImage"><img class="spacerImage" src="/library/images/transparent.gif" alt="" width="1" height="1" /></xsl:variable>
<xsl:variable name="printerFriendly">
	<xsl:choose>
		<xsl:when test="/data/pf/text() = 'true'" >true</xsl:when>
		<xsl:otherwise>false</xsl:otherwise>
	</xsl:choose>
</xsl:variable>

<xsl:variable name="returnToNonPFPage">
	<div id="returnLink"><a href="javascript:printerFriendlyOff();">return to page</a></div>
</xsl:variable>

<xsl:variable name="goToPFPage">
	<a href="javascript:printerFriendlyOn();"><img id="pfImage"  border="0" src="/library/images/printicon.gif" alt="printer friendly page" /></a>
</xsl:variable>

<!-- outer layout table dimensions -->
<xsl:variable name="page_width" select="'744'" />
<xsl:variable name="nav_width" select="'150'" />
<xsl:variable name="main_width" select="$page_width - $nav_width" />

<!-- nav column dimensions -->
<xsl:variable name="navRegionRightPadding" select="'5'" />
<xsl:variable name="navRegionLeftPadding" select="'5'" />
<xsl:variable name="nav_switch_image_width" select="'13'" /> <!-- width of image for nav +/- or arrows  -->
<xsl:variable name="nav_menu_table_width" select="$nav_width - $navRegionRightPadding - $navRegionLeftPadding " /> <!-- width of first nav column( with +/- or arrows in it) -->
<xsl:variable name="nav_switch_td_width" select="$nav_switch_image_width" /> <!-- width of first nav column( with +/- or arrows in it) -->
<xsl:variable name="nav_menu_text_td_width" select="$nav_menu_table_width - $nav_switch_image_width" /> <!-- width of 2nd nav table column (with text in it) -->



<!-- calculations for coe home layout tables each row should add up to 594-->
<xsl:variable name="content1_width" select="'198'" />
<xsl:variable name="content2_width" select="'198'" />
<xsl:variable name="content3_width" select="'198'" />
<xsl:variable name="spotlight1_width" select="'356'" />
<xsl:variable name="spotlight2photo_width" select="'76'" />
<xsl:variable name="spotlight2_width" select="'162'" />

<xsl:variable name="layout_col1" select="$content1_width" />
<xsl:variable name="layout_col2" select="$spotlight1_width - $content1_width" />
<xsl:variable name="layout_col3" select="$content1_width + $content2_width - $layout_col1 - $layout_col2" />
<xsl:variable name="layout_col4" select="$spotlight1_width + $spotlight2photo_width - $layout_col1 - $layout_col2 - $layout_col3" />
<xsl:variable name="layout_col5" select="$spotlight2_width" />

<!-- colors -->

<xsl:variable name="white" select="'#FFFFFF'" />
<xsl:variable name="black" select="'#000000'" />

<xsl:variable name="tan" select="'#d9d9b7'" />
<xsl:variable name="tanImage" select="'d9d9b7.gif'" />
<xsl:variable name="lighttan" select="'#eeeecc'" />
<xsl:variable name="darktan" select="'#e3e3c3'" />

<xsl:variable name="darkblue" select="'#3e3f94'" />
<xsl:variable name="verydarkblue" select="'#333366'" />
<xsl:variable name="verydarkblueImage" select="'1blue.gif'" />


<xsl:variable name="lightbrown" select="'#cc9966'" />
<xsl:variable name="brown" select="'#CC6600'" />
<xsl:variable name="rust" select="'#ab5000'" />
<xsl:variable name="rustImage" select="'1orange.gif'" />
<xsl:variable name="darkbrown" select="'#993300'" />
<xsl:variable name="darkestbrown" select="'#773300'" />
<xsl:variable name="orange" select="'#FF9966'" />

<xsl:variable name="lightyellow" select="'#FFFF99'" />
<xsl:variable name="paleyellow" select="'#FFFFCC'" />
<xsl:variable name="paleyellowImage" select="'FFFFCC.gif'" />

<xsl:variable name="red1" select="'#ecf3d8'" />
<xsl:variable name="red2" select="'#CC0000'" />

<xsl:variable name="lightgrey" select="'#E3E3E3'" />
<xsl:variable name="mediumgrey" select="'#cccccc'" />
<xsl:variable name="lightblack" select="'333333'" />
<xsl:variable name="darkgrey" select="'#666666'" />
<xsl:variable name="cloudygrey" select="'#999999'" />

<xsl:variable name="fontface" select="'Arial, Helvetica, sans-serif'" />

<xsl:variable name="spotlight1backgroundcolor">
	<xsl:choose>
		<xsl:when test="/data/spotlight1backgroundcolor/text()"><xsl:value-of select="/data/spotlight1backgroundcolor" /></xsl:when>
		<xsl:otherwise>
			<xsl:choose>
				<xsl:when test="$templatetype = 'coehome'"><xsl:value-of select="$verydarkblue" /></xsl:when>
				<xsl:otherwise><xsl:value-of select="$tan" /></xsl:otherwise>
			</xsl:choose>
		</xsl:otherwise>
	</xsl:choose>
</xsl:variable>
<xsl:variable name="onload"><xsl:if test="/data/@menujs='true'">makeTreesC(); </xsl:if> MM_preloadImages('/library/images/l3logoroll.gif')</xsl:variable>

<xsl:template match="/data">
<html lang="en">
<xsl:apply-templates  select="/data" mode="head" />
<body>
<xsl:call-template name="bodyAttributes" />

<xsl:choose>

<!--         REDIRECT PAGES                              -->

	<xsl:when test="$templatetype = 'redirect'" >
		<xsl:variable name="redirect_url"><xsl:value-of select="/data/divs/div[@class='maincontent']/text()" /></xsl:variable>
		<html><head>
		<meta http-equiv="REFRESH" CONTENT="10;  URL={$redirect_url}" ></meta>
		<meta http-equiv="Content-Type" CONTENT="text/html; charset=iso-8859-1"></meta>
		<title>Redirect</title>
		</head>
		<body>
		<h1>Redirect</h1>
		<p>This page has been replace by <a href="{$redirect_url}"><xsl:value-of select="$redirect_url" /></a></p>
		<p>You will automatically be redirected to <xsl:value-of select="$redirect_url" />. 
		If you are not redirected, simply follow the	above link.</p>
		</body></html>
	</xsl:when>

<!--         PRINTER FRIENDLY PAGES                              -->

	<xsl:when test="$printerFriendly = 'true'" >
		<xsl:if test="$templatetype = 'coehome' or $templatetype = 'unithome'"><!-- need to replace banner image with a title for home pages -->
		<div id="heading"><h1><xsl:value-of select="/data/unitfullname" /></h1></div>
		</xsl:if>
		<xsl:choose>
			<xsl:when test="$templatetype = 'coehome'">
				<xsl:copy-of select="divs/div[@id='highlight']" />
				<xsl:copy-of select="divs/div[@id='testimonialphoto']" />
				<xsl:copy-of select="divs/div[@id='testimonial']" />
				<xsl:copy-of select="divs/div[@id='content1']" />
				<xsl:copy-of select="divs/div[@id='content2']" />
				<xsl:copy-of select="divs/div[@id='content3']" />
			</xsl:when>
			<xsl:when test="$templatetype = 'unithome'">
				<xsl:copy-of select="divs/div[@id='spotlight1']" />
				<xsl:copy-of select="divs/div[@id='spotlight2photo']" />
				<xsl:copy-of select="divs/div[@id='spotlight2']" />
				<xsl:copy-of select="divs/div[@id='content1']" />
				<xsl:copy-of select="divs/div[@id='content2']" />
				<xsl:copy-of select="divs/div[@id='content3']" />
			</xsl:when>
			<xsl:when test="$templatetype = 'standardsidebar'">
				<xsl:copy-of select="divs/div[@id='maincontent']" />
				<xsl:copy-of select="divs/div[@id='sidebar']" />
			</xsl:when>
			<xsl:when test="$templatetype = 'standard' or $templatetype = 'error'">
				<xsl:copy-of select="divs/div[@id='maincontent']" />
			</xsl:when>
			<xsl:otherwise >
				<h1>No Template Type Specified.  Template type = <xsl:value-of select="$templatetype" /></h1>
			</xsl:otherwise>
		</xsl:choose>
		<xsl:copy-of select="/data/div[@id='footer']" />
		<div id="unitCredits" ><xsl:apply-templates select="/data" mode="unitcredits" /></div>
		<xsl:copy-of select="$returnToNonPFPage" />	
	</xsl:when>  <!-- end choose type for printer friendly template:  coehome, unithome, standard, standardsidebar -->

	<!--   PAGES  NON CSS BROWSERS                           -->

	<xsl:when test="$templateCSSClass = 'CSS0'" >
		<xsl:choose>
			<xsl:when test="$templatetype = 'coehome'">
				<table class="layout" cellpadding="0" cellspacing="0" border="0"  ><tr class="layout" ><td class="layout">	<!-- table for banner images on home page -->
				<table id="topLayoutTable" class="layout" border="0" align="left" cellpadding="0" cellspacing="0">
				  <tr class="layout"> 
				    <td class="layout" height="81"><img src="/library/images/home/photo.jpg" alt="" name="photo"  height="81" border="0" align="top" /></td>
				  </tr>
				  <tr class="layout"> 
				    <td class="layout" height="73" ><img name="colled" src="/library/images/home/colled.gif" width="705" height="73" border="0" alt="" /><a href="http://www.uiuc.edu/" onmouseover="MM_swapImage('logo','','/library/images/logoroll.gif',1)" onmouseout="MM_swapImgRestore()"><img name="logo" src="/library/images/home/logo.gif" width="28" height="73" border="0" alt="university of illinois" /></a><a href="#content"><img name="stretch" src="/library/images/home/stretch.gif" width="11" height="73" border="0" alt="skip navigation" /></a></td>
				  </tr>
				</table></td></tr><tr class="layout" ><td class="layout" >
					<xsl:apply-templates select="/data" mode="homePageContentCSS0" />
				</td></tr></table>
			</xsl:when>
			<xsl:when test="$templatetype = 'unithome'">

				<table class="layout" id="outerLayoutTable"   border="0" cellspacing="0" cellpadding="0"><tr class="layout" ><td class="layout">
					<table id="topLayoutTable" class="layout" border="0" align="left" cellpadding="0" cellspacing="0" width="{$page_width}">
					  <tr class="layout"> 
					  	<td class="layout" width="577" height="76" rowspan="4" valign="top"><a href="{/data/uniturl}"><img src="{/data/bannertitleimage}" border="0" alt="{/data/bannertitleimagealt}" width="577" height="63" /></a><br clear="left" /><a href="/index.html"><img border="0"  width="577" height="13" src="/library/images/titles/coebannerstrip.gif" alt="College of Education"  /></a></td>
					     <td class="layout" width="10" bgcolor="{$tan}"><a href="#content"><img src="/library/images/tantop.gif" alt="skip to content" width="8" height="17" border="0" /></a></td>
					     <td class="layout" width="103" rowspan="4" align="left" valign="top"><img src="{/data/bannersmallimage}" alt="{/data/bannersmallimagealt}" width="103" height="76" /></td>
					     <td class="layout" rowspan="4" valign="top" align="left" width="16"><img src="/library/images/rightedge.gif" alt="" width="20" height="76" /></td>
					     <td class="layout" width="26" rowspan="4" align="left" valign="top" ><a href="http://www.uiuc.edu" onmouseover="MM_swapImage('Image1','','/library/images/l3logoroll.gif',1)" onmouseout="MM_swapImgRestore()"><img src="/library/images/logo.gif" alt="illinois home" name="Image1" width="26" height="76" border="0" id="Image1" /></a></td>
					     <td class="layout" width="10" rowspan="4" align="left" valign="top"><img name="rightedge" src="/library/images/rightedge.gif" width="10" height="76" border="0" alt="" /></td>
					  </tr>
					   <tr class="layout">
					     <td class="layout" valign="top" height="37" width="10" align="left" bgcolor="{$darkblue}"><img src="/library/images/bluetop.gif" name="spacebluetop" width="8" height="37" alt="" /></td>
					   </tr>
					   <tr class="layout">
					     <td class="layout" valign="top" height="1" width="10" align="left" bgcolor="{$brown}"><img src="/library/images/orangeline.gif" width="8" height="1" alt="" /></td>
					   </tr>
					   <tr class="layout">
					     <td class="layout" valign="top" width="10" height="21" align="left" bgcolor="{$darkblue}"><img src="/library/images/bluebtm.gif" width="8" height="21" alt="" /></td>
					   </tr>
				</table></td></tr><tr class="layout" ><td class="layout" >
					<xsl:apply-templates select="/data" mode="homePageContentCSS0" />
				</td></tr></table>
			</xsl:when>

			<xsl:when test="$templatetype = 'standardsidebar'">
				<xsl:apply-templates  select="/data" mode="standard_and_standard_sidebar_banner_table_css0" />
				<table id="bottomLayoutTable"  class="layout"  width="101%" border="0" cellspacing="0" cellpadding="0">
				  <tr class="layout">
						<td class="layout" width="{$nav_width}" height="100%" valign="top" bgcolor="{$darkblue}"><xsl:apply-templates select="/data" mode="nav_column_css0" /></td>
				    <td class="layout" id="maincontentTD"  rowspan="1" colspan="1"   bgcolor="{$white}" >
							<table class="mmhide_layout" width="100%" cellpadding="0" cellspacing="0" border="0" >
								<tr>
									<td><img src="/library/images/transparent.gif" height="1" width="20" alt="" /><font face="{$fontface}" style="text-decoration: none; line-height: 120%; font-size: 80%;" color="{$darkgrey}"><xsl:copy-of select="span[@class='pathbar']" /></font></td>
									<td width="20%" id="sidebarTD" class="mmhide_layout"><div class="pathbar" style="text-align: right; padding-right: 60px;"><xsl:copy-of select="$goToPFPage" /></div></td>
								</tr>
								<tr><td colspan="2" bgcolor="{$rust}" height="1"><img src="/library/images/transparent.gif" height="1" width="50" alt="" /></td></tr>
								<tr><td bgcolor="{$white}"><img src="/library/images/transparent.gif" height="20"  alt="" /></td><td  bgcolor="{$darktan}" ><img src="/library/images/transparent.gif" height="20"  alt="" /></td></tr>
								<tr>
									<td align="left" valign="top">
										<table class="layout" width="100%" border="0" cellpadding="0" cellspacing="0">
											<tr>
												<td colspan="3"><img src="/library/images/transparent.gif" height="1"  alt="" /></td>
											</tr>
											<tr>
												<td><img src="/library/images/transparent.gif" width="20"  height="1" alt="" /></td>
												<td><xsl:apply-templates select="divs/div[@id='maincontent']" mode="standardpage" /><xsl:copy-of select="div[@id='footer']" /></td>
												<td><img src="/library/images/transparent.gif" width="20"  height="1" alt="" /></td>
											</tr>
										</table>
									</td>
									<td id="sidebarTD" width="20%" align="left" valign="top" bgcolor="{$darktan}">
										<table class="layout" width="100%" border="0" cellpadding="0" cellspacing="0">
											<tr>
												<td colspan="3"><img src="/library/images/transparent.gif" height="20"  alt="" /></td>
											</tr>
											<tr>
												<td><img src="/library/images/transparent.gif" width="10"  height="1" alt="" /></td>
												<td><font size="-1"><xsl:apply-templates select="divs/div[@id='sidebar']" mode="standardpage" /></font></td>
												<td><img src="/library/images/transparent.gif" width="10"  height="1" alt="" /></td>
											</tr>
										</table>
									</td>
								</tr>
							</table>
						</td>		 		
					</tr>
				</table>
			</xsl:when>

			<xsl:when test="$templatetype = 'standard' or $templatetype = 'error'">
				<xsl:apply-templates  select="/data" mode="standard_and_standard_sidebar_banner_table_css0" />
				<table id="bottomLayoutTable" class="layout" width="101%" border="0" align="left" leftmargin="0" cellspacing="0" cellpadding="0">
				  <tr class="layout"> 
						<td class="layout" width="{$nav_width}" height="100%" valign="top"><xsl:apply-templates select="/data" mode="nav_column_css0" /></td>
				    <td class="layout"  width="90%" rowspan="1" valign="top">
							<table class="mmhide_layout" width="100%" cellpadding="0" cellspacing="0" >
							<tr class="mmhide_layout">
								<td width="80%" ><img src="/library/images/transparent.gif" height="1" width="20" alt="" /><font face="{$fontface}" style="text-decoration: none; line-height: 120%; font-size: 80%;" color="{$darkgrey}"><xsl:copy-of select="span[@class='pathbar']" /></font></td>
								<td width="20%" id="sidebarTD" class="mmhide_layout"><div class="pathbar" style="text-align: right; padding-right: 60px;"><xsl:copy-of select="$goToPFPage" /></div></td>
							</tr>
							<tr><td colspan="2" bgcolor="{$rust}" height="1" width="100%"><img src="/library/images/transparent.gif" height="1" width="1" alt="" /></td></tr></table>
				      <table class="layout" width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr><td colspan="3"><img src="/library/images/transparent.gif" height="20"  alt="" /></td></tr>
				        <tr class="layout"> 
									<td><img src="/library/images/transparent.gif" height="1" width="20" alt="" /></td>
				          <td class="layout" id="maincontentTD" >
										<font face="{$fontface}" ><xsl:apply-templates select="divs/div[@id='maincontent']" mode="standardpage" />
										<img class="spacerImage" src="/library/images/transparent.gif" width="{$main_width}" height="1" alt="" />
										<font size="-1"><xsl:copy-of select="/data/div[@id='footer']" /></font>
										</font>
									</td>
								<td><img src="/library/images/transparent.gif" height="1" width="20" alt="" /></td>
				        </tr>
				      </table>
				    </td>
				  </tr>
				</table>
			</xsl:when>

			<xsl:otherwise >
				<h1>No Template Type Specified.  Template type = <xsl:value-of select="$templatetype" /></h1>
			</xsl:otherwise>
		</xsl:choose>	
	</xsl:when> <!-- end choose type of css0 (no css) template:  coehome, unithome, standard, standardsidebar -->

	<!--   PAGES  CSS1 AND CSS2 BROWSERS.  May make CSS2 only templates in the future    -->

	<xsl:otherwise><!-- default to css1 support --> 
		<xsl:choose>
			<xsl:when test="$templatetype = 'coehome'">
				<table class="layout" id="outerLayoutTable"  border="0" cellspacing="0" cellpadding="0"><tr class="layout" ><td class="layout"><table id="topLayoutTable" class="layout" border="0" align="left" cellpadding="0" cellspacing="0">
				  <tr class="layout"> 
				    <td class="layout" height="81"><img src="/library/images/home/photo.jpg" alt="" name="photo"  height="81" border="0" align="top" /></td>
				  </tr>
				  <tr class="layout"> 
				    <td class="layout" height="73" ><img name="colled" src="/library/images/home/colled.gif" width="705" height="73" border="0" alt="" /><a href="http://www.uiuc.edu/" onmouseover="MM_swapImage('logo','','/library/images/logoroll.gif',1)" onmouseout="MM_swapImgRestore()"><img name="logo" src="/library/images/home/logo.gif" width="28" height="73" border="0" alt="university of illinois" /></a><a href="#content"><img name="stretch" src="/library/images/home/stretch.gif" width="11" height="73" border="0" alt="skip navigation" /></a></td>
				  </tr>
				</table></td></tr><tr class="layout" ><td class="layout" >
					<xsl:apply-templates select="/data" mode="homePageContentCSS1" />
				</td></tr></table>
			</xsl:when>
			<xsl:when test="$templatetype = 'unithome'">
				<table class="layout" id="outerLayoutTable"   border="0" cellspacing="0" cellpadding="0"><tr class="layout" ><td class="layout">
					<table id="topLayoutTable" class="layout" border="0" align="left" cellpadding="0" cellspacing="0" width="{$page_width}">
					  <tr class="layout"> 
					  	<td class="layout" width="577" height="76" rowspan="4" valign="top"><a href="{/data/uniturl}"><img src="{/data/bannertitleimage}" alt="{/data/bannertitleimagealt}" width="577" height="63" /></a><br clear="left" /><a href="/index.html"><img border="0"  width="577" height="13" src="/library/images/titles/coebannerstrip.gif" alt="College of Education"  /></a></td>
					     <td class="layout" width="10" bgcolor="{$tan}"><a href="#content"><img src="/library/images/tantop.gif" alt="skip to content" width="8" height="17" border="0" /></a></td>
					     <td class="layout" width="103" rowspan="4" align="left" valign="top"><img src="{/data/bannersmallimage}" alt="{/data/bannersmallimagealt}" width="103" height="76" /></td>
					     <td class="layout" rowspan="4" valign="top" align="left" width="16"><img src="/library/images/rightedge.gif" alt="" width="20" height="76" /></td>
					     <td class="layout" width="26" rowspan="4" align="left" valign="top" ><a href="http://www.uiuc.edu" onmouseover="MM_swapImage('Image1','','/library/images/l3logoroll.gif',1)" onmouseout="MM_swapImgRestore()"><img src="/library/images/logo.gif" alt="illinois home" name="Image1" width="26" height="76" border="0" id="Image1" /></a></td>
					     <td class="layout" width="10" rowspan="4" align="left" valign="top"><img name="rightedge" src="/library/images/rightedge.gif" width="10" height="76" border="0" alt="" /></td>
					  </tr>
					   <tr class="layout">
					     <td class="layout" valign="top" height="37" width="10" align="left" bgcolor="{$darkblue}"><img src="/library/images/bluetop.gif" name="spacebluetop" width="8" height="37" alt="" /></td>
					   </tr>
					   <tr class="layout">
					     <td class="layout" valign="top" height="1" width="10" align="left" bgcolor="{$brown}"><img src="/library/images/orangeline.gif" width="8" height="1" alt="" /></td>
					   </tr>
					   <tr class="layout">
					     <td class="layout" valign="top" width="10" height="21" align="left" bgcolor="{$darkblue}"><img src="/library/images/bluebtm.gif" width="8" height="21" alt="" /></td>
					   </tr>
					</table></td></tr><tr class="layout" ><td class="layout" >
						<xsl:apply-templates select="/data" mode="homePageContentCSS1" />
					</td></tr></table>
			</xsl:when>

			<xsl:when test="$templatetype = 'standardsidebar'">
				<xsl:apply-templates  select="/data" mode="standard_and_standard_sidebar_banner_table" />
				<table id="bottomLayoutTable"  class="layout"  width="101%" border="0" cellspacing="0" cellpadding="0">
				  <tr class="layout">
						<td class="layout" id="navTD" width="{$nav_width}"  bgcolor="{$darkblue}" ><xsl:apply-templates select="/data" mode="nav_column" /></td>
				    <td class="layout" id="maincontentTD"  rowspan="1" colspan="1"   bgcolor="{$white}" >
								<div id="pathbar" class="pathbar"><xsl:copy-of select="span[@class='pathbar']" /></div>
								<xsl:copy-of select="divs/div[@id='maincontent']" />
								<xsl:copy-of select="div[@id='footer']" />
						</td>		 		
						<td class="layout"  id="sidebarTD" width="20%" align="left" bgcolor="{$darktan}">
							<div class="pathbar" style="text-align: right; padding-right: 60px"><xsl:copy-of select="$goToPFPage" /></div>
							<xsl:copy-of select="divs/div[@id='sidebar']" />
						</td>
					</tr>
				</table>
			</xsl:when>

			<xsl:when test="$templatetype = 'standard' or $templatetype = 'error' ">
				<xsl:apply-templates  select="/data" mode="standard_and_standard_sidebar_banner_table" />
				<table id="bottomLayoutTable" class="layout" width="101%" border="0" cellspacing="0" cellpadding="0">
				  <tr class="layout"> 
						<td bgcolor="{$darkblue}" class="layout" width="{$nav_width}" height="100%" valign="top"><xsl:apply-templates select="/data" mode="nav_column" /><table border="0" bgcolor="{$darkblue}" height="100%" width="150" cellpadding="0" cellspacing="0"><tr><td valign="bottom">&#160;</td></tr></table></td>
				    <td class="layout"  width="90%" rowspan="1" valign="top">
							<table class="mmhide_layout" width="100%" cellpadding="0" cellspacing="0" ><tr class="mmhide_layout">
								<td width="80%" ><div id="pathbar" class="pathbar" ><xsl:copy-of select="span[@class='pathbar']" /></div></td>
								<td width="20%" id="sidebarTD" class="mmhide_layout"><div class="pathbar" style="text-align: right; padding-right: 60px;"><xsl:copy-of select="$goToPFPage" /></div></td>
							</tr></table>
				      <table class="layout" width="100%" border="0" cellpadding="0" cellspacing="0">
				        <tr class="layout"> 
				          <td class="layout" id="maincontentTD" >
										<xsl:choose>
											<xsl:when test="/data/error = 'true'">
												<div id="maincontent" class="content"><xsl:apply-templates select="/data" mode="error" /></div>
											</xsl:when>
											<xsl:otherwise>
												<xsl:copy-of select="divs/div[@id='maincontent']" />
											</xsl:otherwise>
										</xsl:choose>
										<img class="spacerImage" src="/library/images/transparent.gif" width="{$main_width}" height="1" alt="" />
										<xsl:copy-of select="/data/div[@id='footer']" />
									</td>
				        </tr>
				      </table>
				    </td>
				  </tr>
				</table>
			</xsl:when>

			<xsl:otherwise><h1>No Template Type Specified.  Template type = <xsl:value-of select="$templatetype" /></h1></xsl:otherwise>

		</xsl:choose>
	</xsl:otherwise> <!-- end choose type of css1 template:  coehome, unithome, standard, standardsidebar -->
</xsl:choose> <!-- end choose mode:  printerfriendly, css0, css1, css2 -->
<xsl:apply-templates select="/data" mode="validate" />
</body>
</html>
</xsl:template>


<!--   HEAD  -->

<xsl:template match="/data" mode="head">
	<head>
		<meta name="keywords" content="{/data/metas/meta[@name='Keywords']/@content}" />
		<meta name="description" content="{/data/metas/meta[@name='Description']/@content}" />
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
		<title><xsl:value-of select="title"/></title>
		<xsl:if test="$templateCSSClass != 'CSS0' "><link href="/library/css/common.css?mmhide=false" rel="stylesheet" type="text/css" /></xsl:if>
		<script src="/pm/filtermm.asp?file=/library/javascript/edwebs.js" language="JavaScript" type="text/JavaScript"></script>
		<meta name="templatetype" content="{$templatetype}" />
		<meta name="templatefilelocation" content="{/data/pagetemplatefilepath}\{/data/metas/meta[@name='pagetype']/@content}.xslt" />
		<meta name="contentfilelocation" content="{/data/fullfilename}" />
		<meta name="sitedefinitionfile" content="{/data/siteDefinitionFile}" />
		<meta name="PreIISRewriteURL" content="{/data/DNS}{/data/PreIISRewriteURL}" />
		<meta name="PostIISRewriteURL" content="{/data/DNS}{/data/url}" />
		<meta name="browser" content="{/data/browser/@browser}" />
		<meta name="browsermajor" content="{/data/browser/@browsermajor}" />
		<meta name="browserminor" content="{/data/browser/@browserminor}" />
		<meta name="templateClass" content="{$templateCSSClass}"/>
		<xsl:if test="/data/basehref/text()"><base href="http://{/data/DNS}{/data/basehref/text()}" /></xsl:if>
	
	
		<script type="text/JavaScript">
				<xsl:if test="$printerFriendly = 'false'" >
					var menuid = '<xsl:value-of select="/data/menuid/text()" />';
					var submenus; // array to store submenus in.
				</xsl:if>
				var allcookies = document.cookie;
				var domain = '<xsl:value-of select="/data/DNS/text()" />';
		</script>
	
		<xsl:for-each select="//headcontent/*"><xsl:copy-of select="." /></xsl:for-each>
	</head>
</xsl:template>

<!-- BODY ATTRIBUTES -->

<xsl:template name="bodyAttributes">
	<xsl:attribute name="id"><xsl:value-of select="$templatetype" /></xsl:attribute>
	<xsl:choose>
		<xsl:when test="$templatetype = 'coehome' or $templatetype = 'unithome'" >
			<xsl:attribute name="class">mmhide_home</xsl:attribute>
			<xsl:attribute name="bgcolor"><xsl:value-of select="$verydarkblue" /></xsl:attribute>
			<xsl:attribute name="leftmargin"><xsl:value-of select="'0'" /></xsl:attribute>
			<xsl:attribute name="topmargin"><xsl:value-of select="'0'" /></xsl:attribute>
			<xsl:attribute name="marginwidth"><xsl:value-of select="'0'" /></xsl:attribute>
			<xsl:attribute name="marginheight"><xsl:value-of select="'0'" /></xsl:attribute>
		</xsl:when>
		<xsl:otherwise>
			<xsl:attribute name="class">mmhide_standard</xsl:attribute>
			<xsl:attribute name="bgcolor"><xsl:value-of select="$white" /></xsl:attribute>
			<xsl:attribute name="text"><xsl:value-of select="$black" /></xsl:attribute>
		</xsl:otherwise>
	</xsl:choose>
	<xsl:choose>
		<xsl:when  test="$printerFriendly = 'true'">
			<xsl:attribute name="class" >printerFriendly</xsl:attribute>
			<xsl:attribute name="onunload" >printerFriendlyOff();</xsl:attribute>
			<xsl:attribute name="bgcolor" ><xsl:value-of select="$white" /></xsl:attribute>
		</xsl:when>
		<xsl:otherwise>
			<xsl:attribute name="onload" ><xsl:value-of select="$onload" /></xsl:attribute>
		</xsl:otherwise>
	</xsl:choose>
	<xsl:if test="$templateCSSClass = 'CSS0'" ><!-- CSS1 and CSS2 don't need these attributes defined since they are applied via css -->
			<xsl:attribute name="topmargin" >0</xsl:attribute>
			<xsl:attribute name="leftmargin" >0</xsl:attribute>
			<xsl:attribute name="marginwidth" >0</xsl:attribute>
			<xsl:attribute name="marginheight" >0</xsl:attribute>
	<xsl:choose>
		<xsl:when test="$templatetype = 'coehome' or $templatetype = 'unithome'" >
			<xsl:attribute name="alink"><xsl:value-of select="$white" /></xsl:attribute>
			<xsl:attribute name="link" ><xsl:value-of select="$lightyellow" /></xsl:attribute>
			<xsl:attribute name="text" ><xsl:value-of select="$lightgrey" /></xsl:attribute>
			<xsl:attribute name="vlink" ><xsl:value-of select="$lightyellow" /></xsl:attribute>
		</xsl:when>
		<xsl:otherwise>
			<xsl:attribute name="text" ><xsl:value-of select="$black" /></xsl:attribute>
		</xsl:otherwise>
	</xsl:choose>
	</xsl:if>
</xsl:template>

<!-- banner table for standard and standard sidebar pages -->

<xsl:template match="/data" mode="standard_and_standard_sidebar_banner_table">
<table class="layout" id="topLayoutTable" bgcolor="{$white}" border="0" cellpadding="0" cellspacing="0" width="101%">
<tr class="layout" >
	<td class="layout" rowspan="4"><a href="{/data/uniturl}"><img border="0" src="{/data/bannertitleimage}" alt="{/data/bannertitleimagealt}"  /></a><br clear="left" /><a href="/index.html"><img border="0" src="/library/images/titles/coebannerstrip.gif" alt="College of Education"  /></a></td>
	<td class="layout" width="50%" bgcolor="#d9d9b7"><a href="#content"><img src="/library/images/tantop.gif" alt="skip to content" width="100%" height="17" border="0" /></a></td>
	<td class="layout" rowspan="4" align="left"><img src="{/data/bannersmallimage}" alt="{/data/bannersmallimagealt}" /></td>
    <td rowspan="4" border="2" align="left" width="16"><img src="/library/images/rightedge.gif" alt="" width="16" height="76" /></td>
	<td class="layout" rowspan="4" align="left"><a href="http://www.uiuc.edu" onmouseover="MM_swapImage('Image1','','/library/images/l3logoroll.gif',1)" onmouseout="MM_swapImgRestore()"><img src="/library/images/logo.gif" alt="illinois homepage" name="Image1" border="0" id="Image1" /></a></td>
	<td class="layout" width="50%" rowspan="4" align="left"><img name="rightedge" src="/library/images/rightedge.gif" width="100%" height="76" border="0" alt="" /></td>
</tr>
<tr class="layout">
	<td class="layout" height="37" width="50%" align="left" bgcolor="{$darkblue}"><img class="spacerImage" src="/library/images/bluetop.gif" name="spacebluetop" width="100%" height="37" alt="" /></td>
</tr>
<tr class="layout">
	<td class="layout" height="1" width="50%" align="left" bgcolor="{$brown}"><img class="spacerImage" src="/library/images/orangeline.gif" width="100%" height="1" alt="" /></td>
</tr>
<tr class="layout">
	<td class="layout" width="70%" height="21" align="left" bgcolor="{$darkblue}"><img class="spacerImage" src="/library/images/bluebtm.gif" width="100%" height="21" alt="" /></td>
</tr>
</table>
</xsl:template>

<xsl:template match="/data" mode="standard_and_standard_sidebar_banner_table_css0">
<table class="layout" id="topLayoutTable" bgcolor="{$white}" border="0" valign="top" cellpadding="0" cellspacing="0" width="101%">
<tr class="layout" >
	<td class="layout" rowspan="4"><a href="{/data/uniturl}"><img border="0" src="{/data/bannertitleimage}" alt="{/data/bannertitleimagealt}"  /></a><br clear="left" /><a href="/index.html"><img border="0" src="/library/images/titles/coebannerstrip.gif" alt="College of Education"  /></a></td>
	<td class="layout" width="50%" bgcolor="#d9d9b7"><a href="#content"><img src="/library/images/tantop.gif" alt="skip to content" width="100%" height="17" border="0" /></a></td>
	<td class="layout" rowspan="4" align="left"><img src="{/data/bannersmallimage}" alt="{/data/bannersmallimagealt}" /></td>
    <td rowspan="4" border="2" align="left" width="16"><img src="/library/images/rightedge.gif" alt="" width="16" height="76" /></td>
	<td class="layout" rowspan="4" align="left"><a href="http://www.uiuc.edu" onmouseover="MM_swapImage('Image1','','/library/images/l3logoroll.gif',1)" onmouseout="MM_swapImgRestore()"><img src="/library/images/logo.gif" alt="illinois homepage" name="Image1" border="0" id="Image1" /></a></td>
	<td class="layout" width="50%" rowspan="4" align="left"><img name="rightedge" src="/library/images/rightedge.gif" width="100%" height="76" border="0" alt="" /></td>
</tr>
<tr class="layout">
	<td class="layout" height="37" width="50%" align="left" bgcolor="{$darkblue}"><img class="spacerImage" src="/library/images/bluetop.gif" name="spacebluetop" width="100%" height="37" alt="" /></td>
</tr>
<tr class="layout">
	<td class="layout" height="1" width="50%" align="left" bgcolor="{$brown}"><img class="spacerImage" src="/library/images/orangeline.gif" width="100%" height="1" alt="" /></td>
</tr>
<tr class="layout">
	<td class="layout" width="70%" height="21" align="left" bgcolor="{$darkblue}"><img class="spacerImage" src="/library/images/bluebtm.gif" width="100%" height="21" alt="" /></td>
</tr>
</table>
</xsl:template>

<!-- nav column -->

<xsl:template match="/data" mode="nav_column">
	<div id="nav">
		<div id="menutree"><xsl:apply-templates select="/data/leftmenu/div[@id='menutree']/ul/li" /></div>
		<div id="siteMapFindPeople">
			<xsl:if test="/data/pagetype != 'coehome'"><div><a href="/">College of Education</a></div></xsl:if>
	    <div><a href="/sitemap">Site map</a></div>
	    <div><a href="/fsd">Find People</a></div>
		</div>
		<div id="search"><xsl:apply-templates select="/data" mode="searchsidebar" /></div> 
		<div id="unitCredits" ><xsl:apply-templates select="/data" mode="unitcredits" /></div>
	<!--	<div><img class="spacerImage" src="/library/images/white.gif" width="150" height="1" alt="" /></div> -->
	</div>	 
</xsl:template>

<xsl:template match="/data" mode="nav_column_css0">
	<xsl:variable name="TenPixSpacerCell"><td><img src="/library/images/transparent.gif" width="10" height="1" /></td></xsl:variable>
	<xsl:variable name="FifteenPixSpacerCell"><td><img src="/library/images/transparent.gif" width="15" height="1" /></td></xsl:variable>
	<xsl:variable name="TwentyPixSpacerCell"><td><img src="/library/images/transparent.gif" width="20" height="1" /></td></xsl:variable>
	<table border="0" cellpadding="0" cellspacing="0" width="{$nav_width}" bgcolor="{$darktan}" valign="top" align="left" >
		<tr bgcolor="{$darktan}" ><xsl:copy-of select="$TenPixSpacerCell" /><td><table bgcolor="{$darktan}" border="0" cellpadding="0" cellspacing="0" width="{$nav_width -20}"><xsl:apply-templates select="/data/leftmenu/div[@id='menutree']/ul/li" mode="css0" /></table></td><xsl:copy-of select="$TenPixSpacerCell" /></tr> 
		<tr bgcolor="{$darktan}" ><td colspan="3" bgcolor="{$darktan}"><img src="/library/images/transparent.gif" width="1" height="15" /></td></tr> 

		<tr bgcolor="{$lighttan}">
			<xsl:copy-of select="$TenPixSpacerCell" />
			<td>
				<img class="spacerImage" src="/library/images/transparent.gif" width="1" height="10" alt="" /><br clear="left"/>
				<xsl:if test="/data/pagetype != 'coehome'"><br /><a href="/"><b><font face="{$fontface}" size="-1" color="#000000">College of Education</font></b></a><br clear="left" /><img class="spacerImage" src="/library/images/transparent.gif" width="40" height="10" alt="" /><br clear="left" /></xsl:if>
			  <a href="/sitemap" ><b><font face="{$fontface}" size="-1" color="#000000">Site map</font></b></a><br clear="left"/>
				<img class="spacerImage" src="/library/images/transparent.gif" width="1" height="10" alt="" /><br clear="left"/>
				<a href="/fsd"><b><font face="{$fontface}" size="-1" color="#000000">Find People</font></b></a><br clear="left"/>
				<img class="spacerImage" src="/library/images/transparent.gif" width="1" height="10" alt="" /><br clear="left"/>
			</td>
			<xsl:copy-of select="$TenPixSpacerCell" />
		</tr>
	
		<tr bgcolor="{$darktan}">
			<xsl:copy-of select="$TenPixSpacerCell" />
			<td><img class="spacerImage" src="/library/images/transparent.gif" width="1" height="1" alt="" /><br clear="left"/><xsl:apply-templates select="/data" mode="searchsidebar_css0" /></td>
			<xsl:copy-of select="$TenPixSpacerCell" />
		</tr>

		<tr>
			<xsl:attribute name="bgcolor">
			<xsl:choose>
				<xsl:when test="/data/pagetype != 'coehome' and /data/pagetype != 'unithome'"><xsl:value-of select="$darkblue" /></xsl:when>
				<xsl:otherwise><xsl:value-of select="$verydarkblue" /></xsl:otherwise>
			</xsl:choose>
			</xsl:attribute>
			<td colspan="3"><table border="0" cellpadding="5" cellspacing="3"><tr><td>
				<img class="spacerImage" src="/library/images/transparent.gif" width="1" height="20" alt="" /><br clear="left"/>
				<font face="{$fontface}" size="-2" color="#FFFFFF"><xsl:apply-templates select="/data" mode="unitcredits_css0" /></font>
				</td></tr></table>
			</td>
		</tr>
	</table>

</xsl:template>
<!-- search form  -->

<xsl:template match="/data" mode="searchsidebar">
	<form method="get" name="gs" action="http://www.google.com/u/uiuced">
					<label for="search"><a name="search"></a>
						<input type="hidden" name="h1" value="en" />
						<input type="text" name="q" size="10" value="Search {/data/unitveryshortname}" onfocus="this.value='';" /><input type="submit" name="btnG" value="go" /></label>
						<input type="hidden" name="hq" value="inurl:www.ed.uiuc.edu{/data/searchpagelimiturl}" />  <!-- {/data/rooturlcname} -->
	</form>	
</xsl:template>

<xsl:template match="/data" mode="searchsidebar_css0">
	<form method="get" name="gs" action="http://www.google.com/u/uiuced">
					<label for="search"><a name="search"></a>
						<input type="hidden" name="h1" value="en" />
						<font face="{$fontface}" color="#FFFFFF"><input type="text" name="q" size="4" value="Search {/data/unitveryshortname}" onfocus="this.value='';" /></font><font face="{$fontface}" size="-1" color="#FFFFFF">&#160;<input type="submit" name="btnG" value="go" /></font></label>
						<input type="hidden" name="hq" value="inurl:www.ed.uiuc.edu{/data/searchpagelimiturl}" />
	</form>	
</xsl:template>

<!-- unit credits  -->

<xsl:template match="/data" mode="unitcredits">
	<xsl:choose>
		<xsl:when test="/data/pagetype = 'coehome'">
			<div>College of Education<br/><xsl:value-of select="/data/unitphone" /> phone</div>
			<div><xsl:value-of select="/data/unitfax" /> fax</div>
			<br/>
			<div>To learn more about the programs or people highlighted on our web site, please contact the 
			<a href="mailto:csharris@uiuc.edu">College of Education Communications Office</a></div>
		</xsl:when>
		<xsl:otherwise>
			<div><a><xsl:attribute name="href"><xsl:value-of select="/data/uniturl" /></xsl:attribute><xsl:value-of select="/data/unitname" /></a></div>
			<xsl:choose>
				<xsl:when test="/data/unitaddress1/text() or /data/unitaddress2/text() or /data/unitaddress3/text()">
					<xsl:if test="/data/unitaddress1/text()"><div><xsl:value-of select="/data/unitaddress1" /></div></xsl:if>
					<xsl:if test="/data/unitaddress2/text()"><div><xsl:value-of select="/data/unitaddress2" /></div></xsl:if>
					<xsl:if test="/data/unitaddress3/text()"><div><xsl:value-of select="/data/unitaddress3" /></div></xsl:if>
				</xsl:when>
				<xsl:otherwise>
					<div><xsl:value-of select="/data/unitaddress" /></div>
				</xsl:otherwise>
			</xsl:choose>
			<div><xsl:value-of select="/data/unitphone" /></div>
			<div><xsl:value-of select="/data/unitfax" /></div>
			<div><a href="mailto:{/data/unitemail}"><xsl:value-of select="/data/unitemail" /></a></div>
		</xsl:otherwise>
	</xsl:choose>
</xsl:template>


<xsl:template match="/data" mode="unitcredits_css0">
	<xsl:choose>
		<xsl:when test="/data/pagetype = 'coehome'">
			College of Education<br />
			<xsl:value-of select="/data/unitphone" /> phone<br />
			<xsl:value-of select="/data/unitfax" /> fax<br />
			<br />
			<p>To learn more about the programs or people highlighted on our web site, please contact the 
			<a href="mailto:csharris@uiuc.edu"><font color="#ffffff">College of Education Communications Office</font></a></p>
		</xsl:when>
		<xsl:otherwise>
			<p><a><xsl:attribute name="href"><xsl:value-of select="/data/uniturl" /></xsl:attribute><font color="#ffffff"><xsl:value-of select="/data/unitname" /></font></a></p>
			<p><xsl:value-of select="/data/unitaddress" /></p>
			<p><xsl:value-of select="/data/unitphone" /></p>
			<p><xsl:value-of select="/data/unitfax" /></p>
			<p><a href="mailto:{/data/unitemail}"><font color="#ffffff"><xsl:value-of select="/data/unitemail" /></font></a></p>
		</xsl:otherwise>
	</xsl:choose>
</xsl:template>

<!-- menu tree  -->

<xsl:template match="/data/leftmenu/div[@id='menutree']/ul/li" >
	<xsl:variable name="menulevel1heading">
		<xsl:choose>
			<xsl:when test="a"><xsl:value-of select="normalize-space(a/text())"/></xsl:when>
			<xsl:when test="span/a"><xsl:value-of select="normalize-space(span/a/text())"/></xsl:when>
			<xsl:when test="span"><xsl:value-of select="normalize-space(span/text())"/></xsl:when>
			<xsl:otherwise><xsl:value-of select="normalize-space(text())"/></xsl:otherwise>
		</xsl:choose>
	</xsl:variable>
	<xsl:variable name="level1menuname">
		<xsl:value-of select="normalize-space(/data/level1menuname/text())"/>
	</xsl:variable>
	<xsl:variable name="level1match">
		<xsl:choose>
			<xsl:when test="$menulevel1heading != $level1menuname">0</xsl:when>
			<xsl:when test="string-length($level1menuname) = 0">0</xsl:when>
			<xsl:otherwise>1</xsl:otherwise>
		</xsl:choose>
	</xsl:variable>
	<xsl:element name="div">
	
		<xsl:choose> <!--class of div -->
			<xsl:when test="count(ul/li) = 0 ">
				<xsl:attribute name="class">nochildrennode</xsl:attribute>
			</xsl:when> 
			<xsl:when test="@class='opennode' or span/@class='opennode' or a/@class='opennode'">
				<xsl:attribute name="class">nostatenode</xsl:attribute>
			</xsl:when> 
			<xsl:when test="@class='closednode' or span/@class='closednode' or a/@class='closednode'">
				<xsl:attribute name="class">nostatenode</xsl:attribute>
			</xsl:when> 
			<xsl:when test="@class='defaultopennode' or span/@class='defaultopennode' or a/@class='defaultopennode' ">
				<xsl:attribute name="class">defaultopennode</xsl:attribute>
			</xsl:when> 
			<xsl:when test="@class='nochildrennode' or span/@class='nochildrennode' or a/@class='nochildrennode' ">
				<xsl:attribute name="class">nochildrennode</xsl:attribute>
			</xsl:when> 
			<xsl:otherwise>
				<xsl:attribute name="class">nostatenode</xsl:attribute>
			</xsl:otherwise> 
		</xsl:choose>
	
		<table class="layout" width="{$nav_menu_table_width}" border="0" >
			<xsl:if test="$level1match = '1' and normalize-space(/data/level2menuname/text()) = '' "><xsl:attribute name="id">chosenlevel1menuitem</xsl:attribute></xsl:if>
			<tr class="layout"><td class="switch" height="5" width="{$nav_switch_td_width}" valign="top"><img src="/library/images/cssmenu/empty.gif" class="menuicon" alt="" /></td><xsl:element name="td">
			<xsl:attribute name="class">menuheading</xsl:attribute> 
			<xsl:attribute name="width"><xsl:value-of select="$nav_menu_text_td_width" /></xsl:attribute> 
			<xsl:attribute name="id">menuheading_<xsl:value-of select="position()" /></xsl:attribute> 
			<xsl:element name="span">
		<!--	<xsl:copy-of select="span/text()"/>  -->
				<xsl:choose>
					<xsl:when test="a"><xsl:copy-of select="a"/></xsl:when>
					<xsl:when test="span/a"><xsl:copy-of select="span/a"/></xsl:when>
					<xsl:when test="span"><xsl:copy-of select="span"/></xsl:when>
					<xsl:when test="span"><xsl:copy-of select="span/text()"/></xsl:when>
					<xsl:otherwise><xsl:copy-of select="text()"/></xsl:otherwise>
				</xsl:choose>
			</xsl:element>
		</xsl:element> 
		</tr><tr class="layout"><td class="layout" width="{$nav_switch_td_width}"></td><td width="{$nav_menu_text_td_width}" class="layout">
		<ul class="menu2ndlevel">
			<xsl:apply-templates select="./ul/li"><xsl:with-param name="level1match" select="$level1match" /></xsl:apply-templates>
		</ul>
		</td></tr></table>
	</xsl:element>  <!-- div class=opennode,closednode, or nostatenode -->
</xsl:template>

<xsl:template match="/data/leftmenu/div[@id='menutree']/ul/li" mode="css0" >
	 <tr class="layout"><td colspan="2"><img class="spacerImage" src="/library/images/transparent.gif" width="1" height="7" alt="" /><br clear="left" /><font face="{$fontface}" color="#000000" ><b>
			<xsl:choose>
				<xsl:when test="a"><xsl:element name="a"><xsl:attribute name="href"><xsl:value-of select="a/@href"/></xsl:attribute><font face="{$fontface}" color="#000000" ><b><xsl:copy-of select="a/text()"/></b></font></xsl:element></xsl:when>
				<xsl:when test="span/a"><xsl:copy-of select="span/a"/></xsl:when>
				<xsl:when test="span"><xsl:copy-of select="span"/></xsl:when>
				<xsl:when test="span"><xsl:copy-of select="span/text()"/></xsl:when>
				<xsl:otherwise><xsl:copy-of select="text()"/></xsl:otherwise>
			</xsl:choose>
	</b></font></td></tr> 
			<xsl:choose>
				<xsl:when test="a"></xsl:when>
				<xsl:otherwise><xsl:apply-templates select="./ul/li" mode="css0"  /></xsl:otherwise>
			</xsl:choose>
</xsl:template>

<xsl:template match="/data/leftmenu/div[@id='menutree']/ul/li/ul/li" >
	<xsl:param name="level1match" />
	<xsl:variable name="level2menucurrent">
		<xsl:choose>
			<xsl:when test="a/text()"><xsl:value-of select="normalize-space(a/text())"/></xsl:when>
			<xsl:otherwise><xsl:value-of select="normalize-space(text())" /></xsl:otherwise>
		</xsl:choose>
	</xsl:variable>
	<li class="menu2ndlevelitem">
	<xsl:if test="$level1match='1'">
		<xsl:if test="$level2menucurrent = normalize-space(/data/level2menuname/text())"><xsl:attribute name="id">chosenlevel2menuitem</xsl:attribute>
		</xsl:if>
	</xsl:if>
	<xsl:copy-of select="text()" /><xsl:apply-templates select="./*" /></li>
</xsl:template>

<xsl:template match="/data/leftmenu/div[@id='menutree']/ul/li/ul/li" mode="css0" >
	<tr><td valing="top" width="2"><img src="/library/images/transparent.gif" width="2" height="1" alt="" border="0"/></td><td width="120"><font face="{$fontface}" color="#000000" size="-1"><xsl:copy-of select="text()" /></font><xsl:apply-templates select="./*"  mode="css0" /></td></tr>  
</xsl:template>

<xsl:template match="/data/leftmenu/div[@id='menutree']/ul/li/ul/li/a" >
	<xsl:copy-of select="." />
</xsl:template>

<xsl:template match="/data/leftmenu/div[@id='menutree']/ul/li/ul/li/a" mode="css0" >
	<xsl:element name="a"><xsl:attribute name="href"><xsl:value-of select="@href"/></xsl:attribute><font face="{$fontface}" color="#000000" size="-1"><xsl:copy-of select="text()"/></font></xsl:element>
</xsl:template>

<xsl:template match="/data/leftmenu/div[@id='menutree']/ul/li/ul/li/ul" >
	<xsl:if test="count(./li) &gt; 0 and ./li/text()" ><xsl:copy-of select="." /></xsl:if>  
</xsl:template>

<xsl:template match="/data/leftmenu/div[@id='menutree']/ul/li/ul/li/ul" mode="css0" >
	<xsl:if test="count(./li) &gt; 0 and ./li/text()" ><font face="{$fontface}" color="#000000" size="-1"><xsl:copy-of select="." /></font></xsl:if>  
</xsl:template>

<!-- validate links -->

<xsl:template match="/data" mode="validate">
		<a href="http://validator.w3.org/check/referer" target="new" accesskey="f"><img src="/library/images/transparent.gif" width="10" height="1" alt="" border="0"/></a>
		<a href="http://validator.w3.org/check?uri=http://w6.ed.uiuc.edu{/data/url}" target="new" accesskey="c" ><img src="/library/images/transparent.gif" width="10" height="1" alt=""  border="0"/></a>
</xsl:template>


<!-- content table for home pages -->

<xsl:template match="/data" mode="homePageContentCSS1">


	<table id="bottomLayoutTable"  bgcolor="{$rust}" class="layout" border="0" cellpadding="0" cellspacing="0">
		  <tr class="layout"> 
				<!-- navigation column -->
		    <td id="navigationColumnTD" class="layout" valign="top" width="{$nav_width}" height="100%" ><xsl:apply-templates select="/data" mode="nav_column" /></td>
				<!-- content column -->
		    <td class="layout" valign="top" width="{$main_width}"  > 
		     <table class="layout" width="{$main_width}"   cellpadding="0" cellspacing="0">
		        <tr class="layout" > 
		          <td class="layout" width= "{$layout_col1}" colspan="1" height="1" bgcolor="{$spotlight1backgroundcolor}"><img class="spacerImage" src="/library/images/transparent.gif" alt="" width="{$layout_col1}" height="1" /></td>
		          <td class="layout" width= "{$layout_col2}" colspan="1" height="1" bgcolor="{$spotlight1backgroundcolor}"><img class="spacerImage" src="/library/images/transparent.gif" alt="" width="{$layout_col2}" height="1" /></td>
		          <td class="layout" width= "{$layout_col3}" colspan="1" height="1" bgcolor="{$rust}"><img class="spacerImage" src="/library/images/{$rustImage}" alt="" width="{$layout_col3}" height="1" /></td>
		          <td class="layout" width= "{$layout_col4}" colspan="1" height="1" bgcolor="{$rust}"><img class="spacerImage" src="/library/images/{$rustImage}" alt="" width="{$layout_col4}" height="1" /></td>
		          <td class="layout" width= "{$layout_col5}" colspan="1" height="1" bgcolor="{$rust}"><img class="spacerImage" src="/library/images/{$rustImage}" alt="" width="{$layout_col5}" height="1" /></td>
		        </tr>
		        <tr class="layout" >
							<td class="layout" id="spotlight1td" width="{$spotlight1_width}" colspan="2" valign="top" bgcolor="{$spotlight1backgroundcolor}">
							<xsl:attribute name="style">padding: <xsl:value-of select="$spotlight1padding" />px</xsl:attribute>
							<a name="content"></a><xsl:copy-of select="divs/div[@id='spotlight1']" /></td>
		          <td class="layout" id="spotlight2phototd" width="{$spotlight2photo_width}" colspan="2" valign="top" bgcolor="{$rust}"><xsl:copy-of select="divs/div[@id='spotlight2photo']" /></td>
		          <td class="layout" id="spotlight2td" width="{$spotlight1_width}" colspan="1" valign="top" bgcolor="{$rust}"><xsl:copy-of select="divs/div[@id='spotlight2']" /></td>
		        </tr>
		        <tr class="layout" > 
		          <td class="layout" id="content1td" width="{$content1_width}" colspan="1" valign="top" bgcolor="{$rust}" ><xsl:copy-of select="divs/div[@id='content1']" /></td>
		          <td class="layout" id="content2td" width="{$content2_width}" colspan="2" valign="top" bgcolor="{$rust}" ><xsl:copy-of select="divs/div[@id='content2']" /></td>
							<td class="layout" id="content3td" width="{$content3_width}" colspan="2" valign="top" bgcolor="{$rust}" ><xsl:copy-of select="divs/div[@id='content3']" /></td>
		        </tr>
		      <tr class="layout"> 
		          <td class="layout"  width="{$content1_width}" height="50%"  colspan="1" valign="top" bgcolor="{$rust}" ><img class="spacerImage" src="/library/images/{$rustImage}" alt="" width="1" /></td>
		          <td class="layout"  width="{$content2_width}" colspan="2" valign="top" bgcolor="{$rust}" ></td>
							<td class="layout"  width="{$content3_width}" colspan="2" valign="top" bgcolor="{$rust}" ></td>  
					</tr>
				</table>          
			</td>
		</tr>
	</table>				
</xsl:template>



<xsl:template match="/data" mode="homePageContentCSS0">
	<xsl:variable name="spotlight1backgroundcolor">
		<xsl:choose>
			<xsl:when test="$templatetype = 'coehome'"><xsl:value-of select="$verydarkblue" /></xsl:when>
			<xsl:otherwise><xsl:value-of select="$tan" /></xsl:otherwise>
		</xsl:choose>
	</xsl:variable>

	<table id="bottomLayoutTable"  valign="top" bgcolor="{$rust}" class="layout" border="0" cellpadding="0" width="{$page_width}" cellspacing="0">
	  <tr class="layout"> 
			<!-- navigation column -->
	    <td bgcolor="{$darktan}"  rowspan="2" id="navigationColumnTD" class="layout" valign="top" width="{$nav_width}" height="100%" ><img src="/library/images/transparent.gif" width="{$nav_width}" height="1" /><xsl:apply-templates select="/data" mode="nav_column_css0" /></td>
			<td  cellpadding="0" cellspacing="0"  class="layout" valign="top" width="{$main_width}">
			  <table valign="top" bgcolor="{$verydarkblue}" border="0" bordercolor="{$verydarkblue}" cellpadding="0" hspace="0" cellspacing="0" ><tr class="layout">
					<td width="{$spotlight1padding}"  bgcolor="{$verydarkblue}"><img src="/library/images/transparent.gif" width="10" height="1" /></td>
	 				<td valign="top"><br /><a name="content"></a><img src="/library/images/transparent.gif" width="{$spotlight1_width - 20}" height="{$spotlight1padding}" /><br clear="right" /><xsl:apply-templates select="divs/div[@id='spotlight1']" mode="homepage" /><br clear="left" /><img src="/library/images/transparent.gif" width="{$spotlight1_width - 45}" height="{$spotlight1padding}" /></td>
					<td width="{$spotlight1padding}"  bgcolor="{$verydarkblue}"><img src="/library/images/transparent.gif" width="{$spotlight1padding}" height="1" /></td>
	
					<td width="{$spotlight1padding}"  bgcolor="{$rust}"><img src="/library/images/transparent.gif" width="{$spotlight1padding}" height="1" /></td>
					<td valign="top" bgcolor="{$rust}"><img src="/library/images/transparent.gif" width="{$spotlight2photo_width - 17 }" height="10" /><xsl:copy-of select="divs/div[@id='spotlight2photo']" /></td>
					<td width="7"  bgcolor="{$rust}"><img src="/library/images/transparent.gif" width="7" height="1" /></td>

					<td width="2"  bgcolor="{$rust}"><img src="/library/images/transparent.gif" width="2" height="1" /></td>
					<td valign="top" bgcolor="{$rust}"><img src="/library/images/transparent.gif" width="{$spotlight2_width - 4}" height="10" /><font face="{$fontface}" size="-1"><xsl:copy-of select="divs/div[@id='spotlight2']" /></font><br clear="left" /><img src="/library/images/transparent.gif" width="1" height="10" /></td>
					<td width="2"  bgcolor="{$rust}"><img src="/library/images/transparent.gif" width="2" height="1" /></td>
			   </tr>
					<tr><td colspan="9"><img src="/library/images/{$paleyellowImage}" width="{$main_width}" height="1" /></td></tr>
				<tr>
						<td width="3"  bgcolor="{$rust}"><img src="/library/images/transparent.gif" width="3" height="1" /></td>
						<td colspan="7" valign="top" bgcolor="{$rust}">
							<xsl:apply-templates select="divs/div[@id='content1']" mode="homepage" />
							<xsl:apply-templates select="divs/div[@id='content2']" mode="homepage" />
							<xsl:apply-templates select="divs/div[@id='content3']" mode="homepage" />	
							<p>&#160;</p><p>&#160;</p>
				     </td>
				<td width="3"  bgcolor="{$rust}"><img src="/library/images/transparent.gif" width="3" height="1" /></td>
					</tr> 
				</table>
			</td>
		</tr>
	</table>		
</xsl:template>

<xsl:template match="*" mode="homepage">
	<font face="{$fontface}" >

	<xsl:for-each select="child::*|text()">
		<xsl:choose>
			<xsl:when test="name() = 'h1'">
				<br clear="left" /><br clear="left" /><font size="+2" color="{$paleyellow}"><xsl:value-of select="." /></font><br clear="left" />
			</xsl:when>
			<xsl:otherwise>
				<xsl:copy-of select="."/>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:for-each>

		</font>
</xsl:template>

<xsl:template match="*" mode="standardpage">
	<font face="{$fontface}" >

	<xsl:for-each select="child::*|text()">
		<xsl:choose>
			<xsl:when test="name() = 'h1'">
				<br /><font size="+2" color="{$darkblue}" face="serif"><b><xsl:value-of select="." /></b></font><br clear="left" />
			</xsl:when>
			<xsl:otherwise>
				<xsl:copy-of select="."/>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:for-each>

		</font>
</xsl:template>


<!-- 

	this template is the guts of the error message. 
	All error numbers are of the following format:  application_name.error_number
	such as coewebpubsys.201 (parsing error).  


	0-99 errors which are application errors.  They are most likely caused by problems with application
	 and are resolved by sys admins and developers.  The first digit represents the stage of the 8 stages of the page manager:

  	1. get the following objPageParameters attributes: siteDefinitionFile,query,filename,filesuffix,path

		2. get site variables from site site definition xml file

		3. get heirarchical data from properties.html files and directory path this is a recursive function
	
 		4. get data from html file, or if it is a custom widget such  as search or fsd, get widget data

		5. get left menu
      51.  No menu.html file is available.  THis is when no menu.html file is found on the site, even /root/menu.html
		  52.  Error parsing menu.html file.  The file is not parseable as xml
			53.  menu.html is parseable, but has no menu item
		6. check if update reminder is needed

		7. integrate all data into a single xml object so XSLT can be applied
			70. server error.  maybe bad character in directory name

		8. display page.  find target xslt and apply it to data xml object
 
	
	100-200 errors which are possibly user or author errors such as 404 errors
	  100-110 file not found errors
      100 - folder doesn't exist  i.e.  /oet/abot
      101 - default file in folder doesn't exist  i.e. /oet/about has no index.html file
			102 - file doesn't exist i.e. /oet/about/facilitees.html
 

	200+ errors which are most likely caused and need to be resolved by the web author
		201 - content file does not parse as xml.  
		202 - alias doesn't point to file.


-->

<xsl:variable name="error_page_link">
	For additional info, see <a href="/help/errors.html">Error message page</a>.
</xsl:variable>

<xsl:variable name="filenotfoundusererror">
<p>The URL <xsl:value-of select="/data/rooturlpath/text()" /><xsl:value-of select="/data/url/text()" />
		is not available on this server.  Please try the following:<br/><br/>
		<ul>
			<li>Check the spelling of the URL you requested.</li>
			<li>Click the <a href="javascript:history.back(1)">Back</a> button to try another link. </li>
			<li>Look for home pages in directories above this one or on the <xsl:value-of select="/data/unitname/text()"/> 
			homepage <a href="{/data/rooturlpath/text()}{/data/uniturl/text()}"><xsl:value-of select="/data/rooturlpath/text()"/><xsl:value-of select="/data/uniturl/text()"/></a></li>
			<li>Try finding the page you want using the <a href="/search/">COE Search Page</a> or <a href="/sitemap/">Site Map</a>.</li>

		</ul>
		</p>
</xsl:variable>

<xsl:template match="/data" mode="error" >
	<xsl:choose>
		<xsl:when test="/data/error/@number &gt; 99">
			<xsl:choose>
			  <xsl:when test="/data/error/@number &lt; 110">
					<xsl:apply-templates select="/data" mode="filenotfound" />
				</xsl:when>
			  <xsl:when test="/data/error/@number = 201">
					<xsl:variable name="heading">Error parsing file as XHTML</xsl:variable>
					<xsl:variable name="reader_info"><p>The web server can not display this page because of a server error.</p></xsl:variable>
					<xsl:variable name="author_info">
						<p>This is caused when the College of Education Web Pubishing Application attempts to read a file
							which is not valid XHTML. 
						</p>
						<p>For more information on converting html to xhtml, see <a href="http://www.perfectxml.com/xhtml.pdf">
							Perfect XML's Converting HTML to XHTML</a>. 
						You may want to use the W3C's XHTML validator on this page with the link:
							<a href="http://validator.w3.org/check?uri=http://w6.ed.uiuc.edu{/data/url}" target="new">
							http://validator.w3.org/check?uri=http://w6.ed.uiuc.edu<xsl:value-of select="/data/url/text()"/></a>
						</p>
						<pre><xsl:copy-of select="/data/error/description"/></pre>
					</xsl:variable>
					<xsl:call-template name="message">
						<xsl:with-param name="heading" select="$heading" />
						<xsl:with-param name="reader_info" select="$reader_info" />
						<xsl:with-param name="author_info" select="$author_info" />
						<xsl:with-param name="admin_info"  />
					</xsl:call-template>
				</xsl:when>
			  <xsl:when test="/data/error/@number = 202">
					<xsl:variable name="heading">File Not Found</xsl:variable>
					<xsl:variable name="reader_info"><xsl:copy-of select="$filenotfoundusererror" /></xsl:variable>
					<xsl:variable name="author_info">
						<p>This is error 202 and is caused by an alias file pointing to a file that does not exist. 
						</p>
					</xsl:variable>
					<xsl:call-template name="message">
						<xsl:with-param name="heading" select="$heading" />
						<xsl:with-param name="reader_info" select="$reader_info" />
						<xsl:with-param name="author_info" select="$author_info" />
						<xsl:with-param name="admin_info"  />
					</xsl:call-template>
				</xsl:when>

			</xsl:choose>
		</xsl:when>
		<xsl:otherwise>
			<xsl:choose><!--  menu errors 50 - 59 -->
				<xsl:when test="/data/error/@number &lt; 60 and /data/error/@number &gt; 49">
					<xsl:variable name="heading">Menu Error</xsl:variable>
					<xsl:variable name="reader_info">
					<p>This page is not available because of a server error.</p>
					</xsl:variable>
					<xsl:choose>
						<xsl:when test="/data/error/@number = '52'">
							<xsl:variable name="author_info">
								<p>The menu file is not parseable as xml.  <xsl:value-of select="/data/leftmenufilepath/text()" />.</p>
							</xsl:variable>
							<xsl:call-template name="message">
								<xsl:with-param name="heading" select="$heading" />
								<xsl:with-param name="reader_info" select="$reader_info" />
								<xsl:with-param name="author_info" select="$author_info" />
								<xsl:with-param name="admin_info"  />
							</xsl:call-template>
						</xsl:when>
						<xsl:when test="/data/error/@number = '53'">
							<xsl:variable name="author_info">
								<p>The menu file has no menu section in it.  This is probably a mal formed menu file. <xsl:value-of select="/data/leftmenufilepath/text()" />.</p>
							</xsl:variable>
							<xsl:call-template name="message">
								<xsl:with-param name="heading" select="$heading" />
								<xsl:with-param name="reader_info" select="$reader_info" />
								<xsl:with-param name="author_info" select="$author_info" />
								<xsl:with-param name="admin_info"  />
							</xsl:call-template>
						</xsl:when>
					</xsl:choose>
				</xsl:when>
				<xsl:when test="/data/error/@number &lt; 90 and /data/error/@number &gt; 69">
					<xsl:variable name="heading">Server Error</xsl:variable>
					<xsl:choose>
						<xsl:when test="/data/error/@number = '70'">
							<xsl:variable name="reader_info">
								<p>This page is not available because of a server error.</p>
							</xsl:variable>
							<xsl:variable name="author_info">
							<p>  The collection of files used to create this page is not parseable as xml. This could
							be casued by a plethora of problems including:</p>
								<ul>
									<li>Invalid characters in file or folder names.  File and folder names should only use lower case letters and numbers.</li>
									<li>Invalid xml characters in properties.html, menu.html or site definition files.  These are generally caught by different error catching.</li>
								</ul>
							<p>This error is not caused by content templates.  That is, it is not caused by editing web pages besides properties.html and menu.html.
							It is encountered in COEPageManager in the function getDataAsMSXMLobj.</p>
							</xsl:variable>
							<xsl:call-template name="message">
								<xsl:with-param name="heading" select="$heading" />
								<xsl:with-param name="reader_info" select="$reader_info" />
								<xsl:with-param name="author_info" select="$author_info" />
								<xsl:with-param name="admin_info"  />
							</xsl:call-template>
						</xsl:when>
					</xsl:choose>
					
				</xsl:when>
				<xsl:otherwise>
					<h1>Admin Error</h1>
				</xsl:otherwise>
			</xsl:choose>

		</xsl:otherwise>
	</xsl:choose>

	<xsl:if test="/data/@debug='true'">
		<hr/>
		<p><b>Error Number:</b><xsl:value-of select="/data/error/@number"/></p>
		<p><b>Error Type:</b><xsl:value-of select="/data/error/@type"/></p>
		<p><b>Error Description:</b><xsl:value-of select="/data/error/description/text()"/></p>
	</xsl:if>
</xsl:template>

<xsl:template name="message">
		<xsl:param name="heading" />
		<xsl:param name="reader_info" />
		<xsl:param name="author_info" />
		<xsl:param name="admin_info" />

		<h1><xsl:value-of select="$heading"/></h1>
		<xsl:copy-of select="$reader_info"/>

		<br/><p class="pfoot"><xsl:copy-of select="credits" /></p>

		<xsl:if test="$author_info or $admin_info"><br/></xsl:if>

		<xsl:if test="$author_info" >
			<h2>Additional Info for Author</h2>
			<xsl:copy-of select="$author_info"/>
			<p><xsl:copy-of select="$error_page_link" /></p>
		</xsl:if>

		<xsl:if test="$admin_info" >
			<h2>Additional Info for Administrator</h2>
			<xsl:copy-of select="$admin_info"/>
			<p><xsl:copy-of select="$error_page_link" /></p>
		</xsl:if>

	
</xsl:template>

<xsl:template match="/data" mode="contactadmin">
	<p>Please contact this web site's administrator to report this error:
	<a href="mailto:webmaster@mail.ed.uiuc.edu">webmaster@mail.ed.uiuc.edu</a>.</p>
</xsl:template>



<xsl:template match="/data" mode="filenotfound" >
	<xsl:variable name="reader_info"><xsl:copy-of select="$filenotfoundusererror"/>
	</xsl:variable>
	<xsl:variable name="author_info">
			<xsl:choose>
			<xsl:when test="/data/error/@number = '100'">
					<p>This is error number 100.  A folder in the path of the URL does not exist. <xsl:copy-of select="/data/error" /></p>
					<p>One of the folders in this path doesn't exist.  Could be a bad link, a mistyped URL, or a missing folder.</p>
			</xsl:when>
			<xsl:when test="/data/error/@number = '101'">
				<p>This is error number 101.  The directory does not have a default file (index.html).</p>
			</xsl:when>
			<xsl:when test="/data/error/@number = '102'">
				<p>This is error number 102.  The file does not exist.</p>
			</xsl:when>
		</xsl:choose>
	</xsl:variable>

	<xsl:call-template name="message">
		<xsl:with-param name="heading" select="'File Not Found'" />
		<xsl:with-param name="reader_info" select="$reader_info" />
		<xsl:with-param name="author_info" select="$author_info"  />
		<xsl:with-param name="admin_info"  />
	</xsl:call-template>

</xsl:template>

<xsl:template name="str:replace">
	<xsl:param name="input"/>
	<xsl:param name="search-string"/>
	<xsl:param name="replace-string"/>
	<xsl:choose>
		<!-- See if the input contains the search string -->
		<xsl:when test="contains($input,$search-string)">
		<!-- If so, then concatenate the substring before the search
		string to the replacement string and to the result of
		recursively applying this template to the remaining sub-string.
		-->
			<xsl:value-of select="substring-before($input,$search-string)"/>
			<xsl:value-of select="$replace-string"/>
			<xsl:call-template name="str:replace">
				<xsl:with-param name="input"
				select="substring-after($input,$search-string)"/>
				<xsl:with-param name="search-string" 
				select="$search-string"/>
				<xsl:with-param name="replace-string" 
					select="$replace-string"/>
			</xsl:call-template>
		</xsl:when>
		<xsl:otherwise>
			<!-- There are no more occurences of the search string so 
			just return the current input string -->
			<xsl:value-of select="$input"/>
		</xsl:otherwise>
	</xsl:choose>
</xsl:template>

</xsl:stylesheet>

