<?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>
<!-- xet-11 -->
    <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"/>
		<style>
			img { behavior:url('images/pngbehavior.htc'); }
		</style>
	</head>
	<BODY MARGINHEIGHT="0" MARGINWIDTH="0" TOPMARGIN="0" RIGHTMARGIN="0" BOTTOMMARGIN="0" LEFTMARGIN="0">	
<table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%" background="images/main_bg.gif" class="main-bg">
	<tr>
		<td height="96" style="background-image: url('images/tbg.gif'); background-position: bottom; background-repeat: repeat-x;">
			<table cellpadding="0" cellspacing="0" border="0" height="96">
				<tr>
					<td align="center">
						<div style="width:270px; height:1px;"><spacer type="block" width="270" height="1"/></div>
						<table cellpadding="0" cellspacing="0">
							<tr>
								<td rowspan="2"><a href="./"><img src="images/{LOGO/@NAME}" 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>
								<td><img src="images/logo_bullet.gif" border="0" alt="" style="margin-left: 5px;"/></td>
							</tr>
							<tr><td colspan="2" class="slogan" valign="top"><xsl:value-of select="COMPANY-INFO/SLOGAN" disable-output-escaping="yes"/></td></tr>
						</table>											
					</td>
					<td><div style="width:5px; height:1px;"><spacer type="block" width="5" height="1"/></div></td>
					<td style="padding-right: 147px;">
					<!-- MENU -->
						<table cellpadding="0" cellspacing="0">
							<tr>
								<xsl:call-template name="TOP-MENU"/>
							</tr>
						</table>	
						<!-- /MENU -->					
					</td>
				</tr>
			</table>
		</td>
	</tr>
	<tr>
		<td height="100%" background="images/main_tbg.gif">
			<table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%" style="background-image: url('images/main_rbg.gif'); background-position: bottom; background-repeat: repeat-x;">
				<tr>
					<td>
						<table cellpadding="0" cellspacing="0" border="0" height="100%" width="100%">
							<tr>
								<td width="279" style="background-image: url('images/doll_rbg.gif'); background-position: right; background-repeat: repeat-y;">
									<table cellpadding="0" cellspacing="0" border="0" width="279" height="100%" style="background-image: url('images/doll_tbg.gif'); background-position: top right; background-repeat: no-repeat;">
										<tr>
											<td valign="top" style="background-image: url('images/doll_bbg.gif'); background-position: bottom right; background-repeat: no-repeat;">
												<img src="images/doll.png" width="280" height="462" border="0" alt=""/>
											</td>
										</tr>
									</table>
								</td>
								<td width="100%">
									<table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
										<tr>
											<td height="59" style="background-image: url('images/submenu_bg.gif'); background-repeat: repeat-x;">
												<table cellpadding="0" cellspacing="0" border="0" width="100%" height="59" style="background-image: url('images/submenu_rbg.gif'); background-position: top right; background-repeat: no-repeat;">
													<tr>
														<td style="padding-bottom: 18px;">
															<!-- SUBMENU -->															
																<table border="0" cellpadding="0" cellspacing="0">
																	<tr>
																		<xsl:call-template name="SUB-MENU"><xsl:with-param name="pageID" select="@ID"/></xsl:call-template>
																		<td><div style="width:5px; height:1px;"><spacer type="block" width="5" height="1"/></div></td>
																	</tr>
																</table>
															<!-- /SUBMENU -->
														</td>
													</tr>
												</table>
											</td>
										</tr>
										<tr>
											<td height="100%" valign="top" class="bg pageContent" style="padding: 15px 10px 15px 0;">
											<div class="text-header"><xsl:value-of select="@TITLE" disable-output-escaping="yes"/></div>
											<div style="width:1px; height:15px;"><spacer type="block" width="1" height="15"/></div>
											<xsl:apply-templates select="PAGE-CONTENT"/>
											</td>
										</tr>
										<tr><td height="19" align="right" style="background-image: url('images/bg_b.gif'); background-repeat: repeat-x;"><img src="images/bg_br.gif" border="0" alt=""/></td></tr>
									</table>
								</td>
								<td width="147"><div style="width:147px; height:1px;"><spacer type="block" width="147" height="1"/></div></td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</td>
	</tr>
	<tr>
		<td height="99" background="images/footer_bg.gif">
			<table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
				<tr>
					<td align="right" class="footer" style="padding-right: 170px;">
						<xsl:value-of select="COPYRIGHT" disable-output-escaping="yes"/>
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>
	</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" >
				<td valign="top" style="padding-top: 12px;"><img src="images/submenu_bullet.gif" border="0"/></td>
				<td width="5"></td>
				<td class="asubmenu">
					<span style="width:10px; height:1px;"><spacer type="block" width="10" height="1"/></span>
					<img src="images/submenu_tbullet.gif" border="0" alt="" style="margin-bottom: 3px;"/><br/>
					<xsl:value-of select="@TITLE" disable-output-escaping="yes"/>
				</td>
		</xsl:when>
		<xsl:otherwise>
			<xsl:if test="../MENU-ITEM[@ID=/LAYOUT/@ID] or ../../MENU-ITEM[@ID=/LAYOUT/@ID]">
				<td valign="top" style="padding-top: 12px;"><img src="images/submenu_bullet.gif" border="0"/></td>
				<td width="5"></td>
				<td>
					<a href="{@HREF}" class="submenu">
						<span style="width:10px; height:1px;"><spacer type="block" width="10" height="1"/></span>
						<img src="images/submenu_tbullet.gif" border="0" alt="" style="margin-bottom: 3px;"/><br/>
						<xsl:value-of select="@TITLE" disable-output-escaping="yes"/>
					</a>
				</td>
			</xsl:if>
		</xsl:otherwise>
	</xsl:choose>
	<xsl:if test="position()!=last()">
		<td width="10"><div style="width:5px; height:1px;"><spacer type="block" width="5" height="1"/></div></td>
		<td valign="top" style="padding-top: 10px;"><div class="submenu-separator" style="width:1px; height:10px;"><spacer type="block" width="1" height="10"/></div></td>
		<td width="10"><div style="width:5px; height:1px;"><spacer type="block" width="5" height="1"/></div></td>
	</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>
