<?php
$CI = & get_instance();
$_c = strtolower($CI->router->fetch_class());
$_a = strtolower($CI->router->fetch_method());
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>SPS E-Voting</title>
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">

<link href="http://fonts.googleapis.com/css?family=Oswald:700|Droid+Serif:400,700italic" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="<?php echo base_url(); ?>dist/css/bootstrap/bootstrap.min.css">
<link rel="stylesheet" href="<?php echo base_url(); ?>dist/css/fonts/font-awesome.min.css">
<link rel="stylesheet" href="<?php echo base_url(); ?>dist/css/fonts/Roboto/Roboto.css">
<link rel="stylesheet" href="<?php echo base_url(); ?>dist/css/theme/fonts.css"/>

<link rel="stylesheet" href="<?php echo base_url(); ?>dist/css/theme/extension.css"/>
<link rel="stylesheet" href="<?php echo base_url(); ?>dist/css/theme/front/main.css"/>
<link rel="stylesheet" href="<?php echo base_url(); ?>dist/css/theme/hover.css"/>
<link rel="stylesheet" href="<?php echo base_url(); ?>dist/css/theme/animate.css"/>
<link rel="stylesheet" href="<?php echo base_url(); ?>dist/js/jquery/jquery-ui.css"/>
<link rel="stylesheet" href="<?php echo base_url(); ?>dist/vendors/validationengine/validationEngine.css">

<script src="<?php echo base_url(); ?>dist/js/jquery/jquery-3.1.1.js"></script>
<script src="<?php echo base_url(); ?>dist/js/jquery/jquery-easing.js"></script>
<script src="<?php echo base_url(); ?>dist/js/jquery/jquery-ui.js"></script>
<script src="<?php echo base_url(); ?>dist/vendors/touch-punch/jquery.ui.touch-punch.min.js"></script>
<script src="<?php echo base_url(); ?>dist/js/modernizr-2.6.2.min.js"></script>
<script src="<?php echo base_url(); ?>dist/vendors/debounce/debounce.js"></script>

<!--[if lt IE 9]>
		<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
		<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>

<body class="droid-serif">
<div class="wrapper">
<?php
$this->load->view('templates/front/header', $this->templates->getData());
if($_c == 'home') $this->load->view('templates/front/banner', $this->templates->getData());
?>

<div class="content-wrapper">		
	<?php $this->templates->display(); ?>
	
	<?php $this->load->view('templates/front/contact', $this->templates->getData()); ?>
</div>

<?php $this->load->view('templates/front/footer', $this->templates->getData()); ?>

<div class="load-more-detector"></div>

<a href="javascript:void(0);" onclick="return goto(0);" id="gototop"><i class="fa fa-chevron-up"></i></a>
</div>

<!---------------------------------------------------------------------------------------------------------
SCRIPTS
----------------------------------------------------------------------------------------------------------->
<script src="<?php echo base_url(); ?>dist/js/bootstrap/bootstrap.min.js"></script>
<script src="<?php echo base_url(); ?>dist/js/bootstrap/vendor/holder.min.js"></script>
<script src="<?php echo base_url(); ?>dist/js/bootstrap/ie10-viewport-bug-workaround.js"></script>
<script src="<?php echo base_url(); ?>dist/js/app.js"></script>
<script src="<?php echo base_url(); ?>dist/js/main.js"></script>
<script src="<?php echo base_url(); ?>dist/vendors/WOW/dist/wow.min.js"></script>

<!-- VALIDATION ENGINE -->
<script src="<?php echo base_url(); ?>dist/vendors/validationengine/jquery.validationEngine.js"></script>
<script src="<?php echo base_url(); ?>dist/vendors/validationengine/languages/jquery.validationEngine-en.js"></script>

<!-- PNOTIFY -->
<link rel="stylesheet" href="<?php echo base_url(); ?>dist/vendors/pnotify/css/pnotify.buttons.css">
<link rel="stylesheet" href="<?php echo base_url(); ?>dist/vendors/pnotify/css/jquery.pnotify.css">
<link rel="stylesheet" href="<?php echo base_url(); ?>dist/vendors/pnotify/css/pnotify.custom.css">
<script src="<?php echo base_url(); ?>dist/vendors/pnotify/js/jquery.pnotify.min.js"></script>
<script src="<?php echo base_url(); ?>dist/vendors/pnotify/js/pnotify.buttons.js"></script>

<script>
$(function() {	
	$(window).scroll(function() {
		if($(window).scrollTop() > $(window).height()/3) {
			$('#gototop').fadeIn();
		} else {
			$('#gototop').fadeOut();
		}
	});
	
	$('.form-group input, .form-group textarea, .form-group select').off('click').on('click', function() {
		$(this).parents('.form-group').eq(0).removeClass('has-error');
	});
});

function goto(id) {
	if(id == 0) {
		var t = 0;
	} else {
		if(	$(id).length ) {
			var $item = $(id);
			if (!$item.length) return;		
			var t = $item.position().top;
		} else {
			window.location.href = '<?php echo base_url(); ?>'+id;
		}
	}
	$('html,body').animate({scrollTop:t}, 'slow');
	
	if(t == 0) {
		$('#gototop').fadeOut();
	} else {
		$('#gototop').fadeIn();
	}
}
</script>
</body>
</html>
