<?php
// no direct access
defined( '_JEXEC' ) or die( 'Restricted index access' );
define( 'YOURBASEPATH', dirname(__FILE__) );
require(YOURBASEPATH .DS."/styleswitcher.php"); 
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" >
<head>
<jdoc:include type="head" />
<?php
	$headerstyle      = $this->params->get("headerstyle", "graphic");
	$leftcolwidth     = $this->params->get("leftcolwidth", "200");
	$rightcolwidth    = $this->params->get("rightcolwidth", "226");
	$page_style   	  = $this->params->get("page_style", "NEWS");
	$headline     	  = $this->params->get("headline", "Relevant");
	$slogan			  = $this->params->get("slogan", "A New Template for Joomla!");
	$themecolor		  = $this->params->get("themecolor", "style1");

	require( YOURBASEPATH.DS."/themesaver.php");
	
	//count modules in vertical positions u456
	$showcasemodulecount = $this->countModules('user1') + $this->countModules('user2') + $this->countModules('user3') + $this->countModules('user4');
	if ($showcasemodulecount == "1") {$showcasetdwidth = "100%";}
	elseif ($showcasemodulecount == "2") {$showcasetdwidth = "50%";}
	elseif($showcasemodulecount == "3") {$showcasetdwidth = "33.3%";}
	elseif($showcasemodulecount == "4") {$showcasetdwidth = "25%";}
	
	//count modules in vertical positions u789
	$footermodulecount = $this->countModules('user7') + $this->countModules('user8') + $this->countModules('user9');
	if ($footermodulecount == "1") {$footertdwidth = "100%";}
	elseif ($footermodulecount == "2") {$footertdwidth = "50%";}
	elseif($footermodulecount == "3") {$footertdwidth = "33%";}
	
	
	
?>

<link rel="shortcut icon" href="images/favicon.ico" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/system.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/general.css" type="text/css" />
<link href="<?php echo $this->baseurl;?>/templates/<?php echo $this->template;?>/css/template_css.css" rel="stylesheet" type="text/css" media="screen" />
<link href="<?php echo $this->baseurl;?>/templates/<?php echo $this->template;?>/css/nav.css" rel="stylesheet" type="text/css" media="screen" />
<link href="<?php echo $this->baseurl;?>/templates/<?php echo $this->template;?>/css/<?php echo $scheme;?>.css" rel="stylesheet" type="text/css" media="screen" />

<!--[if lte IE 6]>
<link href="<?php echo $this->baseurl;?>/templates/<?php echo $this->template;?>/css/ie.css" rel="stylesheet" type="text/css" media="screen" />
<script type="text/javascript" src="<?php echo $this->baseurl;?>/templates/<?php echo $this->template;?>/js/iepngfix_tilebg.js"></script>
<style type="text/css">
span#prev8,span#next8,span#play8,span#stop8,img {behavior: url(<?php echo $this->baseurl;?>/templates/<?php echo $this->template;?>/js/iepngfix.htc); }
</style>
<![endif]-->



