<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	
	<title><?php if(isset($seo_title)) 
				 {
				 	$seo_title = strip_tags($seo_title);
				    echo $seo_title;
				 }else{
				 	$ci = &get_instance();
					echo ucfirst($ci->router->fetch_class()) . ' ' . ucfirst($ci->router->fetch_method()) . ' - ' . strip_tags($ci->config->item('site_title'));
				 } 
			?> 
	</title>

	<meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href='http://fonts.googleapis.com/css?family=Open+Sans:600italic,700italic,400,600,700' rel='stylesheet' type='text/css'>		
    <link href="<?php echo base_url(); ?>css/bootstrap.css" type="text/css" rel="stylesheet" />
    <link href="<?php echo base_url(); ?>css/colorbox.css" type="text/css" rel="stylesheet" />
    <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>css/style.css" />
    <link href="<?php echo base_url(); ?>rating/starrating.css" rel="stylesheet" type="text/css" media="screen" />
    <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>skins/ie7/skin.css" />
    <script src="http://code.jquery.com/jquery-1.8.2.min.js" type="text/javascript"></script>
    <script src="<?php echo base_url() ?>/js/jquery.carouFredSel-6.2.1.js" type="text/javascript"></script>
    <script src="<?php echo base_url(); ?>js/bootstrap.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="<?php echo base_url(); ?>/js/jquery.validate.js"></script>
    <script type="text/javascript" src="<?php echo base_url(); ?>js/jquery.form.js"></script>
    <script type="text/javascript" src="<?php echo base_url(); ?>/js/jquery.colorbox-min.js"></script>
    <script type="text/javascript" language="javascript" src="<?php echo base_url(); ?>js/jquery.dataTables.js"></script>
    <script type="text/javascript" src="<?php echo base_url(); ?>js/ajax.js"></script>    
    <script src="<?php echo base_url(); ?>rating/starrating.js" type="text/javascript"></script>
	<!--[if gte IE 9]>
	  <style type="text/css">
	    .gradient {
	       filter: none;
	    }
	  </style>
	<![endif]-->
</head>
<body>

<div class="top gradient">
	<div class="container">
		<div class="pull-left">
			<?php
			$ci = &get_instance();
			$site_title = $this->config->item('site_title');
			?>
			<h1><a href="<?php echo base_url(); ?>" style="color:#F2F2F2;"><?php echo $site_title; ?></a></h1>

			<br/>

			<div class="list_carousel">
				<ul id="featured-carousel">
					<?php if(count(featured_sidebar())) : foreach(featured_sidebar() as $ftv): ?>

					<?php 
					$anchor_type = ($ftv->film_type == 'movie') ? 'watch-movies' : 'watch-tv-shows';
					?>

					<?php $img_prop = array('src' => '/uploads/' . $ftv->thumbnail, 
											'width' => 120, 'height' => 140, 'alt' => htmlspecialchars($ftv->film_title)); ?>

					<li>
						<a href="<?php echo '/'.$anchor_type.'/'.url_title($ftv->film_title).'-'.$ftv->filmID; ?>">
							<?php echo img($img_prop); ?>
						</a>

						<br/>
						<a href="<?php echo '/'.$anchor_type.'/'.url_title($ftv->film_title).'-'.$ftv->filmID; ?>">
							<?php echo $ftv->film_title . ' ('. date("Y", $ftv->release_date) . ')'; ?>
						</a>
						<br/>

						Rating <?php echo $ftv->rating > 0 ? number_format($ftv->rating, 0).'/5' : 'N/A'; ?>
					</li>

					<?php endforeach; endif; ?>
				</ul>
				<div class="clearfix"></div>

				<a id="prev2" class="prev btn btn-small" href="#">&lt;</a>
				<a id="next2" class="next btn btn-small" href="#">&gt;</a>
				
				<div id="pager2" class="pager"></div>
			</div>

		</div>

		<div class="pull-right whitefont">
			<?php
			if(is_user_logged_in()) :
			?>	
				
				<h3><b class="icon-user icon-white" style="margin-top:7px;"></b> My Account</h3>
				<ul class="nav">
					<li><?php echo anchor(base_url() . 'users', 'My Profile'); ?></li>
					<li><?php echo anchor(base_url() . 'users/logout', 'Logout'); ?></li>
				</ul>

			<?php else: ?>	
				
				<h3><b class="icon-user icon-white" style="margin-top:7px;"></b> Login/Join</h3>
				<?php if(isset($login_message)) echo $login_message; ?>
				<form method="post" action="/users/login" class="form">
					<input type="text" name="uname" placeholder="username"/><br/>
					<input type="password" name="upwd" placeholder="****"/><br/>
					<input type="submit" name="sbLogin" value="Login" class="btn btn-warning"/>

					&nbsp; <small><em><a href="/users/join">Don't have an account?</a></em></small>
				</form>
			
			<?php endif; ?>
		</div>
		
	</div>
</div>
	
<div class="container">