<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">

<xsl:output method="html" indent="yes" encoding="utf-8" doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"/>
<xsl:strip-space elements="*"/>
<xsl:include href="buttons.xsl"/>

<xsl:template match="LAYOUT">
	<xsl:variable name="cID" select="@ID"/>
	<HTML>
<!-- agriculture-001 -->
    <head>
		<title><xsl:value-of select="@SITE-TITLE" disable-output-escaping="yes"/> - <xsl:value-of select="@TITLE" disable-output-escaping="yes"/></title>
		<xsl:apply-templates select="META-TAGS"/>
		<link href="css/styles.css" rel="stylesheet" type="text/css"/>
	</head>
	<BODY MARGINHEIGHT="0" MARGINWIDTH="0" TOPMARGIN="0" RIGHTMARGIN="0" BOTTOMMARGIN="0" LEFTMARGIN="0">	
<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0" class="main-bg" style="width: 100%; height: 100%;" summary="">
	<TR>
		<TD colspan="2" height="392" style="background-image: url('images/header_bg.jpg');">
			<table cellpadding="0" cellspacing="0" border="0" summary="" style="width: 100%; height: 100%; background-image: url('images/header_bg.gif'); background-repeat: repeat-x;">
				<tr>
					<td style="background-image: url('images/header_l.gif'); background-repeat: no-repeat;">
						<table cellpadding="0" cellspacing="0" border="0" summary="" style="width: 100%; height: 100%; background-image: url('images/header.jpg'); background-position: top right; background-repeat: no-repeat;">
							<tr>
								<td height="254" style="padding-right: 530px;">
									<table cellpadding="0" cellspacing="0" border="0" summary="" class="logo-bg" style="height: 95px; background-image: url('images/logo_t.gif'); background-repeat: repeat-x;">
										<tr>
											<td style="background-image: url('images/logo_b.gif'); background-position: bottom; background-repeat: repeat-x;">
												<table cellpadding="0" cellspacing="0" border="0" summary="" style="width: 100%; height: 100%; background-image: url('images/logo_r.gif'); background-position: right; background-repeat: repeat-y;">
													<tr>
														<td style="background-image: url('images/logo_tr.jpg'); background-position: top right; background-repeat: no-repeat;">
															<table cellpadding="0" cellspacing="0" border="0" summary="" style="width: 100%; height: 100%; background-image: url('images/logo_br.jpg'); background-position: bottom right; background-repeat: no-repeat;">
																<tr>
																	<td style="padding: 16px 48px 29px 30px;">
																		<!-- LOGO -->
																		<table cellpadding="0" cellspacing="0" summary="">
																			<tr>
																				<td rowspan="2"><a href="./"><img src="images/{LOGO/@NAME}" alt="" border="0" style="margin-right: 5px;"/></a></td>
																				<td class="company" valign="bottom"><xsl:value-of select="COMPANY-INFO/NAME" disable-output-escaping="yes"/></td>
																			</tr>
																			<tr><td class="slogan" valign="top"><xsl:value-of select="COMPANY-INFO/SLOGAN" disable-output-escaping="yes"/></td></tr>
																		</table>
																		<!-- END LOGO -->
																		<div style="width:173px; height:0px;"><span></span></div>
																	</td>
																</tr>
															</table>
														</td>
													</tr>
												</table>
											</td>
										</tr>
									</table>
								</td>
							</tr>
							<tr><td height="44"></td></tr>
							<tr>
								<td height="100%" style="padding-right: 260px;">
									<!-- MENU -->
									<table cellpadding="0" cellspacing="0" align="center" summary="">
										<tr>
											<td width="30"><div style="width:5px; height:0px;"><span></span></div></td>
											<xsl:call-template name="TOP-MENU"/>
										</tr>
									</table>
									<!-- END MENU -->
								</td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</TD>
	</TR>
	<TR valign="top">
		<TD height="100%" width="100%" name="SB_stretch" class="pageContent" style="padding-left: 70px;">
			<!-- CONTENT -->
			<div class="text-header"><xsl:value-of select="@TITLE" disable-output-escaping="yes"/></div>
			<div style="width:0px; height:15px;"><span></span></div>
			<xsl:apply-templates select="PAGE-CONTENT"/>
			<!-- END CONTENT -->
		</TD>
		<TD width="260">
			<!-- SUBMENU -->
			<table cellpadding="0" cellspacing="0" width="160" align="center" summary="">
				<xsl:call-template name="SUB-MENU"><xsl:with-param name="pageID" select="@ID"/></xsl:call-template>
			</table>
			<!-- END SUBMENU -->
			<div style="width:260px; height:0px;"><span></span></div>
		</TD>
	</TR>
	<TR>
		<TD colspan="2" height="82" align="right" valign="bottom" style="background-image: url('images/footer_bg.gif'); background-position: bottom right; background-repeat: no-repeat;">
			<table cellpadding="0" cellspacing="0" border="0" summary="" style="width: 219px; height: 72px; background-color: #ffffff;">
				<tr>
					<td align="center" class="footer">
						<!-- FOOTER -->
						<xsl:value-of select="COPYRIGHT" disable-output-escaping="yes"/>
						<!-- END FOOTER -->
					</td>
				</tr>
			</table>
		</TD>
	</TR>
