<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"/>


<xsl:template match="@*|node()">
   <xsl:copy>
      <xsl:apply-templates select="@*|node()"/>
   </xsl:copy>
</xsl:template>

<xsl:variable name="lang" select="/page/@lang" />
<xsl:variable name="loc" select="document(concat('/strings/',$lang,'/strings.xml'))" />
<xsl:variable name="interview1" select="document(concat('/strings/',$lang,'/interview-cinematicteaser.xml'))" />
<xsl:variable name="storysofar" select="document(concat('/strings/',$lang,'/storysofar.xml'))" />
<xsl:variable name="terran" select="document(concat('/strings/',$lang,'/terran.xml'))" />
<xsl:variable name="protoss" select="document(concat('/strings/',$lang,'/protoss.xml'))" />
<xsl:variable name="zerg" select="document(concat('/strings/',$lang,'/zerg.xml'))" />
<xsl:variable name="heroes" select="document(concat('/strings/',$lang,'/heroes.xml'))" />
<xsl:variable name="planets" select="document(concat('/strings/',$lang,'/planets.xml'))" />

<xsl:template name="head-content" />
<xsl:template name="footer-content" />

<xsl:template match="page">
	<html>
	<head>

	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title><xsl:value-of select="$loc/strs/str[@id='sc2']"/></title>
	<!--<link rel="alternate" type="application/rss+xml" title="StarCraft2.com Updates RSS Feed" href="/strings/{$lang}/rss.xml" />-->
	<style type="text/css">
	@import url(/css/master.css);
	@import url(/css/language/<xsl:value-of select="$lang"/>.css);
		<xsl:choose>
			<xsl:when test="$lang='en_us'">@import url(/css/sifr.css);</xsl:when>
			<xsl:when test="$lang='ko_kr'">@import url(/css/sifr-kr.css);</xsl:when>
			<xsl:when test="$lang='ru_ru'">@import url(/css/sifr-ru.css);</xsl:when>
			<xsl:when test="$lang='de_de' or $lang='es_es' or $lang='fr_fr' or $lang='en_gb'">@import url(/css/sifr-eu.css);</xsl:when>
			<xsl:when test="$lang='zh_tw'">@import url(/css/sifr-zh.css);</xsl:when>
		</xsl:choose>
	<xsl:call-template name="styles" />
	</style>

	<xsl:call-template name="head-content"/>

	</head>
		
	<body>
		<div style="display:none;">
		<xsl:choose>
			<xsl:when test="$lang='en_us'">
				<div style="display:none;">
				<iframe src="http://view.atdmt.com/NTB/iview/800c7151009e409e950a7af0bd34d4d7/direct;wi.1;hi.1/01?click=" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" topmargin="0" leftmargin="0" allowtransparency="true" width="1" height="1">
				<script language="JavaScript" type="text/javascript">
				document.write('<a href="http://clk.atdmt.com/NTB/go/800c7151009e409e950a7af0bd34d4d7/direct;wi.1;hi.1/01/" target="_blank"><img src="http://view.atdmt.com/NTB/view/800c7151009e409e950a7af0bd34d4d7/direct;wi.1;hi.1/01/"/></a>');
				</script>
				<noscript>
				<a href="http://clk.atdmt.com/NTB/go/800c7151009e409e950a7af0bd34d4d7/direct;wi.1;hi.1/01/" target="_blank">
				<img border="0" src="http://view.atdmt.com/NTB/view/800c7151009e409e950a7af0bd34d4d7/direct;wi.1;hi.1/01/" />
				</a>
				</noscript>
				</iframe>
				</div>
			</xsl:when>
			<xsl:when test="$lang='ko_kr'">
				<iframe src="http://view.atdmt.com/NTB/iview/b7236e41aa1b44769be88154ac8ada87/direct;wi.1;hi.1/01?click=" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" topmargin="0" leftmargin="0" allowtransparency="true" width="1" height="1">
				<script language="JavaScript" type="text/javascript">
				document.write('<a href="http://clk.atdmt.com/NTB/go/b7236e41aa1b44769be88154ac8ada87/direct;wi.1;hi.1/01/" target="_blank"><img src="http://view.atdmt.com/NTB/view/b7236e41aa1b44769be88154ac8ada87/direct;wi.1;hi.1/01/"/></a>');
				</script>
				<noscript>
				<a href="http://clk.atdmt.com/NTB/go/b7236e41aa1b44769be88154ac8ada87/direct;wi.1;hi.1/01/" target="_blank">
				<img border="0" src="http://view.atdmt.com/NTB/view/b7236e41aa1b44769be88154ac8ada87/direct;wi.1;hi.1/01/" />
				</a>
				</noscript>
				</iframe>
			</xsl:when>
			<xsl:when test="$lang='de_de' or $lang='es_es' or $lang='fr_fr' or $lang='en_gb'">
				<iframe src="http://view.atdmt.com/NTB/iview/dd2714fec5f34818b0ebbba6cefb8db7/direct;wi.1;hi.1/01?click=" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" topmargin="0" leftmargin="0" allowtransparency="true" width="1" height="1">
				<script language="JavaScript" type="text/javascript">
				document.write('<a href="http://clk.atdmt.com/NTB/go/dd2714fec5f34818b0ebbba6cefb8db7/direct;wi.1;hi.1/01/" target="_blank"><img src="http://view.atdmt.com/NTB/view/dd2714fec5f34818b0ebbba6cefb8db7/direct;wi.1;hi.1/01/"/></a>');
				</script>
				<noscript>
				<a href="http://clk.atdmt.com/NTB/go/dd2714fec5f34818b0ebbba6cefb8db7/direct;wi.1;hi.1/01/" target="_blank">
				<img border="0" src="http://view.atdmt.com/NTB/view/dd2714fec5f34818b0ebbba6cefb8db7/direct;wi.1;hi.1/01/" />
				</a>
				</noscript>
				</iframe>
			</xsl:when>
		</xsl:choose>
	</div>
	<script type="text/javascript" src="/js/detection.js"></script>
	<script type="text/javascript" src="/js/functions.js"></script>
	<script type="text/javascript" src="/js/tooltip.js"></script>


	<!-- A bug in the display of the KR fonts with the newest version of siFR forces us to keep using the old version of the script for the KR language only -->
	<xsl:choose>
		<xsl:when test="$lang='ko_kr'">
			<script type="text/javascript" src="/js/sifr-kr.js"></script>
        </xsl:when>
        <xsl:otherwise>
        	<script type="text/javascript" src="/js/sifr.js"></script>
		</xsl:otherwise>
	</xsl:choose>


	<xsl:choose>
		<xsl:when test="$lang='en_us'"><script type="text/javascript" src="/js/sifr-config.js"></script></xsl:when>
		<xsl:when test="$lang='ko_kr'"><script type="text/javascript" src="/js/sifr-config-kr.js"></script></xsl:when>
		<!--<xsl:when test="$lang='ru_ru'"><script type="text/javascript" src="/js/sifr-config-ru.js"></script></xsl:when>-->
		<xsl:when test="$lang='zh_tw'"><script type="text/javascript" src="/js/sifr-config-zh.js"></script></xsl:when>
		<xsl:when test="$lang='de_de' or $lang='es_es' or $lang='fr_fr' or $lang='en_gb'"><script type="text/javascript" src="/js/sifr-config-eu.js"></script></xsl:when>
	</xsl:choose>
	
	<script type="text/javascript">
	//set the mediahost var
	var mediahost = "<xsl:value-of select="$loc/strs/str[@id='sc2.mediahost']"/>";
	
	//<![CDATA[
	if (is_ie6 && !is_ie7)
    document.write('<link rel="stylesheet" type="text/css" media="screen, projection" href="/css/ie.css" />');
	if (is_ie7)
    document.write('<link rel="stylesheet" type="text/css" media="screen, projection" href="/css/ie7.css" />');
	if (is_opera)
    document.write('<link rel="stylesheet" type="text/css" media="screen, projection" href="/css/opera.css" />');
	if (is_safari)
    document.write('<link rel="stylesheet" type="text/css" media="screen, projection" href="/css/safari.css" />');
	//]]>
	</script>		
	
		<div id="loader">Loading</div>
		
		<div class="bg-top">
	  <xsl:choose>
				<xsl:when test="/page/frontpage">
					<xsl:call-template name="header"/>
				</xsl:when>
			</xsl:choose>
			
			<div class="page">
			
			<xsl:choose>
				<xsl:when test="/page/frontpage"><div class="nav nav-frontpage"><xsl:call-template name="nav" /></div></xsl:when>
				<xsl:otherwise>
					<div class="header">
						<div class="logo"><a href="/"></a></div>
						<xsl:call-template name="header"/>
					</div>
				  <div class="nav"><xsl:call-template name="nav" /></div>
				</xsl:otherwise>
			</xsl:choose>
		    <xsl:apply-templates/>
		</div>
		</div>

