<?php header('Content-type: text/html; charset=utf-8'); ?>
<?php
  /* STEP 1: LOAD RECORDS - Copy this PHP code block near the TOP of your page */
  
  // load viewer library
  $libraryPath = 'cmsb/lib/viewer_functions.php';
  $dirsToCheck = array('/home/corralr/public_html/','','../','../../','../../../');
  foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}
  if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }

  // load records from 'listings'
  list($listingsRecords, $listingsMetaData) = getRecords(array(
    'tableName'   => 'listings',
    'limit'       => '7',
    'loadUploads' => true,
    'allowSearch' => false,
  ));
  

?>
<!DOCTYPE html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->

<head>
<html lang="en">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

<!-- Mobile viewport -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<meta name="format-detection" content="telephone=no">
<LINK REL="SHORTCUT ICON" HREF="favicon.ico">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/bootstrap-theme.min.css">
<link rel="stylesheet" href="css/normalize.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,800|Oswald:400,700|Roboto:400,500' rel='stylesheet' type='text/css'>
<style>
#header {
	background: #E1DBC9;
	color: #000;
	padding-top: 3px;
}
#header2 {
	background: #000;
	color: #000;
	padding-top: 5px;
	padding-bottom: 5px;
}
/*FOOTER*/



#footer {
	background: #005A4A;
	color: #fff;
}
footer h1, footer h2, footer h3, footer h4 {
	color:#fff;
	margin-bottom:10px;
}
footer ul {
	margin:0 0 0 8%;
}
a.buttonlink {
	background:#0061AE;
	border-radius:7px;
	color:#fff;
	display:block;
	float:left;
	margin:10px 15px 10px 0;
	padding:10px;
	text-decoration:none;
}
a.buttonlink:hover {
	background:#fff;
}
</style>
</head>
<body>
<div class="container">
<div class="row">
<div class="container">
  <div class="row" id="header">
    <div class="col-md-6">
      <p class="pull-left" style="letter-spacing: 3px;"> <a href="index.php"> <img border="0" src="IMAGES/logo2015.gif" width="195" height="83"></a></p>
    </div>
    <div class="col-md-6">
      <h6 class="pull-right" style="letter-spacing: 1px;">
      <b> <font color="#000000"><font size="3">831.484.8100</font>&nbsp;&nbsp;&nbsp; </font> &nbsp;<font color="#005A4A"> <a href="contact.php"> CONTACT US</a></font><font color="#2E6DA4"> </font> <font size="3">|</font><font color="#2E6DA4"> </font> <a target="_blank" style="text-decoration: none" href="privacy.php"> PRIVACY POLICY</a> <font size="3">|</font> <a href="index.php"> HOME</a></b>
      </h5>
    </div>
  </div>
  <div class="row" id="header2">
    <div class="col-md-12" >
      <div id="carousel-example-generic" class="carousel  slide" data-ride="carousel"> 
        <!-- Indicators -->
        <ol class="carousel-indicators">
         <?php $counter = 0; ?>
         <?php foreach ($galleriesRecords as $record): ?>
          <?php foreach ($listingsRecords['front_photo'] as $index => $upload): ?>
          <li data-target="#carousel-example-generic" data-slide-to="<?php echo $counter; ?>"></li>
          <?php endforeach; ?>
          <?php $counter++ ; ?>
          <?php endforeach; ?>
        </ol>
        
        <!-- Wrapper for slides -->
        <div class="carousel-inner">
        <?php $counter = 0; ?>
         <?php foreach ($galleriesRecords as $record): ?>
          <?php foreach ($listingsRecords['front_photo'] as $index => $upload): ?>
          <?php if($counter < 1) : ?>
          	<div class="item active">
          <?php else : ?>
          	<div class="item">
          <?php endif; ?>
          <img src="<?php echo htmlencode($upload['urlPath']) ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="" /></a> 
          </div>
          <?php endforeach; ?>
          <?php $counter++ ; ?>
          <?php endforeach; ?>
        </div>
        <!-- Controls --> 
        <a class="left  carousel-control" href="#carousel-example-generic" data-slide="prev"> <span class="glyphicon  glyphicon-chevron-left"></span> </a> <a class="right  carousel-control" href="#carousel-example-generic" data-slide="next"> <span class="glyphicon  glyphicon-chevron-right"></span> </a> </div>
    </div>
  </div>
</div>

<!-- Fixed navbar -->
<nav class="navbar navbar-inverse">
  <div class="container">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button>
    </div>
    <div id="navbar" class="navbar-collapse collapse">
      <ul class="nav navbar-nav">
        <li class="active"> <a href="http://corraldetierrarealty.com/company-profile.php">COMPANY PROFILE </a>
        <LI><a href="http://corraldetierrarealty.com/Listing.php">FEATURED PROPERTIES</a></LI>
        <li><a href=".php">SEARCH MLS LISTING</a></li>
        <li><a href="http://corraldetierrarealty.com/map-directions.php">RENTAL PROPERTIES</a></li>
        <li><a href="http://corraldetierrarealty.com/contact.php">COMMERCIAL PROPERTIES</a></li>
        <li><a href="http://corraldetierrarealty.com/community-links.php">COMMUNITY LINKS</a></li>
      </ul>
    </div>
    <!--/.nav-collapse --> 
  </div>
</nav>
