<?php

include ("includes/functions.php");

$id = ($_GET['id']);

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Het Kompas :: Foto's</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="viewport" content="width=device-width">
<? MetaStuff (); ?>
<link href="style.css" rel="stylesheet" type="text/css" />


<?php /*?><script type="text/javascript" src="includes/mootools.js"></script>
<script type="text/javascript" src="includes/slimbox.js"></script><?php */?>
<script type="text/javascript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<style type="text/css">
td img
{
	display: block;
}
</style>
</head>
<body bgcolor="#f2eeea" onload="MM_preloadImages('images/menu/menu_r1_c1_f2.jpg','images/menu/menu_r3_c1_f2.jpg','images/menu/menu_r1_c1_f3.jpg','images/menu/menu_r4_c1_f2.jpg','images/menu/menu_r1_c1_f4.jpg','images/menu/menu_r5_c1_f2.jpg','images/menu/menu_r1_c1_f5.jpg','images/menu/menu_r6_c1_f2.jpg','images/menu/menu_r1_c1_f6.jpg','images/menu/menu_r7_c1_f2.jpg','images/menu/menu_r1_c1_f7.jpg','images/menu/menu_r8_c1_f2.jpg','images/menu/menu_r1_c1_f8.jpg','images/menu/menu_r9_c1_f2.jpg','images/menu/menu_r1_c1_f9.jpg','images/menu/menu_r10_c1_f2.jpg','images/menu/menu_r1_c1_f10.jpg','images/menu/menu_r11_c1_f2.jpg','images/menu/menu_r1_c1_f11.jpg','images/menu/menu_r12_c1_f2.jpg');">
<div align="center">
	<div id="Wrapper">
		<div id="Header">
			<div id="HeaderNavigContainer">
				<div id="mobile-nav">
				<nav class="mob-menu">
					<ul class="HeaderNavig">
					<li><a href="index_fr.php">Bienvenue</a></li>
					<li><a href="fotogal_fr.php" id="current">Photos</a></li>
					<li><a href="artikels_fr.php">articles &amp; Media</a></li>
					<li><a href="contact_fr.php">Contact</a></li>
					<li><a href="ligging_fr.php">info &amp; situation</a></li>
				</ul>
				</nav>
				</div>
			</div>
			<div class="langsel"><a href="fotogal.php">Nederlands</a></div>
		</div>
		<div id="SubHeader">&nbsp;</div>
		<div id="Content">
			<table width="100%" cellpadding="0" cellspacing="0">
				<tr>
					<td id="LeftSide">
						<div class="LeftSide">
							<? SubMenu_fr (); ?>
						</div>
					</td>
					<td class="CenterPage SecoundCenterPage" width="700">
							<h1>Photos</h1>
							<table width="98%" cellpadding="2" cellspacing="2" class="photo-wrap">
								<tr>
									<td class="span3" align="left" width="150" valign="top">
										<? ShowAlbums (); ?>
									</td>
									<td class="span9" align="center" valign="top">
										<? ShowFotos ($id); ?>
									</td>
								</tr>
							</table>
					</td>
				</tr>
			</table>
		</div>
	</div>
	<div id="Footer">&nbsp;</div>
	<div id="FooterContent">
		<? FooterContent_fr (); ?>
	</div>
</div>
<? GoogleAnal (); ?>
</body>
</html>

<?
function ShowAlbums()
{
	$sql_command = "SELECT * FROM mod_fotoAlbum WHERE publiceren = 1 ORDER BY omschrijving ASC";
	
	$sql_result = (mysql_query($sql_command)) or die("<b>A fatal MySQL error occured</b>.\n<br />Query: " . $query . "<br />\nError: (" . mysql_errno() . ") " . mysql_error());
	
	echo '<ul class="fotoAlbumNavig">';

	while ($row=mysql_fetch_array($sql_result)) 
		{
	echo '<li><a href="fotogal_fr.php?id='.$row['id'].'">'.$row['omschrijving_fr'].'</a></li>';
		}
	echo '<ul>';
}


function ShowFotos ($id)
{
	$sql_command = "SELECT * FROM mod_fotoAlbumFotos WHERE albumId = '".$id."'";
	$sql_result = (mysql_query($sql_command)) or die("<b>A fatal MySQL error occured</b>.\n<br />Query: " . $query . "<br />\nError: (" . mysql_errno() . ") " . mysql_error());

	echo '<table width="95%" cellpadding="1" cellspacing="1">';
	
	$i = 0;
	
	while ($row = mysql_fetch_array($sql_result)) 
	{
	
		if ($i == 0)  
		{ 
			echo "<tr>";
		}	
	
	echo '<td align="center" valign="top"><a class="fancybox-thumb" href="http://www.hetkompas.be/CMS/fotos/'.$row['bestandsNaam'].'" rel="lightbox[A]" title="Foto\'s Het Kompas"><img src="http://www.hetkompas.be/CMS/fotos/'.$row['bestandsNaam'].'" width="120" border="0"/></a></td>';
	
	
	if ($i == 3) 
		{ 
			echo "</tr>";
		}
	
		if ($i == 3) 
		{ 
			$i =0; 
		} 
			else 
		{ 
			$i++; 
		}

	}
	echo '</table>';
}

?>

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript">
    $j = jQuery.noConflict();
    </script>
<script type="text/javascript" src="includes/jquery.fancybox.js?v=2.1.5"></script>
<link rel="stylesheet" type="text/css" href="includes/jquery.fancybox.css?v=2.1.5" media="screen" />
<script type="text/javascript">
$j(document).ready(function() {
	$j(".fancybox-thumb").fancybox({
		prevEffect	: 'none',
		nextEffect	: 'none',
		
	});
	$j("a.fancybox-thumb.cboxElement").removeClass("cboxElement");
});
</script>


<link rel="stylesheet" href="includes/meanmenu.css" media="all" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="includes//jquery.meanmenu.js"></script> 
<script>
jQuery(document).ready(function () {
    jQuery('nav').meanmenu();
});
</script>