<xsl:choose>
<xsl:when test="/page/frontpage">
<div class="footer-frontpage">
	<div>
		<div>
			<div>
				<div class="footer-content">
					<xsl:choose>
						<xsl:when test="$lang='en_us'">
							<div class="logo-esrbprivacy"><a href="http://www.blizzard.com/privacy.shtml" alt="{$loc/strs/str[@id='sc2.labels.sc2.labels.privacypolicy']}" title=""></a></div>
							<div class="logo-esrbrating"><a href="http://www.esrb.org/ratings/ratings_guide.jsp" alt="" title=""></a></div>
						</xsl:when>
					</xsl:choose>
					<div class="logo-blizz"><a href="{$loc/strs/str[@id='sc2.link.blizzardmain']}" alt="{$loc/strs/str[@id='sc2.labels.blizzardlink']}" title=""></a></div>
					<div class="logo-bnet"><a href="{$loc/strs/str[@id='sc2.link.bnet']}" alt="{$loc/strs/str[@id='sc2.labels.bnetlink']}" title=""></a></div>
					
					<div class="copyright">
						<xsl:choose>
							<xsl:when test="$lang='zh_tw' or $lang='zh_cn'">
								<xsl:value-of select="$loc/strs/str[@id='sc2.labels.copyright1']"/> | <a href="{$loc/strs/str[@id='sc2.link.legalfaq']}"><xsl:value-of select="$loc/strs/str[@id='sc2.labels.copyright2']"/></a> | <xsl:value-of select="$loc/strs/str[@id='sc2.labels.copyright3']"/>
							</xsl:when>
							<xsl:otherwise>
								<xsl:if test="$lang='en_us'"><a href="{$loc/strs/str[@id='sc2.link.privacypolicy']}"><xsl:value-of select="$loc/strs/str[@id='sc2.labels.privacypolicy']"/></a> / </xsl:if>
								<a href="{$loc/strs/str[@id='sc2.link.legalfaq']}"><xsl:value-of select="$loc/strs/str[@id='sc2.labels.copyright']"/></a>
							</xsl:otherwise>										
						</xsl:choose>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>

</xsl:when>
<xsl:otherwise>

<table class="footer-table">
	<tr>
		<td class="footer-left"></td>
		<td>
			<div class="footer">
				<div>
					<div>
						<div>
							<div class="footer-content">
								<div class="logos">
									<xsl:choose>
										<xsl:when test="$lang='en_us'">
											<div class="logo-esrbprivacy"><a href="http://us.blizzard.com/en-us/company/about/privacy.html"><img src="/images/layout/privacy_certified-2008.gif" alt="{$loc/strs/str[@id='sc2.labels.sc2.labels.privacypolicy']}" title="" /></a></div>
											<div class="logo-esrbrating"><a href="http://www.esrb.org/ratings/ratings_guide.jsp"><img src="/images/layout/logo-esrb2.gif" alt="" title="" /></a></div>
										</xsl:when>
									</xsl:choose>
									<div class="logo-blizz"><a href="{$loc/strs/str[@id='sc2.link.blizzardmain']}" alt="{$loc/strs/str[@id='sc2.labels.blizzardlink']}" title=""></a></div>
									<div class="logo-bnet"><a href="{$loc/strs/str[@id='sc2.link.bnet']}" alt="{$loc/strs/str[@id='sc2.labels.bnetlink']}" title=""></a></div>
								</div>
																
								<div class="copyright">
									<xsl:choose>
										<xsl:when test="$lang='zh_tw'">
											<a href="{$loc/strs/str[@id='sc2.link.privacypolicy']}"><xsl:value-of select="$loc/strs/str[@id='sc2.labels.copyright2']"/></a> | <a href="{$loc/strs/str[@id='sc2.link.legalfaq']}"><xsl:value-of select="$loc/strs/str[@id='sc2.labels.copyright1']"/></a> | <xsl:value-of select="$loc/strs/str[@id='sc2.labels.copyright3']"/>
										</xsl:when>
										<xsl:otherwise>
											<xsl:if test="$lang='en_us'"><a href="{$loc/strs/str[@id='sc2.link.privacypolicy']}"><xsl:value-of select="$loc/strs/str[@id='sc2.labels.privacypolicy']"/></a> | </xsl:if>
											<a href="{$loc/strs/str[@id='sc2.link.legalfaq']}"><xsl:value-of select="$loc/strs/str[@id='sc2.labels.copyright']"/></a>
										</xsl:otherwise>										
									</xsl:choose>									
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</td>
		<td class="footer-right"></td>
	</tr>
</table>
</xsl:otherwise>
</xsl:choose>
<xsl:call-template name="footer-content"/>

	
<script type="text/javascript" src="http://www.google-analytics.com/ga.js"></script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-544112-19");
pageTracker._setDomainName("starcraft2.com");
pageTracker._initData();
pageTracker._trackPageview();
</script>

	</body>
	</html>
</xsl:template>


<!-- ######## Flash Template (used for flash objects) ################################################ -->

<xsl:template name="flash">
	<xsl:param name="id" />
	<xsl:param name="width" />
	<xsl:param name="height" />
	<xsl:param name="src" />
   	<xsl:param name="quality" />
	<xsl:param name="base" />
	<xsl:param name="flashvars" />
	<xsl:param name="bgcolor" />
	<xsl:param name="menu" />
	<xsl:param name="wmode" />
	<xsl:param name="noflash" />
	<xsl:param name="allowScriptAccess" />	
	<xsl:param name="allowFullScreen" />	   	

		<div id="{$id}"></div>
		<script type="text/javascript">
		var flashId="<xsl:value-of select='$id'/>";
		printFlash("<xsl:value-of select='$id'/>", "<xsl:value-of select='$src'/>", "<xsl:value-of select='$wmode'/>", "<xsl:value-of select='$menu'/>", "<xsl:value-of select='$bgcolor'/>", "<xsl:value-of select='$width'/>", "<xsl:value-of select='$height'/>", "<xsl:value-of select='$quality'/>", "<xsl:value-of select='$base'/>", "<xsl:value-of select='$flashvars'/>", "<xsl:value-of select='$noflash'/>", "<xsl:value-of select='$allowScriptAccess'/>", "<xsl:value-of select='$allowFullScreen'/>")
		</script>	
	
