<?php
$max = 1020;
$selected = $_GET["selected"];
if(!$selected) $selected = 'home';
?>
<html>

<head>
<link rel="stylesheet" href="styles.css" type="text/css" />
<style type="text/css">
.corner_left {
    width:50px;
    background-image:url('layout/corner_left.jpg');
}
.top {
    background-image:url('layout/top.jpg');
    background-repeat:repeat-x;
}
.corner_right {
    width:50px;
    background-image:url('layout/corner_right.jpg');
}
.left_orange {
    width:50px;
    background-image:url('layout/line_left_orange.jpg');
    background-repeat:repeat-y;
}
.right_orange {
    width:50px;
    background-image:url('layout/line_right_orange.jpg');
    background-repeat:repeat-y;
}
.left_both {
    width:50px;
    height:2px;
    background-image:url('layout/line_left_both.jpg');
    background-repeat:repeat-y;
}
.both {
    background-color:#bf9b2f;
}
.right_both {
    width:50px;
    height:2px;
    background-image:url('layout/line_right_both.jpg');
    background-repeat:repeat-y;
}
.left_black {
    width:50px;
    background-image:url('layout/line_left_black.jpg');
    background-repeat:repeat-y;
}
.right_black {
    width:50px;
    background-image:url('layout/line_right_black.jpg');
    background-repeat:repeat-y;
}
.black {
    background-color:black;
}
.head {
    background-color: #ffbf00;
    width: 1000px;
    height: 79px;
}
.block {
    position: absolute;
    background-color: #ffe28c;
    top: 85px;
    height: 56px;
}
.menu {
    padding: 10px;
    padding-top: 100px;
    vertical-align:top;
}
.menupoint {
    background-image: url(layout/glow_normal.jpg);
    background-repeat: no-repeat;
    width: 141px;
    height: 77px;
    text-align: center;
    font-weight: bold;
    color: white;
    font-family: BrushScript;
    font-size: 22pt;
    cursor: pointer;
    cursor: hand;
}
.menupoint img {
    position: relative;
    top: 35px;
}
</style>

<script type="text/javascript">
var old_style = "";
function menuOver(o) {
    old_style = o.style.backgroundImage;
    o.style.backgroundImage = 'url(layout/glow_over.jpg)';
}
function menuOut(o) {
    o.style.backgroundImage = old_style;
}
function swap(o) {
    reset();
    o.style.backgroundImage = 'url(layout/glow_selected.jpg)';
    old_style = o.style.backgroundImage;
}
function reset() {
    var elements = document.getElementsByName("menupoint");
    for(var i=0; i<elements.length; i++){
        var o = elements[i];
        o.parentNode.style.backgroundImage = 'url(layout/glow_normal.jpg)';
    }
}
function loadPage(action, url) {
    document.location.href = 'index.php?selected='+action;
    return;
    document.getElementsByName('main')[0].src = action+'/index.php'; //url;
    document.getElementById('topimg').src = 'layout/title_'+action+'.jpg';
}
</script>

</head>

<body>

<table cellspacing="0" cellpadding="0" border="0" style="position:absolute; top:78px; width:1030px;">
    <tr>
        <td style="text-align:right;">
            <table cellpadding="0" cellspacing="0" border="0" width="100%">
                <tr>
                    <td width="100%">&nbsp;</td>
                    <?php
                    $dir = $selected;
                    $fp=opendir($dir);
                    while($datei=readdir($fp)) 
                    {
                        $ext = strtolower(strrchr("$dir/$datei", '.'));
                        if(($ext=='.jpg' or $ext=='.gif') and is_file("$dir/$datei") and $datei!="." and $datei!="..")
                        {
                            $pic = "$dir/$datei";
                            include("layout/border/image.php");
                        }
                    }
                    ?>
                </tr>
            </table>
        </td>
    </tr>
</table>

<!--
<img src="layout/img.jpg" style="position:absolute; top:78px; left:400px;" border="0">
<img src="layout/img2.jpg" style="position:absolute; top:78px; left:600px;" border="0">
<img src="layout/img3.jpg" style="position:absolute; top:78px; left:800px;" border="0">
-->

<img src="layout/home.jpg" border="0" style="position:absolute; top:165px; left:0px; cursor:pointer;" onclick="loadPage('home');">
<img src="layout/kontakt.jpg" border="0" style="position:absolute; top:192px; left:0px; cursor:pointer;" onclick="loadPage('kontakt');">
<img src="layout/impressum.jpg" border="0" style="position:absolute; top:219px; left:0px; cursor:pointer;" onclick="loadPage('impressum');">

<img src="layout/title_<?php echo $selected;?>.jpg" id="topimg" style="position:absolute; top:68px; left:60px;" border="0">

<table width="1100" height="100%" cellpadding="0" cellspacing="0">
    <tr>
        <td height="20"></td>
        <td></td>
        <td></td>
        <td></td>
    </tr>
    <tr>
        <td class="corner_left"></td>
        <td class="top" height="30"></td>
        <td class="top" height="30"></td>
        <td class="corner_right"></td>
    </tr>
    <tr>
        <td class="left_black"></td>
        <td class="black" height="10"></td>
        <td class="black" height="10"></td>
        <td class="right_black"></td>
    </tr>
    <tr>
        <td class="left_both"></td>
        <td class="both" height="1"></td>
        <td class="both" height="1"></td>
        <td class="right_both"></td>
    </tr>
    <tr>
        <td class="left_orange"></td>
        <td class="head" colspan="2"></td>
        <td class="right_orange"></td>
    </tr>
    <tr>
        <td class="left_both"></td>
        <td class="both"></td>
        <td class="both"></td>
        <td class="right_both"></td>
    </tr>
    <tr>
        <td class="left_black"></td>
        <td class="menu black" width="150"><br>
            <?php
                $curr_action = $selected;
                $actions = array("ueber_uns", "team", "news", "verleih", "galerie", "gaeste");
                $ll = sizeof($actions);
                $ii = 0;
                foreach ($actions as $action) {
                    $style = "";
                    if ($action == $selected) {
                        $style = " style=\"background-image: url(layout/glow_selected.jpg)\"";
                        $curr_action = $actions[$ii];
                    }
$xx = $ll-$ii;
echo "<div style=\"position:relative; left:".(sin(deg2rad($xx))*100*($xx*0)).";\" onclick=\"loadPage('".$actions[$ii]."'); swap(this);\" class=\"menupoint\"".$style." onmouseover=\"menuOver(this)\" onmouseout=\"menuOut(this)\"\n";
echo "\t><img name=\"menupoint\" src=\"layout/".$action.".jpg\" border=\"0\" /></div>\n";
                    $ii = $ii + 1;
                }
            ?>
        </td>
        <td class="blackx" width="850" style="padding-top:40px; background-color:black;">
            <iframe src="<?php echo $curr_action ?>" frameborder="0" border="0" name="main"
                    style="height:100%; width:100%; background-color:black;">
                Leider unterstützt Ihr Browser keine eingebetteten Fenster (iframes).<br>
                Diese sind für die korrekte Darstellung dieser Seite zwingend erforderlich.
            </iframe>
        </td>
        <td class="right_black"></td>
    </tr>
    <tr>
        <td class="left_black"></td>
        <td class="black" height="20"></td>
        <td class="black" height="20"></td>
        <td class="right_black"></td>
    </tr>
</table>

</body>

</html>