<?php include_once($pth['folder']['template'] . 'templatefuncs/templatefuncs.php'); ?>
<!DOCTYPE html>

<html lang="<?php echo $sl;?>">
<head>
<?php echo head();?>
<script src="<?php echo $pth['folder']['template'];?>scripts/smoothscroll.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=1">

<?php 
if(!($adm && $edit) && !$su && !trim($o))
{
	$opm = true;
}

if($adm && $edit) 
{
echo '
<style>
header {display: none;}
.tplge_content {background: #fff;}
</style>
';
}

if($adm && $cmsimple_debugMode) 
{
echo '
<style>
.tplge_onePageToc {margin-top: 60px;}
.tplge_topMenu {margin-top: 58px; z-index: 1;}
</style>
';
}

if($adm && !$cmsimple_debugMode) 
{
echo '
<style>
.tplge_onePageToc {margin-top: 38px;}
.tplge_topMenu {margin-top: 36px; z-index: 1;}
</style>
';
}

if($adm && !$edit && $_SERVER['QUERY_STRING'] != "" && $s>=0) header('Location: ?#cmsimpleOnePage' . $s+1);

if(!isset($opm)) 
{
	echo '
<style>
.tplge_sitename {margin-top: -0.5em;}
.tplge_content {background: #fff; color: #333;}
</style>
';
}
?>
</head>



<body id="body" class="body" <?php echo onload();?>>
<!-- utf-8 check: äöüß -->
<div id="top"><div id="TOP"></div></div>






<!-- WEBSITE CONTAINER -->

<div class="tplge_websiteContainer">





<!-- TOP MENU -->

<nav id="tplge_topMenu" class="tplge_topMenu">


<!-- toc -->

<?php 
if(!$edit)
{
	echo '
<div class="tplge_homelink"><a href="./"><img src="' . $pth['folder']['templateimages'] . 'homelink.gif" title="' . $tx['menu']['top'] . '" alt="' . $tx['menu']['top'] . '"></a></div>
<ul>
<li><a href="#top"><img src="' . $pth['folder']['templateimages'] . 'scrolltotop_menu.gif" alt="toplink"></a></li>
';

	foreach($hc as $page)
	{
		if($l[$page] == '1') echo '
<li><a href="./#cmsimpleOnePage' . ($page+1) . '" onclick="document.getElementById(\'tplge_olMenu\').style.display=\'none\'; document.getElementById(\'tplge_olMenuBG\').style.display=\'none\'">' . $h[$page] . '</a></li>';
	}

	//echo 
'<li><a href="./?Datenschutzerklaerung">Datenschutzerklärung</a></li>
<li><a href="./?AGB">AGB</a></li>';
	if($cf['mailform']['email'] != '')echo '<li><a href="./?mailform">' . $tx['menu']['mailform'] . '</a></li>';

	echo '
</ul>' . "\n\n";
}
else
{
	echo toc(1,1,0);
}
?>

</nav>

<!-- END TOP MENU -->





<!-- OVERLAY MENU -->

<nav id="tplge_olMenu" class="tplge_olMenu">

<!-- close button -->
<button id="tplge_olMenuClose" class="tplge_olMenuClose" onclick="document.getElementById('tplge_olMenu').style.display='none'; document.getElementById('tplge_olMenuBG').style.display='none'">X</button>

<!-- toc -->
<div class="tplge_olMenuToc">

<?php 
if(!$edit)
{
	echo '<div class="tplge_homelink"><a href="./" onclick="document.getElementById(\'tplge_olMenu\').style.display=\'none\'; document.getElementById(\'tplge_olMenuBG\').style.display=\'none\'"><img src="' . $pth['folder']['templateimages'] . 'homelink.gif" title="' . $tx['menu']['top'] . '" alt="' . $tx['menu']['top'] . '"></a></div>
<ul>
';

	foreach($hc as $page)
	{
		if($l[$page] == '1') echo '
<li><a href="./#cmsimpleOnePage' . ($page+1) . '" onclick="document.getElementById(\'tplge_olMenu\').style.display=\'none\'; document.getElementById(\'tplge_olMenuBG\').style.display=\'none\'">' . $h[$page] . '</a></li>';
	}

	if($cf['mailform']['email'] != '')echo '<li><a href="./?mailform">' . $tx['menu']['mailform'] . '</a></li>';

	echo '
</ul>' . "\n\n";
}
else
{
	echo toc();
}
?>

</div>
</nav>


<!-- overlay menu button -->
<nav class="tplge_onePageToc">
<div class="tplge_onePageTocIn">
<img src="<?php echo $pth['folder']['templateimages'];?>menulink.gif" class="tplge_menulink" alt="" onclick="document.getElementById('tplge_olMenu').style.display='block'; document.getElementById('tplge_olMenuBG').style.display='block'">
</div>
</nav>

<!-- overlay background -->
<div id="tplge_olMenuBG" class="tplge_olMenuBG" onclick="document.getElementById('tplge_olMenu').style.display='none'; document.getElementById('tplge_olMenuBG').style.display='none'"></div>

<!-- END OVERLAY MENU -->





<!-- HEADER -->

<header>

<div class="tplge_langmenu_container">
<?php echo languagemenu();?>
<br>
</div>

<div class="tplge_sitename">
<?php echo $cf['site']['title'];?>
</div>

<?php /*
if(!$edit && !isset($_REQUEST['login']) && !isset($_REQUEST['logout']) && !isset($_REQUEST['mailform']) && !isset($admin))
{
	echo '<img src="' . $pth['folder']['templateimages'] . 'header.jpg" class="tplge_headerimage" alt="headerimage">
';
}*/
?>

</header>
<div class="tplge_clearBoth"></div>





<!-- CONTENT -->

<div id="tplge_content" class="tplge_content">

<!-- onepage contents -->
<?php 
if(!($adm && $edit) && !$su && !trim($o))
{
	foreach($hc as $key => $page)
	{
		if($l[$page] == '1') echo '
<div id="cmsimpleOnePage' . ($page+1) . '" class="tplge_page' . ($key+1) . '">
<article class="tplge_innerContainer">
' . tf_onepage($h[$page]) . '
</article>
<div style="clear: both;"></div>
</div>
';
	}
}
else 
{
	echo '
<article class="tplge_innerContainer">
' . content() . '
</article>
';
}
?>

<div class="tplge_clearBoth"></div>

</div>





<!-- FOOTERS CONTAINER -->

<div id="tplge_footersContainer" class="tplge_footersContainer">

<!-- footer links -->
<p>
<span><a href="./?sitemap">sitemap</a></span>
<!-- 
<span><a href="./"><?php echo $tx['locator']['home']; ?></a></span>
<span><a href="./?Kontakt">Kontakt</a></span>
<span><a href="./?Impressum">Impressum</a></span>
<span><a href="./?Datenschutzerklaerung">Datenschutzerklärung</a></span>
<span><a href="./?AGB">AGB</a></span>
 -->
<span>Powered by <a href="http://www.cmsimple.org/en/">CMSimple</a></span>
<span>Template: <a href="http://www.ge-webdesign.de/cmsimpletemplates/">ge-webdesign.de</a></span>

<span><?php echo loginlink();?></span>
</p>

<!-- Open TOC for backend (to reach pages higher menulevel 1) -->
<?php if($adm) echo '<div style="font-size: 18px; color: #fff;text-align: left; padding: 20px;">' . toc(1,3,1) . '</div>';?>

</div>

<!-- END FOOTERS CONTAINER -->





<div class="tplge_clearBoth"></div>
</div>

<!-- END WEBSITE CONTAINER -->





<!-- scroll to top button -->

<?php echo '<div id="tplge_scrolltoTopButton" class="tplge_scrolltoTopButton"><a href="#top"><img src="' . $pth['folder']['templateimages'] . 'scrolltotop.gif" class="tplge_scrolltoTopButton" title="' . $tx['menu']['top'] . '" alt="' . $tx['menu']['top'] . '"></a></div>'; ?>

<script>
window.onscroll = function() {
    tplge_scrolltoTopButton.style.opacity = ((window.pageYOffset || document.documentElement.scrollTop) > 120) ? '1' : '0';
};
tplge_scrolltoTopButton.style.opacity = '0';
tplge_scrolltoTopButton.style.transition = 'opacity 1s';
</script>

</body>
</html>