<?php require_once 'includes/protect.php'; ?><?php if ($pagename=='index.php') { $imagetext=$siteactivity; } else {$imagetext=$category; }?><div class="headerpos<?php if ($imgsite==0 OR $catimage=='0') { echo "2"; }?>"></div>
<?php if ($catimage==3 AND $catscript) { ?>
<header id="slideshow" class="carousel slide hpages"><div class="carousel-inner"><?php echo $catscript ?></div></header>
<?php }else{ ?>
<?php if ($imgsite==1) { ?><?php if ($catimage!='0' OR $secimage==2) { ?><header id="slideshow" class="carousel slide<?php if ($pagename!='index.php' AND ($pagename!='item.php' OR $imgitem==0 OR $image==0)) { echo ' hpages'; }?> hidden-print">
<?php if ($photovar) { 
$result40 = $mysqli->query("SELECT id FROM extras WHERE type=0 AND $photovar=$catid"); 
$nrrows40 = mysqli_num_rows($result40); 
$result40b = $mysqli->query("SELECT id FROM extras WHERE type=0 AND $photovar=$parent AND $parent!='0'"); 
$nrrows40b = mysqli_num_rows($result40b); 
}?>
<?php if ($nrrows40>0 OR ($nrrows40b>0 AND $catimage!=2)) {?><div class="carousel-inner">
<?php if ($nrrows40>0) {
$result41 = $mysqli->query("SELECT insert_id FROM extras WHERE type=0 AND $photovar=$catid GROUP BY insert_id ORDER BY priority"); 
} else {
$result41 = $mysqli->query("SELECT insert_id FROM extras WHERE type=0 AND $photovar=$parent AND $parent!='0' GROUP BY insert_id ORDER BY priority"); 
}
$nrrows41 = mysqli_num_rows($result41); 
while($row = $result41->fetch_array()) {
$pcount++; 
$bgrid=$row['insert_id'];

$result = $mysqli->query("SELECT name, text, url FROM extras WHERE type=0 AND insert_id='$bgrid' AND lang_id=$lang");
$row = $result->fetch_array(); 
$bannername=$row['name']; 
$bannertext=$row['text'];
$bannerurl=$row['url'];

if ($bannername=='') {$bgrname=$pcount; } else {$bgrname=$bannername; }?><div <?php if ($pcount==1) { ?>class="item active"<?php } else {?>class="item"<?php } php?>><div class="preload"><img src="<?php echo $filepath ?>photos/<?php echo $bgrid ?>.jpg" alt="<?php echo $imagetext ?> <?php echo $bgrname ?>"></div><div class="fill" style="background-image:url('<?php echo $filepath ?>photos/<?php echo $bgrid ?>.jpg');"></div>
<?php if ($banners==1 AND ($bannername OR $bannertext)) { ?>
<div class="carousel-caption"><div class="content pad0"><div class="divbanner wp2">
<?php if ($bannerurl) { ?><a href="<?php echo $bannerurl ?>"><div class="banner wp2"><?php echo $bannername ?></div></a><?php }else{ ?><div class="banner wp2"><?php echo $bannername ?></div><?php } ?>
<div class="lead wp4 color3 bordercolor4"><?php echo $bannertext ?></div></div></div></div>
<?php } ?>
</div><?php } ?></div><?php if ($nrrows41>1) { ?><div class="carousel-control"><a class="ccontrols ccleft" href="#slideshow" data-slide="prev">&lsaquo;</a><a class="ccontrols ccright" href="#slideshow" data-slide="next">&rsaquo;</a></div><?php } ?><?php }else{?><div class="carousel-inner"><div class="item active"><?php if (($pagename=='item.php' AND $imgitem==1) OR $catimage==2 OR $catimage1==2 OR ($pagename!='section.php' AND ($secimage!=0 OR $secimage2!=0)) OR ($pagename=='section.php' AND ($secimage==2 OR $secimage2==2)) OR $pagename=='request.php' OR $pagename=='rates.php' OR $pagename=='reviews.php') { ?><div class="preload"><img src="<?php echo $filepath ?><?php echo $photopath ?><?php echo $pid ?>.jpg" alt="<?php echo $imagetext ?>"></div><div class="fill bgrimg1"></div><?php }else{?><div class="preload"><img src="<?php echo $filepath ?>1.jpg" alt="<?php echo $imagetext ?>"></div><div class="fill bgrimg"></div><?php } ?></div></div><?php } ?><?php echo $menuextra ?></header>
<?php } ?><?php } ?>
<?php } ?>
<?php if ($formextra) { ?><div class="divformextra<?php if ($imgsite==0 OR $catimage=='0') { echo " divformextra1"; }?>"><?php include 'includes/'.$formextra.'.php';?></div><?php } ?>
<?php if ($type==4 AND $nrsections>0) { ?><?php include 'includes/searchsection.php';?><?php } ?><?php echo $menuextra2 ?>