<?php
/**
 * @version		$Id: index.php  $
 * @package		Critec.Development
 * @subpackage	Templates.critec1.7
 * @copyright	Copyright (C) 2011 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

// No direct access.
defined('_JEXEC') or die;

// check modules
$showRightColumn	= ($this->countModules('position-3') or $this->countModules('position-6') or $this->countModules('position-8'));
$showbottom			= ($this->countModules('position-9') or $this->countModules('position-10') or $this->countModules('position-11'));
$showleft			= ($this->countModules('position-4') or $this->countModules('position-7') or $this->countModules('position-5'));
$showcaixas1		= ($this->countModules('position-20') or $this->countModules('position-21') or $this->countModules('position-22'));
$showcaixas2		= ($this->countModules('position-23') or $this->countModules('position-24') or $this->countModules('position-25'));
$showcaixas3		= ($this->countModules('position-26') or $this->countModules('position-27'));
$showareamenu		= ($this->countModules('menu-hor'));




if ($showRightColumn==0 and $showleft==0) {
	$showno = 0;
}

JHtml::_('behavior.framework', true);

// get params
$color			= $this->params->get('templatecolor');
$logo			= $this->params->get('logo');
$navposition	= $this->params->get('navposition');
$app			= JFactory::getApplication();
$doc			= JFactory::getDocument();
$templateparams	= $app->getTemplate(true)->params;

/*$doc->addScript($this->baseurl.'/templates/ropel-1/javascript/md_stylechanger.js', 'text/javascript', true);*/
?>