</xsl:template>


<xsl:template name="sifr-ajax">

<script type="text/javascript">

<xsl:choose>
<xsl:when test="$lang='en_us'">

 sIFR.replace(bebas, {
  selector: 'h4'
  ,wmode: 'transparent'
  ,css: {
	  '.sIFR-root': { 'color': '#ffffff', 'letter-spacing': -1.5, 'text-transform': 'uppercase', 'font-size': '36px' },
	  'em': { 'color': '#c0fffd', 'font-style': 'none' }
	  }
  ,selectable: true
  ,tuneHeight: '0'
  ,offsetTop: '0'
  ,filters: {
      DropShadow: {
        knockout: false
        ,distance: 1
        ,color: '#000000'
        ,strength: 2
      }
    }
});</xsl:when>


<xsl:when test="$lang='ko_kr' or $lang='zh_tw' or $lang='ru_ru'">

 sIFR.replace(gulim, {
  selector: 'h4'
  ,wmode: 'transparent'
  ,css: {
	  '.sIFR-root': { 'color': '#ffffff', 'letter-spacing': 0, 'text-transform': 'uppercase', 'font-size': '36px' },
	  'em': { 'color': '#c0fffd', 'font-style': 'none' }
	  }
  ,selectable: false
  ,tuneHeight: '0'
  ,offsetTop: '0'
  ,filters: {
      DropShadow: {
        knockout: false
        ,distance: 1
        ,color: '#000000'
        ,strength: 2
      }
    }
});</xsl:when>

<xsl:when test="$lang='de_de' or $lang='es_es' or $lang='fr_fr' or $lang='en_gb'">

 sIFR.replace(bluehighway, {
	  selector: 'h4'
	  ,wmode: 'transparent'
	  ,css: {
		  '.sIFR-root': { 'color': '#ffffff', 'letter-spacing': 0, 'text-transform': 'uppercase', 'font-size': '59px' },
		  'em': { 'color': '#c0fffd', 'font-style': 'none' }
		  }
	  ,selectable: true
	  ,tuneHeight: '0'
	  ,offsetTop: '0'
	  ,filters: {
		  DropShadow: {
			knockout: false
			,distance: 1
			,color: '#000000'
			,strength: 2
		  }
		}
	});</xsl:when>
</xsl:choose>

</script>
</xsl:template>


<xsl:template name="features-module">
            <xsl:param name="title"></xsl:param>
			<xsl:param name="url"></xsl:param>
			<xsl:param name="background"></xsl:param>
			<xsl:param name="month"></xsl:param>
			<xsl:param name="day"></xsl:param>
			<xsl:param name="year"></xsl:param>
			<xsl:param name="category"></xsl:param>	
			<div class="subhead">
            <div style="background:url({$background})" class="features-module-header-unit" onclick="javascript:location.href='{$url}'">
                <h5>
                    <xsl:value-of select="$title" />
                    <!--<span class="catdate">
                        <xsl:value-of select="$category" />
                        <xsl:call-template name="date">
                            <xsl:with-param name="month" select="$month" />
                            <xsl:with-param name="day" select="$day" />
                            <xsl:with-param name="year" select="$year" />
                        </xsl:call-template>
                    </span>-->
                </h5>
            </div>
            </div>			
</xsl:template>

<xsl:template name="features-1">
            <xsl:param name="title"></xsl:param>
			<xsl:param name="url"></xsl:param>
			<xsl:param name="image"></xsl:param>
			<xsl:param name="month"></xsl:param>
			<xsl:param name="day"></xsl:param>
			<xsl:param name="year"></xsl:param>
			<xsl:param name="category"></xsl:param>
			<xsl:param name="description"></xsl:param>	
			<div class="primary-bg" style="background-image:url(images/{$image}.jpg);" onmouseover="this.style.backgroundPosition='0 -281px'" onmouseout="this.style.backgroundPosition='0 0'" onClick="javascript:window.location.href='{$url}'">
				<div class="primary-bl">
					<div class="primary-tealbg tealbg">
						<div class="bluecorner-t png"></div><div class="bluecorner-b png"></div>
						<div>
							<h5><a href="{$url}"><xsl:value-of select="$title" /></a></h5>
							<h6><xsl:value-of select="$category" /> | 
							<xsl:call-template name="date">
								<xsl:with-param name="month" select="$month" />
								<xsl:with-param name="day" select="$day" />
								<xsl:with-param name="year" select="$year" />
							</xsl:call-template></h6>
							<div></div>
							<span><xsl:apply-templates select="$description" /></span>						</div>
					</div>
				</div>
			</div>
			
			
</xsl:template>

<xsl:template name="features-2">
            <xsl:param name="title"></xsl:param>
			<xsl:param name="url"></xsl:param>
			<xsl:param name="image"></xsl:param>
			<xsl:param name="month"></xsl:param>
			<xsl:param name="day"></xsl:param>
			<xsl:param name="year"></xsl:param>
			<xsl:param name="category"></xsl:param>
			<xsl:param name="description"></xsl:param>
			<span class="section"><xsl:value-of select="$loc/strs/str[@id='sc2.features.recent']"/></span>
			<div class="section-hr"></div>
			<div class="left" style="background:url(images/{$image}-s.jpg) 0 0 no-repeat;" onmouseover="this.style.backgroundPosition='0 -113px'" onmouseout="this.style.backgroundPosition='0 0'" onClick="javascript:window.location.href='{$url}'">
				<div class="secondary-tealbg tealbg">
					<h5><a href="{$url}"><xsl:value-of select="$title" /></a></h5>
					<h6><xsl:value-of select="$category" /> | 
					<xsl:call-template name="date">
						<xsl:with-param name="month" select="$month" />
						<xsl:with-param name="day" select="$day" />
						<xsl:with-param name="year" select="$year" />
					</xsl:call-template></h6>
				</div>
			</div>
</xsl:template>

<xsl:template name="features-3">
            <xsl:param name="title"></xsl:param>
			<xsl:param name="url"></xsl:param>
			<xsl:param name="image"></xsl:param>
			<xsl:param name="month"></xsl:param>
			<xsl:param name="day"></xsl:param>
			<xsl:param name="year"></xsl:param>
			<xsl:param name="category"></xsl:param>
			<xsl:param name="description"></xsl:param>
			<div class="right iefloatright" style="background:url(images/{$image}-s.jpg) 0 0 no-repeat;" onmouseover="this.style.backgroundPosition='0 -113px'" onmouseout="this.style.backgroundPosition='0 0'" onClick="javascript:window.location.href='{$url}'">
				<div class="secondary-tealbg tealbg">
					<h5><a href="{$url}"><xsl:value-of select="$title" /></a></h5>
					<h6><xsl:value-of select="$category" /> | 
					<xsl:call-template name="date">
						<xsl:with-param name="month" select="$month" />
						<xsl:with-param name="day" select="$day" />
						<xsl:with-param name="year" select="$year" />
					</xsl:call-template></h6>
				</div>
			</div>
			<div class="clear"></div>
</xsl:template>

<xsl:template name="features-4">
            <xsl:param name="title"></xsl:param>
			<xsl:param name="url"></xsl:param>
			<xsl:param name="image"></xsl:param>
			<xsl:param name="month"></xsl:param>
			<xsl:param name="day"></xsl:param>
			<xsl:param name="year"></xsl:param>
			<xsl:param name="category"></xsl:param>
			<xsl:param name="description"></xsl:param>
			<li class="tertiary-bg" onmouseover="this.className='tertiary-bg-hover'" onmouseout="this.className='tertiary-bg'" onClick="javascript:window.location.href='{$url}'"><div><h5><a href="{$url}"><xsl:value-of select="$title" /></a>&#160;&#160;<xsl:value-of select="$category" /></h5> <h6>
			<xsl:call-template name="date">
				<xsl:with-param name="month" select="$month" />
				<xsl:with-param name="day" select="$day" />
				<xsl:with-param name="year" select="$year" />
			</xsl:call-template></h6></div></li>
