<!DOCTYPE html>
<html>
<head>
	<title>SVJ Fussball</title>
	<meta charset="UTF-8"/>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	<meta http-equiv="cache-control" content="no-cache"/>
	<link rel="stylesheet" type="text/css" href="<?php echo PATH_PREFIX; ?>/css/reset.css"/>
	<link rel="stylesheet" type="text/css" href="<?php echo PATH_PREFIX; ?>/css/nivo-slider-custom.css"/>
	<link rel="stylesheet" type="text/css" href="<?php echo PATH_PREFIX; ?>/css/jquery-ui-1.11.2.css"/>
	<link rel="stylesheet" type="text/css" href="<?php echo PATH_PREFIX; ?>/css/jquery-ui-1.11.2.structure.css"/>
	<link rel="stylesheet" type="text/css" href="<?php echo PATH_PREFIX; ?>/css/jquery-ui-1.11.2.theme.css"/>
	<link rel="stylesheet" type="text/css" href="<?php echo PATH_PREFIX; ?>/css/svjf_l1.css"/>
	<script type="text/javascript" src="<?php echo PATH_PREFIX; ?>/js/jquery-2.1.1.min.js"></script>
	<script type="text/javascript" src="<?php echo PATH_PREFIX; ?>/js/jquery-ui-1.11.2.min.js"></script>
	<script type="text/javascript" src="<?php echo PATH_PREFIX; ?>/js/jquery.nivo.slider.js"></script>
	<script type="text/javascript" src="<?php echo PATH_PREFIX; ?>/js/common.js"></script>
	<?php
	/**
	 * Editoren Layout
	 */
	if ($this->_editable === true)
	{
		?>
		<link rel="stylesheet" type="text/css" href="<?php echo PATH_SITE; ?>/css/svjf_editor.css"/>
		<?php
	}
	?>
	<script type="text/javascript">
		<?php
		/**
		 * Editoren Variablen
		 */
		if ( $this->_editable === true )
		{
		?>
		var editorParams = <?php echo json_encode($this->_lang['select']); ?>;
		var userId = "<?php echo $_SESSION['sess_userId']; ?>";
		var sessLang = "<?php echo $_SESSION['sess_loginLang']; ?>";
		var navigationId = "<?php echo $this->_siteId; ?>";
		var pathMed = "<?php echo PATH_MED; ?>";
		var stdKeyvisual = "<?php echo PATH_MED . $this->_website[$this->_webkey]['prefix']; ?>/sample_keyvis.jpg";
		var stdImage = "<?php echo PATH_MED . $this->_website[$this->_webkey]['prefix']; ?>/sample_image.jpg";

		<?php
		foreach ( $this->_website[$this->_webkey] as $var => $value )
		{
		if ( is_array($value) )
		{
		?>
		var <?php echo $var; ?>    = <?php echo json_encode($value); ?>;
		<?php
		continue;
		}
		?>
		var <?php echo $var; ?> ="<?php echo $value; ?>";
		<?php
		}
		?>

		var specialSite = <?php echo ($this->_specialSite)
			? 'true'
			: 'false'; ?>;

		<?php

		}
		?>

		$(window).load(function () {
			if ($('img', '.keyvisual').length > 1) {
				$('.keyvisual').nivoSlider(
					{
						prevText: '<',
						nextText: '>'
					});
			}

			if ($('.slider img', '#galeryslider').length > 1) {
				$('.slider', '#galeryslider').nivoSlider(
					{
						controlNav: false,
						controlNavThumbs: false,
						directionNavHide: true,
						prevText: '<',
						nextText: '>',
						manualAdvance: true
					});

				<?php

				if ( $this->_editable === false )
				{
				?>
				$('.keyvisual img').on('click', function () {
					$('#galeryslider').show();
				});
				$('img.floatright').on('click', function () {
					$('#galeryslider').show();
				});
				<?php
				}

				?>
			}

		});

	</script>
	<?php

	/**
	 * Editoren Skripte
	 */
	if ($this->_editable === true)
	{
		?>
		<script type="text/javascript" src="<?php echo $this->_website[$this->_webkey]['editorUrl'] . '' . $this->_website[$this->_webkey]['editorVersion']; ?>/js/lang.js.php?lang=<?php echo $_SESSION['sess_loginLang']; ?>"></script>
		<script type="text/javascript" src="<?php echo $this->_website[$this->_webkey]['editorUrl'] . '' . $this->_website[$this->_webkey]['editorVersion']; ?>/js/editor.js"></script>
		<script type="text/javascript" src="<?php echo $this->_website[$this->_webkey]['editorUrl'] . '' . $this->_website[$this->_webkey]['editorVersion']; ?>/js/ckeditor/ckeditor.js"></script>
		<?php
	}

	?>
</head>
<body>
<?php

/**
 * Editorlayer
 */