</head>
<body>
<div class="outerstroke">
<div id="main-wrapper">
	
	<div id="header_<?php echo $headerstyle; ?>">
		<div class="inside">
			<div id="newsflash"><jdoc:include type="modules" name="newsflash" style="EarthStyle" /></div>
			<h1><a href="<?php echo JURI::base(); ?>" title="<?php echo $headline; ?>"><?php echo $headline; ?></a></h1>
			<h2><?php echo $slogan; ?></h2>	
			</div>
		</div>
		<div class="menubar">
			<div id="navmenu">
			<script type="text/javascript" src="<?php echo $this->baseurl;?>/templates/<?php echo $this->template;?>/js/barmenu.js"></script>
				<jdoc:include type="modules" name="menu" style="none" />
			</div>
		</div>
		
			<div id="mainbody">
				
				<div id="showcasetop">&nbsp;</div>
				<div class="innerstroke">
				
		<?php if($this->countModules('user1') or $this->countModules('user2') or $this->countModules('user3') or $this->countModules('user4')) : ?>
				<div id="showcase" style="margin-bottom: 6px;">
						<div class="inside">
				
								<table border="0" cellpadding="0" cellspacing="0" align="center" width="100%">
								<tr>
								<?php if ($this->countModules( 'user1' )) : ?>
								<td style="width: <?php echo $showcasetdwidth; ?>;padding:5px; vertical-align:top;">
								<jdoc:include type="modules" name="user1" style="EarthStyle" />
								</td>
								<?php endif; ?>
								<?php if ($this->countModules( 'user2' )) : ?>
								<td style="width: <?php echo $showcasetdwidth; ?>;padding:5px; vertical-align:top;">
								<jdoc:include type="modules" name="user2" style="EarthStyle" />
								</td>
								<?php endif; ?>
								<?php if ($this->countModules( 'user3' )) : ?>
								<td style="width: <?php echo $showcasetdwidth; ?>;padding:5px; vertical-align:top;">
								<jdoc:include type="modules" name="user3" style="EarthStyle" />
								</td>
								<?php endif; ?>
								<?php if ($this->countModules( 'user4' )) : ?>
								<td style="width: <?php echo $showcasetdwidth; ?>;padding:5px; vertical-align:top;">
								<jdoc:include type="modules" name="user4" style="EarthStyle" />
								</td>
								<?php endif; ?>
								</tr>
								</table>
					</div>
			</div>
		<?php endif; ?>
		
		<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
		  <tr>
			<!-- NEWS STYLE -->
			<?php if($page_style=="NEWS") :?>
				<td id="maincol" valign="top">
					<div id="breadcrumbs">
					<jdoc:include type="modules" name="breadcrumb" style="EarthBreadCrumbStyle" />
					</div>
				<div class="inside">
				<?php if ($this->countModules('banner')) : ?>
					<div id="banner"><jdoc:include type="modules" name="banner" style="none" /></div>
				<?php endif; ?>
					<jdoc:include type="message" />
					<jdoc:include type="component" />
				</div>
			</td>
			<?php if ($this->countModules('left')) : ?>
				<td id="leftcol" valign="top" width="<?php echo $leftcolwidth; ?>">
					<div class="inside"><jdoc:include type="modules" name="left" style="rounded" /></div>
				</td>
			<?php endif; ?>
			<?php if ($this->countModules( 'right' ) && JRequest::getCmd('task') != 'edit' ) : ?>
				<td id="rightcol" valign="top" width="<?php echo $rightcolwidth; ?>">		
						<div class="inside"><jdoc:include type="modules" name="right" style="rounded" /></div>
				</td>
			<?php endif; ?>
			<?php endif; ?>
			<!-- END NEWS STYLE -->

			<!-- BLOG STYLE -->
			<?php if ($page_style=="BLOG") :?>
			<?php if ($this->countModules('left')) : ?>
				<td id="leftcol" valign="top" width="<?php echo $leftcolwidth; ?>">		
						<div class="inside"><jdoc:include type="modules" name="left" style="rounded" /></div>
				</td>
			<?php endif; ?>
			<?php if ($this->countModules( 'right' ) && JRequest::getCmd('task') != 'edit' ) : ?>
				<td id="rightcol" valign="top" width="<?php echo $rightcolwidth; ?>">
					<div class="inside"><jdoc:include type="modules" name="right" style="rounded" /></div>
				</td>
			<?php endif; ?>
				<td id="maincol" valign="top">
					<div id="breadcrumbs">
					<jdoc:include type="modules" name="breadcrumb" style="EarthBreadCrumbStyle" />
					</div>
				<div class="inside">
						<?php if ($this->countModules('banner')) : ?>
							<div id="banner"><jdoc:include type="modules" name="banner" style="none" /></div>
						<?php endif; ?>
						<jdoc:include type="message" />
						<jdoc:include type="component" />
					</div>
			</td>
			<?php endif; ?>
			<!-- END BLOG STYLE -->

			<!-- PORTAL STYLE -->
			<?php if ($page_style=="PORTAL") :?>

			<?php if ($this->countModules('left')) : ?>
				<td id="leftcol" valign="top" width="<?php echo $leftcolwidth; ?>">
					<div class="inside">
						<jdoc:include type="modules" name="left" style="rounded" />
					</div>
				</td>
			<?php endif; ?>
			<td id="maincol" valign="top">
			<div id="breadcrumbs">
			<jdoc:include type="modules" name="breadcrumb" style="EarthBreadCrumbStyle" />
			</div>
				<div class="inside">
					<?php if ($this->countModules('banner')) : ?>
							<div id="banner"><jdoc:include type="modules" name="banner" style="none" /></div>
					<?php endif; ?>
					<jdoc:include type="message" />
					<jdoc:include type="component" />
				</div>
			</td>
			<?php if ($this->countModules( 'right' ) && JRequest::getCmd('task') != 'edit' ) : ?>
				<td id="rightcol" valign="top" width="<?php echo $rightcolwidth; ?>">
					<div class="inside"><jdoc:include type="modules" name="right" style="rounded" /></div>
				</td>
			<?php endif; ?>
			<?php endif; ?>
			<!-- END PORTAL STYLE -->
		  </tr>
		</table>
		</div>
			<div class="bottom_top"></div>
				<div id="bottom">
					<?php if($this->countModules('user7') or $this->countModules('user8') or $this->countModules('user9')) : ?>
				<table border="0" cellpadding="0" cellspacing="0" align="center" width="100%">
				<tr>
				<?php if ($this->countModules( 'user7' )) : ?>
				<td style="width: <?php echo $footertdwidth; ?>;padding:5px; vertical-align:top;">
				<jdoc:include type="modules" name="user7" style="EarthStyle" />
				</td>
				<?php endif; ?>
				<?php if ($this->countModules( 'user8' )) : ?>
				<td style="width: <?php echo $footertdwidth; ?>;padding:5px; vertical-align:top;">
				<jdoc:include type="modules" name="user8" style="EarthStyle" />
				</td>
				<?php endif; ?>
				<?php if ($this->countModules( 'user9' )) : ?>
				<td style="width: <?php echo $footertdwidth; ?>;padding:5px; vertical-align:top;">
				<jdoc:include type="modules" name="user9" style="EarthStyle" />
				</td>
				<?php endif; ?>
				</tr>
				</table>
				<?php endif; ?>
				<div id="footer"><jdoc:include type="modules" name="footer" style="none" /></div>
			</div>
		</div>
		</div></div>
		<div class="bottomwrap">
		<div class="copyright"><?php require(YOURBASEPATH .DS."/js/template.css.php"); ?></div>
		</div>
		
</body>
</html>