</xsl:template>

<xsl:template name="features-soon">
            <xsl:param name="title"></xsl:param>
			<xsl:param name="url"></xsl:param>
			<xsl:param name="image"></xsl:param>
			<xsl:param name="month"></xsl:param>
			<xsl:param name="day"></xsl:param>
			<xsl:param name="year"></xsl:param>
			<xsl:param name="category"></xsl:param>
			<xsl:param name="description"></xsl:param>
			<li class="tertiary-bg"><div><h5><span class="soon"><xsl:value-of select="$title" /></span></h5> <h6>
			<xsl:call-template name="date">
				<xsl:with-param name="month" select="$month" />
				<xsl:with-param name="day" select="$day" />
				<xsl:with-param name="year" select="$year" />
			</xsl:call-template></h6></div></li>
</xsl:template>


<xsl:template name="date">
			<xsl:param name="month"></xsl:param>
			<xsl:param name="day"></xsl:param>
			<xsl:param name="year"></xsl:param>

			<xsl:variable name="monthFormatted"><xsl:number value="$month" format="01" /></xsl:variable>
			<xsl:variable name="dayFormatted"><xsl:number value="$day" format="01" /></xsl:variable>
			<xsl:variable name="yearFormatted">20<xsl:number value="$year" format="01" /></xsl:variable>

			<xsl:choose>
				<xsl:when test = "$lang = 'en_us' or $lang='zh_tw'"><xsl:value-of select="$monthFormatted" />.<xsl:value-of select="$dayFormatted" />.<xsl:value-of select="$yearFormatted" /></xsl:when>
				<xsl:when test = "$lang = 'de_de'"><xsl:value-of select="$dayFormatted" />.<xsl:value-of select="$monthFormatted" />.<xsl:value-of select="$yearFormatted" /></xsl:when>
				<xsl:when test = "$lang = 'en_gb'"><xsl:value-of select="$dayFormatted" />.<xsl:value-of select="$monthFormatted" />.<xsl:value-of select="$yearFormatted" /></xsl:when>		  
				<xsl:when test = "$lang = 'es_es'"><xsl:value-of select="$dayFormatted" />.<xsl:value-of select="$monthFormatted" />.<xsl:value-of select="$yearFormatted" /></xsl:when>		
				<xsl:when test = "$lang = 'fr_fr'"><xsl:value-of select="$dayFormatted" />.<xsl:value-of select="$monthFormatted" />.<xsl:value-of select="$yearFormatted" /></xsl:when>
				<xsl:when test = "$lang = 'ko_kr' or $lang='zh_tw'"><xsl:value-of select="$yearFormatted" />.<xsl:value-of select="$monthFormatted" />.<xsl:value-of select="$dayFormatted" /></xsl:when>	
			</xsl:choose>
</xsl:template>


<xsl:template name="movies-entry">
            <xsl:param name="title"></xsl:param>
			<xsl:param name="movieid"></xsl:param>
			<xsl:param name="month"></xsl:param>
			<xsl:param name="day"></xsl:param>
			<xsl:param name="year"></xsl:param>
			<xsl:param name="format"></xsl:param>			
			<xsl:param name="filesize"></xsl:param>
			<xsl:param name="url-pc"></xsl:param>
			<xsl:param name="url-mac"></xsl:param>
			<xsl:param name="filesize-2"></xsl:param>
			<xsl:param name="url-pc-2"></xsl:param>
			<xsl:param name="url-mac-2"></xsl:param>			
			
			<a name="m{$movieid}"></a>
			<div class="thumb" style="background-image:url(/images/movies/ss{$movieid}-thumb.jpg);"></div>
			<dl class="movie-entry">
				<dt><xsl:value-of select="$title" /></dt>
				<dd>
					<ul>
						<li><strong><xsl:value-of select="$loc/strs/str[@id='sc2.labels.movies.dateadded']"/><xsl:value-of select="$loc/strs/str[@id='sc2.colon']"/></strong>&#160;<xsl:call-template name="date">
							<xsl:with-param name="month" select="$month" />
							<xsl:with-param name="day" select="$day" />
							<xsl:with-param name="year" select="$year" />
						</xsl:call-template>
						</li>
						<xsl:choose>
							<xsl:when test = "$format = 'divx'">
								<li><strong><xsl:value-of select="$loc/strs/str[@id='sc2.labels.movies.format']"/><xsl:value-of select="$loc/strs/str[@id='sc2.colon']"/></strong>&#160;<xsl:apply-templates select="$loc/strs/str[@id='sc2.labels.movies.format.divx']"/></li>
								<li><strong><xsl:value-of select="$loc/strs/str[@id='sc2.labels.movies.requires']"/><xsl:value-of select="$loc/strs/str[@id='sc2.colon']"/></strong>&#160;<xsl:apply-templates select="$loc/strs/str[@id='sc2.labels.movies.requires.divx']"/></li>
							</xsl:when>
							<xsl:when test = "$format = 'xvid'">
									<li><strong><xsl:value-of select="$loc/strs/str[@id='sc2.labels.movies.format']"/><xsl:value-of select="$loc/strs/str[@id='sc2.colon']"/></strong>&#160;<xsl:apply-templates select="$loc/strs/str[@id='sc2.labels.movies.format.xvid']"/></li>
									<li><strong><xsl:value-of select="$loc/strs/str[@id='sc2.labels.movies.requires']"/><xsl:value-of select="$loc/strs/str[@id='sc2.colon']"/></strong>&#160;<xsl:apply-templates select="$loc/strs/str[@id='sc2.labels.movies.requires.xvid']"/></li>
							</xsl:when>						
						</xsl:choose>							
						
					</ul>

						<div class="fileinfo1">
							<small><xsl:value-of select="$filesize"/><xsl:apply-templates select="$loc/strs/str[@id='sc2.labels.movies.size.megabytes']"/></small><br />
							<strong style="color: #FFFFFF;"><xsl:value-of select="$loc/strs/str[@id='sc2.labels.movies.download']"/><xsl:value-of select="$loc/strs/str[@id='sc2.colon']"/>&#160;&#160;</strong><a href="{$url-pc}" title="{$loc/strs/str[@id='sc2.labels.movies.download.pc']}"><img src="/images/layout/button-pc.png" style="vertical-align: middle;"/></a><a href="{$url-mac}" title="{$loc/strs/str[@id='sc2.labels.movies.download.mac']}"><img src="/images/layout/button-mac.png" style="vertical-align: middle;"/></a>
						</div>


						<xsl:choose>
							<xsl:when test="$filesize-2">
						<div class="fileinfo2">
							<small><xsl:value-of select="$filesize-2"/><xsl:apply-templates select="$loc/strs/str[@id='sc2.labels.movies.size.megabytes']"/></small><br />
							<strong style="color: #FFFFFF;"><xsl:value-of select="$loc/strs/str[@id='sc2.labels.movies.download']"/><xsl:value-of select="$loc/strs/str[@id='sc2.colon']"/>&#160;&#160;</strong><a href="{$url-pc-2}" title="{$loc/strs/str[@id='sc2.labels.movies.download.pc']}"><img src="/images/layout/button-pc.png" style="vertical-align: middle;"/></a><a href="{$url-mac-2}" title="{$loc/strs/str[@id='sc2.labels.movies.download.mac']}"><img src="/images/layout/button-mac.png" style="vertical-align: middle;"/></a>	
						</div>
						</xsl:when>	
						</xsl:choose>



				</dd>				


			</dl>