if ($this->_editable === true)
{
	$editor = clone $this;
	$editor->setTemplate('editor');
	$editor->setData(null);
	echo $editor->output();

	/**
	 * Seitenelemente für Standardseiten
	 */
	if (!$this->_specialSite)
	{
		$elements = clone $this;
		$elements->setTemplate('elements');
		$elements->setData($this->_website[$this->_webkey]['contentElems']);
		echo $elements->output();
	}
}

/**
 * Galerielayer
 */
if (isset($this->_data['galery']) && !empty($this->_data['galery']))
{
	$galery = clone($this);
	$galery->setTemplate('galery');
	$galery->setData($this->_data['galery']);
	echo $galery->output();
}

?>
<div id="navi_main_outer" class="full_width">
	<div class="grid_40col wrapper">
		<div class="grid_40col spacer"></div>
		<div class="grid_40col spacer"></div>
		<div id="navi_main" class="grid_36col" data-editable="struktur">
			<?php

			/**
			 * Hauptnavigation
			 */
			if (isset ($this->_data['navi_main']))
			{
				$navi_main = clone $this;
				$navi_main->setTemplate('navi_main');
				$navi_main->setNavpath($this->_navpath);
				$navi_main->setData($this->_data['navi_main'], 0);
				echo $navi_main->output();
			}

			?>
		</div>
		<div id="logo" class="grid_4col">
			<img src="<?php echo PATH_PREFIX; ?>/images/svj_logo.png"/>
		</div>
		<div class="grid_40col spacer"></div>
		<div class="grid_40col spacer"></div>
	</div>
</div>
<div id="page">
	<div class="full_width background">
		<div id="headline_wrapper" class="grid_40col wrapper">
			<div class="grid_2col spacer"></div>
			<?php

			/**
			 * Keyvisual und Slider - Elemente (siehe $( window ).load )
			 */
			if (isset ($this->_data['keyvisual']))
			{
				?>
				<div id="keyvisual_<?php echo $this->_data['keyvisual'][0]['id']; ?>" class="grid_36col keyvisual" <?php echo ($this->_editable) ? 'data-editable="keyvisual"' : ''; ?>>
					<?php

					foreach ($this->_data['keyvisual'] as $keyvisual)
					{
						?>
						<img src="<?php echo $keyvisual['path'] . $keyvisual['src']; ?>" <?php echo (is_null($keyvisual['title'])) ? '' : 'title="' . $keyvisual['title'] . '"'; ?> />
						<?php
					}

					?>
				</div>
				<?php
			}

			?>
			<div class="grid_2col spacer"></div>
			<div id="headline_site" class="grid_34col"></div>
		</div>
	</div>
	<?php

	/**
	 * 1. Unternavigation
	 */
	if (isset ($this->_data['navi_sub']))
	{
		?>
		<div id="navi_sub_outer" class="full_width">
			<div class="grid_40col spacer"></div>
			<div id="navi_sub" class="grid_40col wrapper" data-editable="struktur">
				<?php

				foreach ($this->_data['navi_sub'] as $key => $navi_sub)
				{
					$navi_main = clone $this;
					$navi_main->setTemplate('navi_main');
					$navi_main->setNavpath($this->_navpath);
					$navi_main->setData($this->_data['navi_sub'], $key);
					echo $navi_main->output();
				}

				?>
			</div>
		</div>
		<?php
	}

	/**
	 * 2. Unternavigation
	 */
	if (isset ($this->_data['navi_last']))
	{
		?>
		<div id="navi_last_outer" class="full_width">
			<div class="grid_40col spacer"></div>
			<div id="navi_last" class="grid_40col wrapper" data-editable="struktur">
				<?php

				foreach ($this->_data['navi_last'] as $key => $navi_last)
				{
					$navi_main = clone ($this);
					$navi_main->setTemplate('navi_main');
					$navi_main->setNavpath($this->_navpath);
					$navi_main->setData($this->_data['navi_last'], $key);
					echo $navi_main->output();
				}

				?>
			</div>
		</div>
		<?php
	}

	?>
	<div class="grid_40col wrapper">
		<?php

		/**
		 * Seiteninhalt
		 */
		if (isset ($this->_data['content']))
		{
			?>
			<div id="content" class="grid_40col">
				<?php

				foreach ($this->_data['content'] as $type => $data)
				{
					$content = clone($this);
					$content->setTemplate($type);
					$content->setData($data);
					echo $content->output();
				}

				?>
			</div>
			<?php
		}
		?>
	</div>
</div>
<div id="footer" class="full_width"></div>
<?php
if ($this->_editable === false)
{
	?>
	<script>
		(function (i, s, o, g, r, a, m) {
			i['GoogleAnalyticsObject'] = r;
			i[r] = i[r] || function () {
					(i[r].q = i[r].q || []).push(arguments)
				}, i[r].l = 1 * new Date();
			a = s.createElement(o),
				m = s.getElementsByTagName(o)[0];
			a.async = 1;
			a.src = g;
			m.parentNode.insertBefore(a, m)
		})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');

		ga('create', 'UA-69496431-1', 'auto');
		ga('send', 'pageview');

	</script>
	<?php
}
?>
</body>
</html>