<div align="center">
			
				<div id="main_top"></div>
				<div id="main_mid" style="min-height:250px;">
				<?php if(!LOGGED_IN) { ?>
				<link rel="stylesheet" href="web-gallery/static/styles/frontpage.css" type="text/css">
<div style="background: url(images/home.png) no-repeat; height:270px;">

<div id="join-now-button-container" style="top:0px; left:2px;">
        <div id="join-now-button-wrapper" style="display: block;">
<div class="join-now-alternative">
                <center><a href="./quickregister/start" class="newusers" onclick="startRegistration(); return false;"><b>Neu bei %ShortName%?</b></a></center>
            </div>            <div class="join-now-button">
                <a class="join-now-link" href="quickregister/start" onclick="assistedLogin(FB); return false;"> 
                    <span class="join-now-text-big">Jetzt Gratis</span>
                    <span class="join-now-text-small"><span class="fbword">Registrieren</span></span>
                </a>
				            </div>
</div>
            </div></div>

				<?php } else { ?>
				
				<?php

$eo = 'even';

function GenerateRoomOccupancy($usersNow, $usersMax)
{
	$num = 1;
	$percentage = intval(($usersNow / $usersMax) * 100);

	if ($percentage <= 0)
	{
		$num = 1;
	}
	else if ($percentage < 35)
	{
		$num = 2;
	}
	else if ($percentage < 75)
	{
		$num = 3;
	}
	else if ($percentage < 100)
	{
		$num = 4;
	}
	else if ($percentage >= 100)
	{
		$num = 5;
	}
	
	return 'room-occupancy-' . $num;
}

?>

<h2 class="title" style="border-radius: 15px; -moz-border-radius: 15px;
-webkit-border-radius: 15px;
">Beliebte R&auml;ume</h2> 

<style type="text/css">
.room-occupancy-1 { background-image: url('/web-gallery/v2/images/rooms/room_icon_1.gif') !important; }
.room-occupancy-2 { background-image: url('/web-gallery/v2/images/rooms/room_icon_2.gif') !important; }
.room-occupancy-3 { background-image: url('/web-gallery/v2/images/rooms/room_icon_3.gif') !important; }
.room-occupancy-4 { background-image: url('/web-gallery/v2/images/rooms/room_icon_4.gif') !important; }
.room-occupancy-5 { background-image: url('/web-gallery/v2/images/rooms/room_icon_5.gif') !important; }
</style>

<div id="rooms-habblet-list-container-h124" class="recommendedrooms-lite-habblet-list-container"> 
<ul class="habblet-list"> 

<?php

$get = dbquery("SELECT * FROM rooms WHERE roomtype = 'private' ORDER BY users_now DESC LIMIT 5");

while ($room = mysql_fetch_assoc($get))
{	
	if ($eo == 'even')
	{
		$eo = 'odd';
	}
	else
	{
		$eo = 'even';
	}

	echo '<li class="' . $eo . '"> 
	<span class="clearfix enter-room-link ' . GenerateRoomOccupancy($room['users_now'], $room['users_max']) . '" title="Ga erheen" roomid="' . $room['id'] . '"> 
	<span class="room-enter">Eintreten</span> 
	<span class="room-name">' . clean($room['caption']) . '</span> 
	<span class="room-description">' . clean($room['description']) . '</span>              
	<span class="room-owner">Besitzer: <a href="%www%/room/' . clean($room['id']) . '">' . clean($room['owner']) . '</a></span> 
	</span> 
	</li>';
}

?>

<div id="room-more-data-h124" style="display: none"> 
<ul class="habblet-list room-more-data"> 

<?php

$get = dbquery("SELECT * FROM rooms WHERE roomtype = 'private' ORDER BY users_now DESC LIMIT 5,10");

while ($room = mysql_fetch_assoc($get))
{	
	if ($eo == 'even')
	{
		$eo = 'odd';
	}
	else
	{
		$eo = 'even';
	}

	echo '<li class="' . $eo . '"> 
	<span class="clearfix enter-room-link ' . GenerateRoomOccupancy($room['users_now'], $room['users_max']) . '" title="Ga erheen" roomid="' . $room['id'] . '"> 
	<span class="room-enter">Eintreten</span> 
	<span class="room-name">' . clean($room['caption']) . '</span> 
	<span class="room-description">' . clean($room['description']) . '</span>              
	<span class="room-owner">Besitzer: <a href="%www%/home/' . uberUsers::name2id($room['owner']) . '/id">' . clean($room['owner']) . '</a></span> 
	</span> 
	</li>';
}

?>

</ul> 
</div>  

</div> 
<script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script> 
				
<h2 class="title" style="background: #2767A7; border-radius: 15px; -moz-border-radius: 15px;
-webkit-border-radius: 15px;
">Dein letzter Hotel Stream</h2> 

<?php
			$uid = $users->GetUserVar(USER_ID, 'id');
			$slook = $users->GetUserVar(USER_ID, 'look');
			$q = "SELECT * FROM stream WHERE userid = '".$uid."'ORDER BY timestamp DESC LIMIT 3";
			$getStreams = dbquery($q);
			while ($a = mysql_fetch_assoc($getStreams))
			{
					$aid = $a['userid'];
					$atype = clean($a['streamtype']);
					$aextradata = clean($a['extradata']);
					$aextradata2 = clean($a['extradata2']);
					$aname = $users->GetUserVar($aid, 'username');
					$alook = $users->GetUserVar($aid, 'look');
					$timestamp = $a['timestamp'];
					$datum = date("d.m.Y",$timestamp);
					$uhrzeit = date("H:i",$timestamp);
			?>
			
			<div style="height:75px; background: url(http://www.habbo.de/habbo-imaging/avatarimage?figure=%look%) no-repeat no-repeat;">
			<div style="padding-left:70px;">
			<?php if($atype == "badge") { ?>
												<div style="background: url(http://images.lukadora.de/swf/c_images/Quests/achievement_inactive.png); width:62px; height:60px; float:right; margin-top:10px;">
			<img style="padding-top: 12px; padding-right:12px;" src="http://images.lukadora.de/swf/c_images/album_1584/<?php echo $aextradata; ?>.gif" align="right">
			</div>
			<h2><?php echo $aname; ?></h2>
			<h3>Du hast ein neues Badge erhalten!</h3>
			<h3>Datum: <?php echo $datum," - ",$uhrzeit," Uhr"; ?>
			<?php } else if($atype == "mission") { ?>
						<img style="padding-top: 12px; padding-right:12px; margin-top:10px;" src="http://images.lukadora.de/swf/c_images/Quests/explore.png" align="right">
			<h2><?php echo $aname; ?></h2>
			<h3>Du hast eine neue Mission: <?php echo $aextradata; ?></h3>
			<h3>Datum: <?php echo $datum," - ",$uhrzeit," Uhr"; ?>
			
			<?php } ?>
			<hr>
			</div>
			</div>
			
			<?php } ?>
			</br></br>
				<?php } ?>
				
                <span class="close"></span>
				
        </div>	
<div id="main_bot">
</div>	
</div>			