</xsl:template>



<xsl:template name="wwi-entry">
            <xsl:param name="title"></xsl:param>
			<xsl:param name="movieid"></xsl:param>
			<xsl:param name="filesize"></xsl:param>
			<xsl:param name="url-pc"></xsl:param>
			<xsl:param name="url-mac"></xsl:param>
			<a name="wwi{$movieid}"></a>
			<li onmouseover="this.className='wwi-hover'" onmouseout="this.className='wwi-normal'">
				<div style="background:url(/images/layout/movies-wwibullet{$movieid}.gif) 0 0 no-repeat;">
					<dl>
						<dt><xsl:apply-templates select="$title"/></dt>
						<dd><xsl:value-of select="$filesize" /><xsl:apply-templates select="$loc/strs/str[@id='sc2.labels.movies.size.megabytes']"/> | <xsl:apply-templates select="$loc/strs/str[@id='sc2.labels.movies.format.divx']"/> | <xsl:value-of select="$loc/strs/str[@id='sc2.labels.movies.download']"/><xsl:value-of select="$loc/strs/str[@id='sc2.colon']"/>&#160;<a href="/movies{$url-pc}" title="{$loc/strs/str[@id='sc2.labels.movies.download.pc']}"><img src="/images/layout/button-pc.png"/></a> <a href="/movies{$url-mac}" title="{$loc/strs/str[@id='sc2.labels.movies.download.mac']}"><img src="/images/layout/button-mac.png"/></a></dd>
					</dl>
				</div>
			</li>
</xsl:template>



<xsl:template name="wallpaper-entry">
            <xsl:param name="title"></xsl:param>
			<xsl:param name="wallid"></xsl:param>
			
			<a name="w{$wallid}"></a>
			<div class="thumb" style="background-image:url(/images/wallpapers/wall{$wallid}/wall{$wallid}-thumb.jpg);"><a href="#" onclick="fiatLux('/images/wallpapers/wall{$wallid}/wall{$wallid}-800x600.jpg'); return false"></a></div>
			<dl>
				<dt><xsl:apply-templates select="$title"/></dt>
				<dd>
					<ul>
					<li><a href="/images/wallpapers/wall{$wallid}/wall{$wallid}-800x600.jpg" target="_blank">800 x 600</a></li>
					<li><a href="/images/wallpapers/wall{$wallid}/wall{$wallid}-1024x768.jpg" target="_blank">1024 x 768</a></li>
					<li><a href="/images/wallpapers/wall{$wallid}/wall{$wallid}-1280x960.jpg" target="_blank">1280 x 960</a></li>
					<li><a href="/images/wallpapers/wall{$wallid}/wall{$wallid}-1280x1024.jpg" target="_blank">1280 x 1024</a></li>
					<li><a href="/images/wallpapers/wall{$wallid}/wall{$wallid}-1600x1200.jpg" target="_blank">1600 x 1200</a></li>
					<li><a href="/images/wallpapers/wall{$wallid}/wall{$wallid}-1680x1050.jpg" target="_blank">1680 x 1050</a></li>
					<li><a href="/images/wallpapers/wall{$wallid}/wall{$wallid}-1920x1200.jpg" target="_blank">1920 x 1200</a></li>
					</ul>
				</dd>				
			</dl>
</xsl:template>


<xsl:template name="nav-terran">
	<xsl:param name="title"></xsl:param>
	<div class="racenav-container" style="background-image:url(/features/terran/images/bg-{$title}-nav.jpg);"><q><q><div class="icon-terran"><a href="index.xml"></a></div>
			<div class="smallicons">
				<div class="icon-smallprotoss"><a href="/features/protoss/"></a></div>
				<div class="icon-smallzerg"><a href="/features/zerg/"></a></div>
			</div>
			<div class="newnav">
				<div>
					<h6><xsl:value-of select="$loc/strs/str[@id='sc2.labels.features.units']"/></h6>
					<ul>
						<li><a href="marine.xml"><xsl:value-of select="$terran/strs/str[@id='sc2.features.terran.units.marine']"/></a></li>
						<li><a href="reaper.xml"><xsl:value-of select="$terran/strs/str[@id='sc2.features.terran.units.reaper']"/></a></li>
						<li><a href="ghost.xml"><xsl:value-of select="$terran/strs/str[@id='sc2.features.terran.units.ghost']"/></a></li>
					</ul>
					<ul>
						<li><a href="viking.xml"><xsl:value-of select="$terran/strs/str[@id='sc2.features.terran.units.viking']"/></a></li>
						<li><a href="banshee.xml"><xsl:value-of select="$terran/strs/str[@id='sc2.features.terran.units.banshee']"/></a></li>
						<li><a href="thor.xml"><xsl:value-of select="$terran/strs/str[@id='sc2.features.terran.units.thor']"/></a></li>
					</ul>
					<ul>
						<li><a href="battlecruiser.xml"><xsl:value-of select="$terran/strs/str[@id='sc2.features.terran.units.battlecruiser']"/></a></li>
						<li><a href="nomad.xml"><xsl:value-of select="$terran/strs/str[@id='sc2.features.terran.units.nomad']"/></a></li>
						<li><a href="siegetank.xml"><xsl:value-of select="$terran/strs/str[@id='sc2.features.terran.units.siegetank']"/></a></li>
					</ul>
				</div>		
		
				<div>
					<h6><xsl:value-of select="$loc/strs/str[@id='sc2.labels.features.buildings']"/></h6>
					<ul>
						<li><a href="commandcenter.xml"><xsl:value-of select="$terran/strs/str[@id='sc2.features.terran.buildings.commandcenter']"/></a></li>
						<li><a href="sensortower.xml"><xsl:value-of select="$terran/strs/str[@id='sc2.features.terran.buildings.sensortower']"/></a></li>
					</ul>
				</div>
				
				<div>
					<h6><xsl:value-of select="$loc/strs/str[@id='sc2.labels.features.heroes']"/></h6>
					<ul>
						<li><a href="/features/heroes/raynor.xml"><xsl:value-of select="$heroes/strs/str[@id='sc2.features.heroes.raynor']"/></a></li>
						<li><a href="/features/heroes/tychus.xml"><xsl:value-of select="$heroes/strs/str[@id='sc2.features.heroes.tychus']"/></a></li>
					</ul>
				</div>
			</div>		
			<div class="clear"></div>
		
		</q></q></div>
</xsl:template>




