<?php
if (!isset($_SESSION["user"])) {
	cout('
	<div id="header">
		<div style="height:90px;margin:5px;float:left;"><a href="/'.adminFolder.'/"><img height="90" src="/'.adminFolder.'/img/logo_90p.png" alt="ABC66 Logo" /></a></div>
	</div>
	');
} else {
	cout('
	<div id="header">
		<div style="height:90px;margin:5px;float:left;"><a href="/'.adminFolder.'/"><img height="90" src="/'.adminFolder.'/img/logo_90p.png" alt="ABC66 Logo" /></a></div>
		<div style="float:right;border:0px red solid;margin:0 10px 0 0;">
			<div class="specialMenu" style="height:35px;float:none;margin:0 0 5px 0;">
				<!--
				<a class="linkButt toplink-turney-members" href="/'.adminFolder.'/tournament/members/"><span class="notif"></span> Tourney Members</a>
				<a class="linkButt toplink-turney-deposit" href="/'.adminFolder.'/tournament/deposits/"><span class="notif"></span> Tourney Deposits</a>
				<a class="linkButt toplink-bank" href="#" onclick="loadBank();return false;">Refresh Bank</a>
				-->
				<a class="linkButt toplink-deposit" href="/'.adminFolder.'/deposits/"><span class="notif"></span> Deposits</a>
				<a class="linkButt toplink-withdraw" href="/'.adminFolder.'/withdrawals/"><span class="notif"></span> Withdrawals</a>
				<!--
				<a class="linkButt toplink-transfer" href="#"><span class="notif"></span> Transfers</a>
				-->
				<a class="linkButt toplink-member" href="/'.adminFolder.'/members/"><span class="notif"></span> Members</a>
				<div class="customSelectBox">
					<div class="act">Welcome, '.$_SESSION["user"]["inisial"].' <a href="#" onclick="return false;"><img src="/'.adminFolder.'/img/arrow-black-south.png" alt="" /></a></div>
					<div class="customSelectBoxOptions hide">
						<div class="balloonTail"></div>
						<div class="options">
							<div class="option"><a href="/'.adminFolder.'/change-password/">Change Password</a></div>
							<div class="option"><a href="/'.adminFolder.'/logout/">Logout</a></div>
						</div>
					</div>
				</div>
				<script>
					$(document).ready(function(){
						$(".customSelectBoxOptions").bind("mouseenter", function(){
							$(".customSelectBoxOptions").removeClass("outside").addClass("inside");
						});
						$(".customSelectBoxOptions").bind("mouseleave", function(){
							$(".customSelectBoxOptions").removeClass("inside").addClass("outside");
						});
						$(".customSelectBox .act").bind("click", function(){
							if ($(".customSelectBoxOptions").hasClass("show")) {
								$(".customSelectBoxOptions").fadeOut("500", function(){
									$(".customSelectBoxOptions").removeClass("show").addClass("hide");
									$(".customSelectBoxOptions").removeClass("outside").removeClass("inside");
									$(".customSelectBoxOptions").unbind("mouseenter");
									$(".customSelectBoxOptions").unbind("mouseleave");
								});
							} else {
								$(".customSelectBoxOptions").fadeIn("500", function(){
									$(".customSelectBoxOptions").removeClass("hide").addClass("show");
									setTimeout(function(){
										$(".customSelectBoxOptions").bind("mouseenter", function(){
											$(".customSelectBoxOptions").removeClass("outside").addClass("inside");
										});
										$(".customSelectBoxOptions").bind("mouseleave", function(){
											$(".customSelectBoxOptions").removeClass("inside").addClass("outside");
										});
										$("html").bind("click", function(){
											if ($(".customSelectBoxOptions").hasClass("outside")) {
												$(".customSelectBoxOptions").fadeOut("500", function(){
													$(".customSelectBoxOptions").removeClass("show").addClass("hide");
													$(".customSelectBoxOptions").removeClass("outside").removeClass("inside");
													$(".customSelectBoxOptions").unbind("mouseenter");
													$(".customSelectBoxOptions").unbind("mouseleave");
												});
											}
										});
									}, 100);
								});
							}
						});
					});
				</script>
			</div>
			
			
			<script>
				$(".kotak-bank").bind("mouseenter", function(){
					$(".kotak-bank").css({ "overflow":"visible" });
				});
				$(".kotak-bank").bind("mouseleave", function(){
					$(".kotak-bank").css({ "overflow":"hidden" });
				});
			</script>
		</div>
		<!--
		<div class="BankOnOff" style="float:right;"></div>
		<iframe id="BankOnOff" src="/'.adminFolder.'/_ajax/index.php" frameborder="0" style="border:0px red solid;" scrolling="no" width="500" height="105"></iframe>
		-->
	</div>');
	$rsmm=array(); $qmm="SELECT * FROM _admin_page_cats WHERE isactive=1 ORDER BY kdpagecat";
	callRS($rsmm, $qmm);
	cout('<div class="one-line-menu">');
		cout('<div class="helper">');
			cout('<ul id="nav">');
				cout('<li>');
					cout('<a href="/'.adminFolder.'/">Home</a>');
				cout('</li>');	
			for ($mm=0;$mm<count($rsmm);$mm++) {
				$spesial = intval($rsmm[$mm]["kdpagecat"])==6?' turney ':'';
				cout('<li class="'.$spesial.'">');
					cout('<a class="'.$spesial.'" href="#">'.$rsmm[$mm]["cat_label"].'</a>');
					$rsmm2=array();$qmm2="SELECT * FROM _admin_pages WHERE kdpagecat='".$rsmm[$mm]["kdpagecat"]."' AND isactive=1 ORDER BY kdpage";
					callRS($rsmm2, $qmm2);
					if (count($rsmm2)!=0) {
						cout('<ul>');
						for ($mm2=0;$mm2<count($rsmm2);$mm2++) {
							$specialDP = $rsmm2[$mm2]["page_name"]=="deposits" && $rsmm[$mm]["kdpagecat"]!=4?' deposits ':'';
							$specialWD = $rsmm2[$mm2]["page_name"]=="withdrawals" && $rsmm[$mm]["kdpagecat"]!=4?' withdrawals ':'';
							cout('<li class="'.$specialDP.' '.$specialWD.'">
								<a class="'.$specialDP.''.$specialWD.'" href="/'.adminFolder.'/'.$rsmm2[$mm2]["url"].'/">'.$rsmm2[$mm2]["page_label"].'</a>
							</li>');
						}
						cout('</ul>');
					}
				cout('</li>');
			}
				cout('<li>');
					cout('<a href="#">Welcome, '.$_SESSION["user"]["inisial"].'</a>');
					cout('<ul>');
						cout('<li><a href="/'.adminFolder.'/change-password/">Change Password</a></li>');
						cout('<li><a href="/'.adminFolder.'/logout/">Logout</a></li>');
					cout('</ul>');
				cout('</li>');	
			cout('</ul>');
		cout('</div>');
	cout('</div>');
}
?>