<?php
/**
 * @package     Joomla.Site
 * @subpackage  Templates.protostar
 *
 * @copyright   Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

// Getting params from template
$params = JFactory::getApplication()->getTemplate(true)->params;

$app = JFactory::getApplication();
$doc = JFactory::getDocument();
$this->language = $doc->language;
$this->direction = $doc->direction;

// Detecting Active Variables
$option   = $app->input->getCmd('option', '');
$view     = $app->input->getCmd('view', '');
$layout   = $app->input->getCmd('layout', '');
$task     = $app->input->getCmd('task', '');
$itemid   = $app->input->getCmd('Itemid', '');
$sitename = $app->getCfg('sitename');

if($task == "edit" || $layout == "form" )
{
	$fullWidth = 1;
}
else
{
	$fullWidth = 0;
}

// Load optional RTL Bootstrap CSS
JHtml::_('bootstrap.loadCss', false, $this->direction);

// Add current user information
$user = JFactory::getUser();

$lang = & JFactory::getLanguage();
$lang->getName();
$currentLang = $lang->getName();

$languageArray = explode('-', $this->language);
$currentLanguage = $this->language;
?>
<!DOCTYPE html>
<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>
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<?php $this->setGenerator(null); ?>
	<jdoc:include type="head" />        
        <!-- FACEBOOK -->
        <meta property="og:type"        content="website">
        <?php if (JRequest::getVar('view') == 'featured'): 
            $this->setTitle('i-Frontier Information Technology');
            ?><meta property="og:title" content="i-Frontier Information Technology"> <?php
        else:
            ?><meta property="og:title" content="<?php echo $this->getTitle(); ?>"> <?php
        endif; ?>
        <meta property="og:image"       content="http://www.i-frontier.net/images/sharer/og.jpg">
        <meta property="og:site_name"   content="">
        <meta property="og:description" content="We are a leading company in the ICT sector that focuses on database management, information management , IT project management and training for IT professionals.">
        
        <link rel="shortcut icon" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/assets/gfx/favicon.ico" type="image/x-icon" />
    
        <link rel="stylesheet" type="text/css" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/assets/css/site.min.css" />
        <link rel="stylesheet" type="text/css" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/assets/css/editor.min.css" />               
        
        <!-- Mobile menu -->
        <link rel="stylesheet" type="text/css" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/assets/menu/css/menu_sideslide.css" />
        
        <link rel="stylesheet" type="text/css" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/assets/css/animate.css" />
        
        <?php if (JRequest::getVar('view') == 'featured'): ?> 
        <link rel="stylesheet" type="text/css" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/assets/scroller/css/smoothDivScroll.css" />
        <?php endif; ?>
        
        <?php if (JRequest::getVar('view') == 'featured'): ?>                
        <!--[if IE]>
            <link href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/assets/css/ie.css" rel="stylesheet" type="text/css" />
        <![endif]--> 
        
	<!--[if lt IE 9]>
		<script src="<?php echo $this->baseurl ?>/media/jui/js/html5.js"></script>
	<![endif]--> 
        
        <?php endif; ?>
        
        <?php 
            //echo JRequest::getVar('option');
                        
            function getCategory() {
                $iId = JRequest::getVar('id',0);
                $database = &JFactory::getDBO();
                if(JRequest::getVar('view', 0) == "section"){
                    return (int) JRequest::getVar( 'id', 0);
                }else if(Jrequest::getVar( 'view', 0) == "category"){
                    $sql = "SELECT id FROM #__categories WHERE id = '$iId'";
                    $database->setQuery( $sql );
                    $row=$database->loadResult();
                    return (int) $row;
                }else if(Jrequest::getVar('view', 0) == "article"){
                    $temp = explode(":",JRequest::getVar('id',0));
                    $sql = "SELECT catid FROM #__content WHERE id = ".$temp[0];
                    $database->setQuery( $sql );
                    $row=$database->loadResult();
                    return (int) $row;
                }
            }
            $categoryId = getCategory();
            
           if($categoryId >= 9 &&  $categoryId <= 16){
               $categoryClass = 'productspage';
           }
        ?>  
        
        <!-- Analytics -->
        <script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-77505044-1', 'auto');
  ga('send', 'pageview');

</script>
        <!-- Analytics -->
</head>

<body class="site <?php echo $option
	. ' view-' . $view
	. ($layout ? ' layout-' . $layout : ' no-layout')
	. ($task ? ' task-' . $task : ' no-task')
	. ($itemid ? ' itemid-' . $itemid : '')
	. ($params->get('fluidContainer') ? ' fluid' : '');
?>">
<!-- Mobile Menu -->
<div class="menu-wrap">
    <nav class="menu">
            <div class="icon-list">
                    <?php if ($this->countModules('mainmenu')) : ?>
            <jdoc:include type="modules" name="mainmenu" style="xhtml" />
    <?php endif; ?> 
            </div>
    </nav>
    <button class="close-button" id="close-button">Close Menu</button>
</div>
<!-- Mobile Menu -->

    <div id="container">        
        <div id="header">
            <div class="wrapper">
                <div id="logo">                    
                    <a class="logo" href="<?php echo $this->baseurl; ?>" title=""><img src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/assets/gfx/logo.png" alt="logo" title="logo" /></a>
                    <div class="gold"><img src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/assets/gfx/logo-oracle-sm.png" alt="Oracle Gold Partner" title="Oracle Gold Partner" /></div>
                </div>   
                
                <div id="mainmenu">
                        <?php if ($this->countModules('mainmenu')) : ?>
                            <div class="navigation" role="navigation">
                                <jdoc:include type="modules" name="mainmenu" style="xhtml" />
                            </div>
                        <?php endif; ?> 
                </div>                
                
                <div id="navigation_mobile">                    
                    <button class="menu-button" id="open-button">Open Menu</button>
                </div>
                
                <!--<div id="search"><jdoc:include type="modules" name="search" style="xhtml" /></div>-->
                
                <div id="language"><jdoc:include type="modules" name="language" style="xhtml" /></div> 
                
                <div class="search-trigger"> 
                    <a class="cd-search-trigger" href="#cd-search">Search<span></span></a>
                </div>
                <div id="cd-search" class="cd-search">
                    <form method="post" action="<?php echo $this->baseurl ?>/search">
                        <?php if ($currentLanguage == 'nl-nl'): ?>
                        <input id="mod-search-searchword" name="searchword" type="search" placeholder="Zoeken...">
                        <?php else: ?>
                        <input id="mod-search-searchword" name="searchword" type="search" placeholder="Search...">
                        <?php endif; ?>
                        <input type="hidden" name="task" value="search">
                        <input type="hidden" name="option" value="com_search">
                        <input type="hidden" name="Itemid" value="<?php echo $itemid; ?>">
                    </form>
                </div>
                
            </div>
        </div>
        <noscript>
  <p>Javascript is disabled</p>
</noscript>
        <?php if (JRequest::getVar('view') == 'featured'): ?>
        <div class="hero">
            <span id="cafe" role="img" aria-label="Header i-Frontier">
                <span class="inner">
                </span>
                <jdoc:include type="modules" name="header-home" style="xhtml" />
            </span>
	</div>
        <?php else: ?> 
        <div class="hero-default">
            <span id="cafe-default" role="img" aria-label="Header i-Frontier">
                <span class="inner">
                </span>
            </span>
	</div>
            <!--<div id="header-default">
            <?php if ($this->countModules('header-default')) : ?>
                    <jdoc:include type="modules" name="header-default" style="xhtml" />
            <?php endif; ?>       
            </div> -->
        <?php endif; ?>
        
        <div id="main">
            <div class="wrapper">            	            
                <?php if (JRequest::getVar('view') == 'featured'): ?> 
                    <h1 class="hidetxt">i-Frontier Information Technology</h1>
                    <div id="content">
                        <jdoc:include type="component" style="xhtml" />
                    </div>                                      
                <?php else: ?>  
                    <div id="breadcrumb"><jdoc:include type="modules" name="breadcrumb" style="xhtml" /></div>            
                    
                    <div id="content" class="contentpage">
                        <jdoc:include type="message" style="xhtml"/>
                        <jdoc:include type="component" style="xhtml" />   
                        
                        <?php if($itemid == '110' || $itemid == '123'): ?>
                            <?php include_once 'team.php'; ?>
                        <?php endif; ?>
                    </div>                
                <?php endif; ?>
            </div>
            <?php if (JRequest::getVar('view') == 'featured'): ?> 
            <div id="logos">
                <div id="clients">
                    <?php if ($currentLanguage == 'nl-nl'): ?>
                    <h3>Wie zijn onze klanten?</h3>
                    <?php else: ?>
                    <h3>I-Frontier offers services to these companies</h3>
                    <?php endif; ?>
                    <div id="makeMeScrollable">
                        <img src="<?php echo $this->baseurl ?>/images/clients/assuria.png" alt="assuria" />
                        <img src="<?php echo $this->baseurl ?>/images/clients/iamgold.png" alt="iamgold" />
                        <img src="<?php echo $this->baseurl ?>/images/clients/surgold.png" alt="surgold" />
                        <img src="<?php echo $this->baseurl ?>/images/clients/telesur.png" alt="telesur" />
                        <img src="<?php echo $this->baseurl ?>/images/clients/staatsolie.png" alt="staatsolie" />
                        <img src="<?php echo $this->baseurl ?>/images/clients/fai.png" alt="fai" />
                        <img src="<?php echo $this->baseurl ?>/images/clients/slm.png" alt="slm" />
                        <img src="<?php echo $this->baseurl ?>/images/clients/marriot.png" alt="marriot" />
                        <img src="<?php echo $this->baseurl ?>/images/clients/ninon.png" alt="ninon" />
                        <img src="<?php echo $this->baseurl ?>/images/clients/surmac.png" alt="surmac" />
                        <img src="<?php echo $this->baseurl ?>/images/clients/kersten.png" alt="kersten" />
                        <img src="<?php echo $this->baseurl ?>/images/clients/nob.png" alt="nob" />
                        <img src="<?php echo $this->baseurl ?>/images/clients/finabank.png" alt="finabank" />
                        <img src="<?php echo $this->baseurl ?>/images/clients/clad.png" alt="clad" />
                        <img src="<?php echo $this->baseurl ?>/images/clients/juspol.png" alt="juspol" />
                        <img src="<?php echo $this->baseurl ?>/images/clients/belastingdienst.png" alt="belastingdienst" />
                        <img src="<?php echo $this->baseurl ?>/images/clients/alembo.png" alt="alembo" />
                        <img src="<?php echo $this->baseurl ?>/images/clients/fernandes.png" alt="fernandes" /> 
                        <img src="<?php echo $this->baseurl ?>/images/clients/dsb.png" alt="dsb" /> 
                    </div>
                </div> 
                <hr class="clear" />
                <div id="partners">
                    <jdoc:include type="modules" name="partners" style="xhtml" />                      
                </div> 
            </div>
            <?php endif; ?>
        </div>            
    </div>
    <div id="footer">
        <div class="wrapper">
            <jdoc:include type="modules" name="footer" style="xhtml" />
        </div>
    </div>
    <a href="#0" class="cd-top">Top</a>
    <?php 
        $whitelist = array(
            '127.0.0.1',
            '::1'
        );
        if(in_array($_SERVER['REMOTE_ADDR'], $whitelist)): ?>
    <script src="//localhost:35729/livereload.js"></script>    
    <?php endif; ?> 
    <!--<script type="text/javascript" src="http://code.jquery.com/jquery-latest.pack.js"></script>-->
   
    <!-- :minified -->
    <script type="text/javascript" src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/assets/js/modernizr.custom.js"></script>   

    <script type="text/javascript" src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/assets/js/animatescroll.min.js"></script>
        
    <!-- Mobile Menu -->
    <script src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/assets/menu/js/classie.js"></script>
    <script src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/assets/menu/js/main.js"></script>
    
    <script src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/assets/js/site.min.js"></script>
    
    <!-- logo scroller -->
    <?php if (JRequest::getVar('view') == 'featured'): ?> 
        <script type="text/javascript" src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/assets/scroller/js/jquery-ui-1.10.3.custom.min.js"></script>
        <script type="text/javascript" src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/assets/scroller/js/jquery.mousewheel.min.js"></script>
        <script type="text/javascript" src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/assets/scroller/js/jquery.kinetic.min.js"></script>
        <script type="text/javascript" src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/assets/scroller/js/jquery.smoothdivscroll-1.3-min.js"></script>
    
    
    <!-- Plugin initialization -->
            <script type="text/javascript">
            // Initialize the plugin with no custom options
            jQuery(document).ready(function () {
            // None of the options are set
            jQuery("div#makeMeScrollable").smoothDivScroll({
                autoScrollingMode: "always",
                autoScrollingDirection: "endlessLoopRight",
                autoScrollingStep: 1,
                autoScrollingInterval: 25,
                touchScrolling: true
            });

            jQuery("div#makeMeScrollable").bind("mouseover", function () {
                jQuery(this).smoothDivScroll("stopAutoScrolling");
            }).bind("mouseout", function () {
                jQuery(this).smoothDivScroll("startAutoScrolling");
            });
        });
            </script>
    <?php endif; ?>
</body>
</html>