<!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; ?>" dir="<?php echo $this->direction; ?>" >
	<head>
		<jdoc:include type="head" />
        <link href='http://fonts.googleapis.com/css?family=Shanti' rel='stylesheet' type='text/css'>
		<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/ropel/css/position.css" type="text/css" media="screen,projection" />
		<?php /*?><link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/critec17-1/css/layout.css" type="text/css" media="screen,projection" /><?php */?>
        <link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/ropel/css/layout.css" type="text/css" />
		<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/ropel/css/print.css" type="text/css" media="Print" />
		<?php /*?>		<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/ropel-1/css/critec.css" type="text/css" />
		<?php */?>		<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/ropel/css/critec.css" type="text/css" />
        <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,600italic,800' rel='stylesheet' type='text/css'>
	<?php
        $files = JHtml::_('stylesheet','templates/ropel-1/css/general.css',null,false,true);
        if ($files):
            if (!is_array($files)):
                $files = array($files);
            endif;
            foreach($files as $file):
    ?>
            <link rel="stylesheet" href="<?php echo $file;?>" type="text/css" />
    <?php
            endforeach;
        endif;
    ?>
		<?php if ($this->direction == 'rtl') : ?>
		<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/ropel/css/template_rtl.css" type="text/css" />
		<?php endif; ?>
		<!--[if lte IE 6]>
			<link href="<?php echo $this->baseurl ?>/templates/ropel/css/ieonly.css" rel="stylesheet" type="text/css" />
		<![endif]-->
		<!--[if IE 7]>
			<link href="<?php echo $this->baseurl ?>/templates/ropel/css/ie7only.css" rel="stylesheet" type="text/css" />
		<![endif]-->
		<?php /*?><?php if($templateparams->get('html5', 0)) { ?>
		[if lt IE 9]>
			<script type="text/javascript" src="<?php echo $this->baseurl ?>/templates/ropel-1/javascript/html5.js"></script>
		<![endif]
		<?php } ?><?php */?>
		<script type="text/javascript" src="<?php echo $this->baseurl ?>/templates/ropel/javascript/hide.js"></script>

		<script type="text/javascript">
			var big ='<?php echo (int)$this->params->get('wrapperLarge');?>%';
			var small='<?php echo (int)$this->params->get('wrapperSmall'); ?>%';
			var altopen='<?php echo JText::_('TPL_CRITEC_ALTOPEN',true); ?>';
			var altclose='<?php echo JText::_('TPL_CRITEC_ALTCLOSE',true); ?>';
			var bildauf='<?php echo $this->baseurl ?>/templates/ropel/images/plus.png';
			var bildzu='<?php echo $this->baseurl ?>/templates/ropel/images/minus.png';
			var rightopen='<?php echo JText::_('TPL_CRITEC_TEXTRIGHTOPEN',true); ?>';
			var rightclose='<?php echo JText::_('TPL_CRITEC_TEXTRIGHTCLOSE'); ?>';
			var fontSizeTitle='<?php echo JText::_('TPL_CRITEC_FONTSIZE'); ?>';
            var bigger='<?php echo JText::_('TPL_CRITEC_BIGGER'); ?>';
            var reset='<?php echo JText::_('TPL_CRITEC_RESET'); ?>';
            var smaller='<?php echo JText::_('TPL_CRITEC_SMALLER'); ?>';
            var biggerTitle='<?php echo JText::_('TPL_CRITEC_INCREASE_SIZE'); ?>';
            var resetTitle='<?php echo JText::_('TPL_CRITEC_REVERT_STYLES_TO_DEFAULT'); ?>';
            var smallerTitle='<?php echo JText::_('TPL_CRITEC_DECREASE_SIZE'); ?>';
		</script>

	</head>

	<body>

		<div id="all">
			<div id="back">
			  
              
            <div id="header">
                
                <div class="topo">
                   <div class="logoheader"> 
                      <a href="./index.php" target="_self">
                        <div id="logo">&nbsp;</div>
                      </a>
                   </div><!-- end logoheader -->
                  
                   <div id="opcoes">
                        <?php
							$user = &JFactory::getUser();
							
							if ($user->guest) 
							{ 
							?>                    
                        		<jdoc:include type="modules" name="opcoes" style="xhtml" />
							<?php 
							}
							else 
							{
							?>
								<jdoc:include type="modules" name="opcoes1" style="xhtml" />
							<?php 
							} 
							?>
                   </div><!-- end opcoes -->
                </div><!-- end topo -->
			    
                <?php if ($showareamenu) : ?>
                <div id="area_menu">
                    
                    <div id="menu-hor">
                      <jdoc:include type="modules" name="menu-hor" style="xhtml"/>
                    </div>
					<div id="pesq">
                       <jdoc:include type="modules" name="pesquisa" style="xhtml" />
                    </div>
                </div><!-- end area_menu -->	<?php endif; ?>
			    
               
               
                <div id="bannertopo">
                  <jdoc:include type="modules" name="banner" style="xhtml" />
                </div>
                <div class="sombra">&nbsp;</div>
	        </div><!-- end header -->
			  
				
  					<div id="<?php echo $showRightColumn ? 'contentarea2' : 'contentarea'; ?>">
							     

									<?php if ($navposition=='left' AND $showleft) : ?>
									<div class="left1 <?php if ($showRightColumn==NULL){ echo 'leftbigger';} ?>" id="nav">
										<jdoc:include type="modules" name="position-7" style="xhtml" />
										<jdoc:include type="modules" name="position-4" style="xhtml" />
										<jdoc:include type="modules" name="position-5" style="xhtml" />
									</div>
									
									<!-- end navi -->
									<?php endif; ?>

							<div id="<?php echo $showRightColumn ? 'wrapper' : 'wrapper2'; ?>" <?php if (isset($showno)){echo 'class="shownocolumns"';}?>>
								
								
                          <!-- FIX CRITEC para esconder o Component da frontpage -->
							<?php $pageview = JRequest::getVar('view', '');
								$jb_frontpage = $this->params->get('showfrontpagearticles'); ?>
								<!-- Main content hide it on the frontpage -->
								<?php 							 
								if ($jb_frontpage=="1") 
								{ 
									echo "<div id='main'><jdoc:include type='message' /> <jdoc:include type='component' style='xhtml' /> </div> ";
							 	}  
								?>
                               <div id="main1">
                                        <div id="breadcrumbs">
                                        <jdoc:include type="modules" name="position-2" style="xhtml" />
                                        </div> 
                                    <jdoc:include type="message" />
                                    <jdoc:include type="component" style="xhtml" />
								</div>  
                                
								<?php /*?>
								<div id="main">

								<?php if ($this->countModules('position-12')): ?>
									<div id="top"><jdoc:include type="modules" name="position-12" style="xhtml"   />
									</div>
								<?php endif; ?>

									
									<jdoc:include type="component" />

								</div><!-- end main -->
								<?php */?>
                                
                                
					</div><!-- end wrapper -->

						<?php if ($showRightColumn) : ?>
												

							<div id="right">
								<a id="additional"></a>
								<jdoc:include type="modules" name="position-6" style="xhtml" />
								<jdoc:include type="modules" name="position-8" style="xhtml" />
								<jdoc:include type="modules" name="position-3" style="xhtml" />
							</div>
                            <!-- end right -->
					
					<?php endif; ?>

					<?php if ($navposition=='center' AND $showleft) : ?>

				
							<div class="left <?php if ($showRightColumn==NULL){ echo 'leftbigger';} ?>" id="nav" >
								<jdoc:include type="modules" name="position-7"  style="xhtml" />
								<jdoc:include type="modules" name="position-4" style="xhtml" />
								<jdoc:include type="modules" name="position-5" style="xhtml" />
							</div><!-- end navi -->
					<?php endif; ?>

					
                    
                    <div class="wrap"></div><!-- end wrap -->
						<?php if ($showcaixas1) : ?>
                        <div id="caixas1">
                        	<?php if ($this->countModules('position-20')): ?>
							<div class="box20"> <jdoc:include type="modules" name="position-20" style="xhtml" /></div>
							<?php endif; ?>
							   <?php if ($this->countModules('position-21')): ?>
							<div class="box21"> <jdoc:include type="modules" name="position-21" style="xhtml" /></div>
							<?php endif; ?>
							<?php if ($this->countModules('position-22')): ?>
							<div class="box22"> <jdoc:include type="modules" name="position-22" style="xhtml" /></div>
							<?php endif ; ?>
                         </div>
                         <?php endif ; ?>
                         
                         <?php if ($showcaixas2) : ?>
                         <div id="caixas2">
                        	<?php if ($this->countModules('position-23')): ?>
							<div class="box23"> <jdoc:include type="modules" name="position-23" style="xhtml" /></div>
							<?php endif; ?>
							   <?php if ($this->countModules('position-24')): ?>
							<div class="box24"> <jdoc:include type="modules" name="position-24" style="xhtml" /></div>
							<?php endif; ?>
							<?php if ($this->countModules('position-25')): ?>
							<div class="box25"> <jdoc:include type="modules" name="position-25" style="xhtml" /></div>
							<?php endif ; ?>                     
                         </div>	
                         <?php endif ; ?>
                         
                         
                         <?php if ($showcaixas3) : ?>
                         <div id="caixas3">
                        	<?php if ($this->countModules('position-26')): ?>
							<div class="box26"> <jdoc:include type="modules" name="position-26" style="xhtml" /></div>
							<?php endif; ?>
							   <?php if ($this->countModules('position-27')): ?>
							<div class="box27"> <jdoc:include type="modules" name="position-27" style="xhtml" /></div>
							<?php endif; ?>
							
                         </div>	
                         <?php endif; ?>
                         
                         
						</div> <!-- end contentarea -->
						
                            
                            
                            
                            
					</div><!-- back -->

				
		 </div><!-- all -->
				<div id="footer-outer">
                    <div>
                        <jdoc:include type="modules" name="legal" style="xhtml" />
                    </div>
				
					<div id="footer-inner" align="center" class="23">

						<div id="bottom" >
							<?php if ($this->countModules('position-9')): ?>
								<div class="box9"> <jdoc:include type="modules" name="position-9" style="xhtml" /></div>
							<?php endif; ?>
							<?php if ($this->countModules('position-10')): ?>
								<div class="box10"> <jdoc:include type="modules" name="position-10" style="xhtml" /></div>
							<?php endif; ?>
							
                            
                            <!-- FIX CRITEC para duas posiçoes -->
							<?php /*?><?php if ($this->countModules('position-11')): ?>
							<div class="box box3"> <jdoc:include type="modules" name="position-11" style="xhtml" /></div>
							<?php endif ; ?><?php */?>
						</div>
					</div>
				

					<?php /*<div id="footer-sub">

					
						?><div id="footer">
							<jdoc:include type="modules" name="position-14" />
						</div><!-- end footer -->
					</div><?php */?>

				</div>

				<jdoc:include type="modules" name="debug" />
			</body>
</html>