<xsl:template name="nav-protoss">
	<xsl:param name="title"></xsl:param>
	<div class="racenav-container" style="background-image:url(/features/protoss/images/bg-{$title}-nav.jpg);"><q><q><div class="icon-protoss"><a href="index.xml"></a></div>
			<div class="smallicons">
				<div class="icon-smallterran"><a href="/features/terran/"></a></div>
				<div class="icon-smallzerg"><a href="/features/zerg/"></a></div>
			</div>
			<div class="newnav">
				<div>
					<h6><xsl:value-of select="$loc/strs/str[@id='sc2.labels.features.units']"/></h6>
					<ul>
						<li><a href="zealot.xml"><xsl:value-of select="$protoss/strs/str[@id='sc2.features.protoss.units.zealot']"/></a></li>
						<li><a href="immortal.xml"><xsl:value-of select="$protoss/strs/str[@id='sc2.features.protoss.units.immortal']"/></a></li>
						<li><a href="stalker.xml"><xsl:value-of select="$protoss/strs/str[@id='sc2.features.protoss.units.stalker']"/></a></li>
					</ul>
					<ul>
						<li><a href="phaseprism.xml"><xsl:value-of select="$protoss/strs/str[@id='sc2.features.protoss.units.phaseprism']"/></a></li>
						<li><a href="phoenix.xml"><xsl:value-of select="$protoss/strs/str[@id='sc2.features.protoss.units.phoenix']"/></a></li>
						<li><a href="colossus.xml"><xsl:value-of select="$protoss/strs/str[@id='sc2.features.protoss.units.colossus']"/></a></li>

					</ul>
					<ul>
						<li><a href="warpray.xml"><xsl:value-of select="$protoss/strs/str[@id='sc2.features.protoss.units.warpray']"/></a></li>
						<li><a href="twilightarchon.xml"><xsl:value-of select="$protoss/strs/str[@id='sc2.features.protoss.units.twilightarchon']"/></a></li>
						<li><a href="darktemplar.xml"><xsl:value-of select="$protoss/strs/str[@id='sc2.features.protoss.units.darktemplar']"/></a></li>
					</ul>
					<ul>
						<li><a href="mothership.xml"><xsl:value-of select="$protoss/strs/str[@id='sc2.features.protoss.units.mothership']"/></a></li>
						<li><a href="carrier.xml"><xsl:value-of select="$protoss/strs/str[@id='sc2.features.protoss.units.carrier']"/></a></li>
						<li><a href="observer.xml"><xsl:value-of select="$protoss/strs/str[@id='sc2.features.protoss.units.observer']"/></a></li>
					</ul>
				</div>		
		
				<div>
					<h6><xsl:value-of select="$loc/strs/str[@id='sc2.labels.features.buildings']"/></h6>
					<ul>
						<li><a href="gateway.xml"><xsl:value-of select="$protoss/strs/str[@id='sc2.features.protoss.buildings.gateway']"/></a></li>
						<li><a href="stargate.xml"><xsl:value-of select="$protoss/strs/str[@id='sc2.features.protoss.buildings.stargate']"/></a></li>
					</ul>
				</div>
			</div>		
			<div class="clear"></div>
		
		</q></q></div>
</xsl:template>

		
<xsl:template name="nav-zerg">
	<xsl:param name="title"></xsl:param>
	<div class="racenav-container" style="background-image:url(/features/zerg/images/bg-{$title}-nav.jpg);"><q><q><div class="icon-zerg"><a href="index.xml"></a></div>
		<div class="smallicons">
			<div class="icon-smallterran"><a href="/features/terran/"></a></div>
			<div class="icon-smallprotoss"><a href="/features/protoss/"></a></div>
		</div>
		<div class="newnav">
			<div>
				<h6><xsl:value-of select="$loc/strs/str[@id='sc2.labels.features.units']"/></h6>
				<ul>
					<li><a href="hydralisk.xml"><xsl:value-of select="$zerg/strs/str[@id='sc2.features.zerg.units.hydralisk']"/></a></li>
					<li><a href="mutalisk.xml"><xsl:value-of select="$zerg/strs/str[@id='sc2.features.zerg.units.mutalisk']"/></a></li>
				</ul>
				<ul>
					<li><a href="baneling.xml"><xsl:value-of select="$zerg/strs/str[@id='sc2.features.zerg.units.baneling']"/></a></li>
				</ul>
			</div>
		</div>		
		<div class="clear"></div>
	</q></q></div>
</xsl:template>


<xsl:template name="nav-universe">
	<xsl:param name="title"></xsl:param>
	<div class="racenav-container" style="background-image:url(images/bg-{$title}-nav.jpg);"><q><q><!--<div class="icon-universe"><a href="/features/index.xml"></a></div>-->
			<div class="newnav">
				<div>
					<h6><xsl:value-of select="$loc/strs/str[@id='sc2.labels.universe.story.title']"/></h6>
					<ul>
						<li><a href="/features/storysofar.xml"><xsl:value-of select="$loc/strs/str[@id='sc2.labels.universe.story.storysofar1']"/></a></li>
						<li><a href="/features/storysofar2.xml"><xsl:value-of select="$loc/strs/str[@id='sc2.labels.universe.story.storysofar2']"/></a></li>
					</ul>
				</div>		
		
				<div>
					<h6><xsl:value-of select="$loc/strs/str[@id='sc2.labels.universe.bios.title']"/></h6>
					<ul>
						<li><a href="/features/heroes/raynor.xml"><xsl:value-of select="$loc/strs/str[@id='sc2.labels.universe.bios.jimraynor']"/></a></li>
						<li><a href="/features/heroes/zeratul.xml"><xsl:value-of select="$heroes/strs/str[@id='sc2.features.heroes.zeratul']"/></a></li>
					</ul>
				</div>
				
				<div>
					<h6><xsl:value-of select="$loc/strs/str[@id='sc2.labels.universe.planets.title']"/></h6>
					<ul>
						<li><a href="/features/planets/char.xml"><xsl:value-of select="$planets/strs/str[@id='sc2.features.planets.char']"/></a></li>
						<li><a href="/features/planets/marsara.xml"><xsl:value-of select="$planets/strs/str[@id='sc2.features.planets.marsara']"/></a></li>
					</ul>
				</div>
				<!--<div>
					<h6><xsl:value-of select="$loc/strs/str[@id='sc2.labels.universe.races.title']"/></h6>
					<ul>
						<li><a href="/features/protoss/index.xml"><xsl:value-of select="$loc/strs/str[@id='sc2.labels.universe.races.protoss']"/></a></li>
						<li><a href="/features/terran/index.xml"><xsl:value-of select="$loc/strs/str[@id='sc2.labels.universe.races.terran']"/></a></li>
						<li><a href="/features/zerg/index.xml"><xsl:value-of select="$loc/strs/str[@id='sc2.labels.universe.races.zerg']"/></a></li>
					</ul>
				</div>-->
			</div>		
			<div class="clear"></div>
		
		</q></q></div>
</xsl:template>

<xsl:template name="nav-heroes">
	<xsl:param name="title"></xsl:param>
	<div class="racenav-container"><q><q>
		<div class="newnav">
			<div>
				<h6><xsl:value-of select="$loc/strs/str[@id='sc2.labels.features.heroes']"/></h6>
				<ul>
					<li><a href="/features/heroes/raynor.xml"><xsl:value-of select="$heroes/strs/str[@id='sc2.features.heroes.raynor']"/></a></li>
					<li><a href="/features/heroes/tychus.xml"><xsl:value-of select="$heroes/strs/str[@id='sc2.features.heroes.tychus']"/></a></li>
					<li><a href="/features/heroes/zeratul.xml"><xsl:value-of select="$heroes/strs/str[@id='sc2.features.heroes.zeratul']"/></a></li>
				</ul>
			</div>		
		</div>		
		<div class="clear"></div>
	
	</q></q></div>
</xsl:template>

<xsl:template name="dropdownMenu">
	<xsl:param name="defaultValue" />
	<xsl:param name="hiddenId" />
	<xsl:param name="dropdownList" />

<script type="text/javascript">
	var varOver<xsl:value-of select ="$hiddenId" /> = 0;
</script>

<div class="dropdown" onMouseOver="javascript: varOver{$hiddenId} = 1;" onMouseOut="javascript: varOver{$hiddenId} = 0;"><a id="display{$hiddenId}" href="javascript: document.formDropdown{$hiddenId}.dummy{$hiddenId}.focus();"><xsl:value-of select="$defaultValue" /><img src="/images/layout/langarrow.png" class="langarrow" /></a></div>
  
