<?php


$query = "Select * from nav_menu_mobile where active='1' order by nav_order";
$rt=mysql_query($query);  		
if (mysql_num_rows($rt) != 0) {
	$more=TRUE;	
} else {
	$more=FALSE;	
}
?> 
 <div class="main">

				<div class="fixed-bar">
					<!-- Elastislide Carousel -->
					<ul id="carousel" class="elastislide-list">
					
					
						<!--<li><a href="indexm.php"><img src="custom/images/home-icon.png" alt="Home" /></a></li>
                        <li><a href="core-m.php?page=portfolio"><img src="custom/images/portfolio-button.png" alt="Pilot Portfolio" /></a></li>
                        <li><a href="core-m.php?page=mobile-solution"><img src="custom/images/mobile-solution-button.png" alt="Mobile Solution" /></a></li>-->
<?php

						$query = "Select * from nav_slider_mobile where active='1' order by nav_order";
						$rt=mysql_query($query);  	
						while($nt=mysql_fetch_array($rt)){
							//determine image to display
							if($nt[icon_image]){
								//show image icon
								$button_display = "<img src='custom/images/icons/".$nt[icon_image]."' alt='".$nt[icon_text]."'>";
							} else {
								//show css button
								$button_display = "<span class='custom-icon' style='background-color: ".$nt[background_color]."; color: ".$nt[text_color].";'><span class='icon-text'>".$nt[icon_text]."</span></span>";
							}
							$button_url=$nt[button_url];
							//build correct URL
							if($nt[navdoc]=='1'){
								echo "<li><a href='docs/$button_url' target='blank'><span class='mobile-slider-icon'>$button_display</span></a></li>";
							} elseif($nt[socialnetworkid]>'0'){
								echo "<li><a href='$button_url' target='blank'><span class='mobile-slider-icon'>$button_display</span></a></li>";
							} else {
								if($button_url!=""){
									$pos = strpos($button_url, ".php");	
									if($pos!==false){
										echo "<li><a href='$button_url'><span class='mobile-slider-icon'>$button_display</span></a></li>";	
									}	else {
										echo "<li><a href='$button_url'><span class='mobile-slider-icon'>$button_display</span></a></li>";
									}
								} elseif(!empty($nt[pageid])) {
									echo "<li><a href='?pageid='".$nt[pageid]."'><span class='mobile-slider-icon'>$button_display</span></a></li>";
								}
							}
						}

						if($more==TRUE){
							echo ' <li id="more-icon"><a href="?page=more"><img src="custom/images/more-icon.png" alt="More" /></a></li>';
						}

?>
						<!--<li><a href="core-m.php?page=contact-us"><img src="custom/images/contact-icon.png" alt="Contact Information" /></a></li>
                        <li><a href="index.php?format=standard"><img src="custom/images/view-full-site-icon.png" alt="View Full Site" /></a></li>-->
<?php						
			
						if(!empty($locations_link)){
							echo'<li><a href="'.$locations_link.'" target="blank"><img src="custom/images/locations-icon.png" alt="Locations" /></a></li>';
						}
?>						
						<!--<li><a href="#"><img src="custom/images/foursquare-icon.png" alt="Foursquare" /></a></li>-->
						<!--<li><a href="#" id="toggle1"><img src="custom/images/valued-patron-icon.png" alt="Valued Patron" /></a></li>-->
					</ul>
					<!-- End Elastislide Carousel -->
				</div>

			</div>
 		<script type="text/javascript" src="js/mobile-slider-nav/jquerypp.custom.js"></script>
		<script type="text/javascript" src="js/mobile-slider-nav/jquery.elastislide.js"></script>
		<script type="text/javascript">
			
			$( '#carousel' ).elastislide( {
				minItems : 2
			} );
			
		</script> 
		