</TABLE>
	<!--sw_sb_ms-->
	</BODY>

	</HTML>
</xsl:template>


<xsl:template name="TOP-MENU">
		<xsl:apply-templates select="MENU" mode="top"/>	
</xsl:template>


<xsl:template name="SUB-MENU">
	<xsl:param name="pageID"/>
	<xsl:choose>
		<xsl:when test="//MENU/MENU-ITEM[@ID = $pageID]/MENU-ITEM">
			<xsl:apply-templates select="//MENU/MENU-ITEM[@ID = $pageID]/MENU-ITEM" mode="sub"/>
		</xsl:when>
		<xsl:when test="//MENU/MENU-ITEM/MENU-ITEM[@ID = $pageID]">
			<xsl:variable name="parentID" select="//MENU/MENU-ITEM/MENU-ITEM[@ID = $pageID]/../@ID"/>
			<xsl:apply-templates select="//MENU/MENU-ITEM[@ID=$parentID]/MENU-ITEM" mode="sub"/>
		</xsl:when>
	</xsl:choose>
</xsl:template>

<xsl:template match="MENU-ITEM" mode="sub">
	<xsl:choose>
		<xsl:when test="@ID=/LAYOUT/@ID" >
				<tr>
					<td class="asubmenu" style="padding-left: 5px; width: 100%; height: 30px;"><xsl:value-of select="@TITLE" disable-output-escaping="yes"/></td>
					<td align="right" style="padding: 0 5px 0 5px"><img src="images/submenu_bullet.gif" border="0" alt=""/></td>
				</tr>
		</xsl:when>
		<xsl:otherwise>
			<xsl:if test="../MENU-ITEM[@ID=/LAYOUT/@ID] or ../../MENU-ITEM[@ID=/LAYOUT/@ID]">
				<tr>
					<td style="padding-left: 5px; width: 100%; height: 30px;"><a href="{@HREF}" class="submenu"><xsl:value-of select="@TITLE" disable-output-escaping="yes"/></a></td>
					<td align="right" style="padding: 0 5px 0 5px"><a href="{@HREF}"><img src="images/submenu_bullet.gif" border="0" alt=""/></a></td>
				</tr>
			</xsl:if>
		</xsl:otherwise>
	</xsl:choose>
	<xsl:if test="position()!=last()">
		<tr><td colspan="2" style="height: 2px; background-color:  #FFFFFF; background-image: url('images/submenu_hr.gif'); background-repeat: repeat-x;"></td></tr>
	</xsl:if>
</xsl:template>	

<xsl:template match="META-TAGS">
	<xsl:apply-templates mode="meta-tags"/>
</xsl:template>
	
<xsl:template match="*" mode="meta-tags">
	<meta name="{local-name(.)}">
		<xsl:attribute name="content"><xsl:value-of select="." disable-output-escaping="yes"/></xsl:attribute>
	</meta>
</xsl:template>


<xsl:template match="PAGE-CONTENT">
	<xsl:comment> EDITABLE CONTENT </xsl:comment>
	<xsl:apply-templates mode="meta-tags"/>
</xsl:template>
	     	
</xsl:stylesheet>