<div style="position:relative;"><div style="position:absolute;"><form name="formDropdown{$hiddenId}" id="formDropdown{$hiddenId}" style="height:0px;"><input type="button" id="dummy{$hiddenId}" onFocus="javascript: dropdownMenuToggle('dropdownHidden{$hiddenId}');" onBlur="javascript: if(!varOver{$hiddenId}) document.getElementById('dropdownHidden{$hiddenId}').style.display='none';" size="2" style="position:relative; left:-5000px;"/></form></div></div>


<div class="drop-lang" style="display:none; z-index:50;" id="dropdownHiddenLang" onMouseOver="javascript:varOverLang=1;" onMouseOut="javascript:varOverLang=0;">
	<div class="light-tip">
		<table cellpadding="0" cellspacing="0">
			<tr><td class="tl"></td><td class="t"></td><td class="tr"></td></tr>
			<tr><td class="l"><q></q></td>
			<td class="bg">
			<script type="text/javascript">
				var labelsEnglishUs = "<xsl:value-of select ="$loc/strs/str[@id='sc2.labels.english-us']" />";
				var labelsEnglishGb = "<xsl:value-of select ="$loc/strs/str[@id='sc2.labels.english-gb']" />";
				var labelsSpanish = "<xsl:value-of select ="$loc/strs/str[@id='sc2.labels.spanish']" />";
				var labelsFrench = "<xsl:value-of select ="$loc/strs/str[@id='sc2.labels.french']" />";
				var labelsGerman = "<xsl:value-of select ="$loc/strs/str[@id='sc2.labels.german']" />";
				var labelsRussian = "<xsl:value-of select ="$loc/strs/str[@id='sc2.labels.russian']" />";
				var labelsKorean = "<xsl:value-of select ="$loc/strs/str[@id='sc2.labels.korean']" />";
				var labelsTaiwan = "<xsl:value-of select ="$loc/strs/str[@id='sc2.labels.taiwan']" />";
			</script>
			<ul>
				<li class="langlisttop"><a href="javascript: selectLang(labelsEnglishUs, 'en_us');"><xsl:value-of select="$loc/strs/str[@id='sc2.labels.english-us']"/></a></li>
				<li><a href="javascript: selectLang(labelsEnglishGb, 'en_gb');"><xsl:value-of select="$loc/strs/str[@id='sc2.labels.english-gb']"/></a></li>
				<li><a href="javascript: selectLang(labelsSpanish, 'es_es');"><xsl:value-of select="$loc/strs/str[@id='sc2.labels.spanish']"/></a></li>
				<li><a href="javascript: selectLang(labelsFrench, 'fr_fr');"><xsl:value-of select="$loc/strs/str[@id='sc2.labels.french']"/></a></li>
				<li><a href="javascript: selectLang(labelsGerman, 'de_de');"><xsl:value-of select="$loc/strs/str[@id='sc2.labels.german']"/></a></li>
				<li><a href="javascript: selectLang(labelsRussian, 'ru_ru');"><xsl:value-of select="$loc/strs/str[@id='sc2.labels.russian']"/></a></li>
				<li><a href="javascript: selectLang(labelsKorean, 'ko_kr');"><xsl:value-of select="$loc/strs/str[@id='sc2.labels.korean']"/></a></li>
				<li class="langlistbot"><a href="javascript: selectLang(labelsTaiwan, 'zh_tw');"><xsl:value-of select="$loc/strs/str[@id='sc2.labels.taiwan']"/></a></li>
			</ul>
			</td><td class="r"><q></q></td>
			</tr>
			<tr><td class="bl"></td><td class="b"></td><td class="br"></td></tr>
		</table>
	</div> 
</div>
			
</xsl:template>

<xsl:template match="cap">
	<xsl:call-template name="cap">
			<xsl:with-param name="letter"><xsl:apply-templates /></xsl:with-param>
			<xsl:with-param name="align" select="'left'"/>
	</xsl:call-template>
</xsl:template>

<xsl:template name="cap">
   <xsl:param name="letter" />
   <xsl:param name="align">left</xsl:param>
		<xsl:choose>
			<xsl:when test="$lang='ko_kr' or $lang='ru_ru' or $lang='zh_tw'">
				<img src="/images/letters/{$lang}/{$letter}.gif" align="{$align}" class="smallcap" />
			</xsl:when>
			<xsl:otherwise>
				<img src="/images/letters/{$letter}.gif" align="{$align}" class="smallcap" />
			</xsl:otherwise>
		</xsl:choose>
</xsl:template>


<xsl:template name="lightbox">
<div id="blackDrop" onClick="return closeLightbox(event)"></div>
<div id="lightBoxRoot" onClick="return closeLightbox(event)" style="background:url(/images/language/{$lang}/lightbox-loading.gif) #fff 50% 50% no-repeat;">
	<div id="cornerFour">
		<div id="lightBoxHolder" title="{$loc/strs/str[@id='sc2.labels.clicktoclose']}">
			<a id="lightBoxX" onClick="return closeLightbox(event)"></a>
		</div>
	</div>
</div>
</xsl:template>


<xsl:template name="nav">
	<div style="text-align:center; padding-top:6px;">
				<xsl:call-template name="flash">
			<xsl:with-param name="id" select="'test'"/>
			<xsl:with-param name="src" select="concat('/flash/',$lang,'/navigation.swf')"/>
			<xsl:with-param name="wmode" select="'transparent'"/>
			<xsl:with-param name="width" select="'800'"/>
			<xsl:with-param name="height" select="'37'"/>
			<xsl:with-param name="menu" select="'false'"/>										
			<xsl:with-param name="base" select="'/flash/global'"/>   <!-- The base directory MUST contain the font SWF files -->
			<xsl:with-param name="bgcolor" select="'#000000'"/>
			<xsl:with-param name="quality" select="'autohigh'"/>
			<xsl:with-param name="flashvars" select="concat(
				'&amp;flang=',$lang,
				'&amp;menu_1=',$loc/strs/str[@id='sc2.nav.1'],
				'&amp;menu_2=',$loc/strs/str[@id='sc2.nav.2'],
				'&amp;menu_3=',$loc/strs/str[@id='sc2.nav.3'],
				'&amp;menu_4=',$loc/strs/str[@id='sc2.nav.4'],
				'&amp;menu_5=',$loc/strs/str[@id='sc2.nav.5'],
				'&amp;menu_6=',$loc/strs/str[@id='sc2.nav.6'],
				'&amp;menu_7=',$loc/strs/str[@id='sc2.nav.7'],
				'&amp;menu_8=',$loc/strs/str[@id='sc2.nav.8'],
				'&amp;menu_9=',$loc/strs/str[@id='sc2.nav.9'],
				'&amp;menu_1_link=',$loc/strs/str[@id='sc2.nav.link.1'],
				'&amp;menu_2_link=',$loc/strs/str[@id='sc2.nav.link.2'],
				'&amp;menu_3_link=',$loc/strs/str[@id='sc2.nav.link.3'],
				'&amp;menu_4_link=',$loc/strs/str[@id='sc2.nav.link.4'],
				'&amp;menu_5_link=',$loc/strs/str[@id='sc2.nav.link.5'],
				'&amp;menu_6_link=',$loc/strs/str[@id='sc2.nav.link.6'],
				'&amp;menu_7_link=',$loc/strs/str[@id='sc2.nav.link.7'],
				'&amp;menu_8_link=',$loc/strs/str[@id='sc2.nav.link.8'],
				'&amp;menu_9_link=',$loc/strs/str[@id='sc2.nav.link.9'],
				'&amp;menu_elements=',$loc/strs/str[@id='sc2.nav.param.menuelements'],
				'&amp;menu_sepchar=',$loc/strs/str[@id='sc2.nav.param.sepchar'],
				'&amp;menu_vheight=',$loc/strs/str[@id='sc2.nav.param.vheight'],
				'&amp;menu_yposition=',$loc/strs/str[@id='sc2.nav.param.yposition'],
				'&amp;menu_space=',$loc/strs/str[@id='sc2.nav.param.space'],
				'&amp;menu_fontsize=',$loc/strs/str[@id='sc2.nav.param.fontsize'],
				'&amp;menu_sepfontsize=',$loc/strs/str[@id='sc2.nav.param.sepfontsize'],
				'&amp;menu_sepdeltay=',$loc/strs/str[@id='sc2.nav.param.sepdeltay'],
				'&amp;menu_sides=',$loc/strs/str[@id='sc2.nav.param.sides'],
				'&amp;maintxtmenucolor=',$loc/strs/str[@id='sc2.nav.param.txtmenucolor'],
				'&amp;maintxtmenuhover=',$loc/strs/str[@id='sc2.nav.param.txtmenuhover']
			)"/>
			<xsl:with-param name="noflash">&lt;table&gt;&lt;tr&gt;		&lt;td class='navleft png'&gt;&lt;/td&gt;		&lt;td&gt;		&lt;table&gt;&lt;tr&gt;		&lt;td&gt;&lt;a href='<xsl:value-of select="$loc/strs/str[@id='sc2.nav.link.1']"/>'&gt;<xsl:value-of select="$loc/strs/str[@id='sc2.nav.1']"/>&lt;/a&gt;&lt;/td&gt;		&lt;td&gt;&lt;/td&gt;		&lt;td&gt;&lt;a href='<xsl:value-of select="$loc/strs/str[@id='sc2.nav.link.2']"/>'&gt;<xsl:value-of select="$loc/strs/str[@id='sc2.nav.2']"/>&lt;/a&gt;&lt;/td&gt;		&lt;td&gt;&lt;/td&gt;		&lt;td&gt;&lt;a href='<xsl:value-of select="$loc/strs/str[@id='sc2.nav.link.3']"/>'&gt;<xsl:value-of select="$loc/strs/str[@id='sc2.nav.3']"/>&lt;/a&gt;&lt;/td&gt;	&lt;td&gt;&lt;/td&gt;		&lt;td&gt;&lt;a href='<xsl:value-of select="$loc/strs/str[@id='sc2.nav.link.4']"/>'&gt;<xsl:value-of select="$loc/strs/str[@id='sc2.nav.4']"/>&lt;/a&gt;&lt;/td&gt;		&lt;td&gt;&lt;/td&gt;		&lt;td&gt;&lt;a href='<xsl:value-of select="$loc/strs/str[@id='sc2.nav.link.5']"/>'&gt;<xsl:value-of select="$loc/strs/str[@id='sc2.nav.5']"/>&lt;/a&gt;&lt;/td&gt;		&lt;td&gt;&lt;/td&gt;		&lt;td&gt;&lt;a href='<xsl:value-of select="$loc/strs/str[@id='sc2.nav.link.6']"/>'&gt;<xsl:value-of select="$loc/strs/str[@id='sc2.nav.6']"/>&lt;/a&gt;&lt;/td&gt;		&lt;td&gt;&lt;/td&gt;		&lt;td&gt;&lt;a href='<xsl:value-of select="$loc/strs/str[@id='sc2.nav.link.7']"/>'&gt;<xsl:value-of select="$loc/strs/str[@id='sc2.nav.7']"/>&lt;/a&gt;&lt;/td&gt;		&lt;td&gt;&lt;/td&gt;		&lt;td&gt;&lt;a href='<xsl:value-of select="$loc/strs/str[@id='sc2.nav.link.8']"/>'&gt;<xsl:value-of select="$loc/strs/str[@id='sc2.nav.8']"/>&lt;/a&gt;&lt;/td&gt;		&lt;/tr&gt;&lt;/table&gt;		&lt;/td&gt;		&lt;td class='navright png'&gt;&lt;/td&gt;		&lt;/tr&gt;&lt;/table&gt;</xsl:with-param>
		</xsl:call-template>
				
	</div>

<xsl:choose>
	<xsl:when test="/page/frontpage"></xsl:when>
	<xsl:otherwise>
		<div class="language-filter">
			<!--<strong><xsl:value-of select="$loc/strs/str[@id='sc2.labels.languagecolon']"/></strong><br/>-->
			<xsl:call-template name="dropdownMenu">
				<xsl:with-param name="hiddenId" select="'Lang'"/>
				<xsl:with-param name="defaultValue" select="$loc/strs/str[@id='sc2.lang']" />
			</xsl:call-template>
		</div>
	</xsl:otherwise>
</xsl:choose>

</xsl:template>


<xsl:template name="communityNews">
  <xsl:param name="commOnly" select="0" />
      <xsl:for-each select = "document(concat('/strings/',$lang,'/newsfeed.xml'))/rss/channel/item">  
        <xsl:choose>
          <xsl:when test="$commOnly = 1 and string-length(@type) = 0"></xsl:when>
          <xsl:otherwise>
            <div class="news_item">
              <h5><xsl:value-of select="title" /></h5>
              <span class="pubauthor"><xsl:value-of select="pubDate" /> | <xsl:value-of select="$loc/strs/str[@id='sc2.community.by']"/>&#160;<i><xsl:value-of select="author" /></i></span>
              <xsl:apply-templates select="description" />
            </div>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:for-each>
</xsl:template>


<!--<xsl:template name="communityNews">
  <xsl:param name="commOnly" select="0" />
  <script type="text/javascript">
    var communityNewsArray = new Array;
	var counter = 0;
      <xsl:for-each select = "document(concat('/strings/',$lang,'/newsfeed.xml'))/rss/channel/item">  
        <xsl:choose>
          <xsl:when test="$commOnly = 1 and string-length(@type) = 0"></xsl:when>
          <xsl:otherwise>
		    communityNewsArray[counter] = "&lt;div class='news_item'&gt;\
              &lt;h5&gt;<xsl:value-of select="title" />&lt;/h5&gt;\
              <xsl:apply-templates select="description" />&lt;/div&gt;";
			
			//<![CDATA[
			communityNewsArray[counter].replace(/</g, "&lt;");
			communityNewsArray[counter].replace(/>/g, "&gt;");			
			communityNewsArray[counter].replace(/"/g, "&quot;");						
			//]]>
			counter++;
          </xsl:otherwise>
        </xsl:choose>
      </xsl:for-each>
			alert(communityNewsArray[0]);	  
	document.getElementById("replaceCommunityNews").innerHTML = communityNewsArray[0];
  </script>
</xsl:template>
-->

<!-- NOTE: taken from p. 41-42 of XSLT Cookbook (c) 2006 O'Reilly Media, Inc. -->
<xsl:template name="search-and-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="$search-string and 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 substring.
		-->
			<xsl:value-of select="substring-before($input, $search-string)" />
			<xsl:value-of select="$replace-string"/>
			<xsl:call-template name="search-and-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 occurrences of the search string so
			    just return the current input string -->
			<xsl:value-of select="$input" />
		</xsl:otherwise>
	</xsl:choose>
</xsl:template>

</xsl:stylesheet>
