</div><!--gbox-->

<div class="pageLoader fixed"></div>
<div class="cover scrolls fixed"></div>
<div class="toast fixed fontn size14"><div class="icn icon-info-large ibl abs"></div><div class="toast-msg msg ibl"></div></div>
<script src="<?php echo baseurl; ?>js/jq.js"></script>
<script src="<?php echo baseurl; ?>js/core.js"></script>
<script src="<?php echo baseurl.'js/app.js?'.time(); ?>"></script>
<?php 
if(true===$z->isAdmin($session)){
	echo '<script src="'.baseurl.'js/adm.js?'.time().'"></script>';
}
if($session->result!="ok"){ ?>
<script src="//apis.google.com/js/platform.js?onload=OnGoogleLoad" async defer></script>
<?php } ?>
<script>zuz.base="<?php echo baseurl; ?>";zuz.cbase="<?php echo cookieurl; ?>";zuz.app="<?php echo baseurl.'do/'; ?>";zuz.canDownload=<?php echo $z->getSetting("allow_download") == 'yes' ? 'true' : 'false'; ?>;<?php if($session->result=="ok"){ 
	echo 'zuz.me={ID:"'.$hash->encode($session->ID).'",token:"'.$z->encode($_COOKIE[user_cookie].'@@'.time()).'" };zuz.googleGA="'.strtoupper($z->getSetting("google_ga")).'";zuz.me.playlists=[';
	$plist = $z->select("SELECT * FROM playlists WHERE uid=? AND status=? ORDER BY label ASC", array($session->ID, 'yes'), "is");
	if($plist->result=="ok" && $plist->count > 0){
		for($n = 0; $n < count($plist->fetch); $n++):
			echo '{ID:"'.$hash->encode($plist->fetch[$n]->ID).'",title:"'.stripslashes($plist->fetch[$n]->label).'",count:'.$plist->fetch[$n]->tracks.'}';
			echo $n < count($plist->fetch) - 1 ? "," : "";
		endfor;				
	}else{
		$pnwe = $z->insert("INSERT INTO playlists (uid,label) VALUES(?,?)",array($session->ID,"Favorites"),"is");
		echo '{ID:"'.$hash->encode($pnwe->ID).'",title:"Favorites",count:0}';
	}
	echo '];';
	if($session->type=="admin" || $session->type=="moderator"){
		echo 'zuz.audioFormats="'.$z->getSetting("formats").'";zuz.genres=[';
		$genres = $z->select("SELECT * FROM genres WHERE status=? ORDER BY title ASC", array("yes"), "s");
		if($genres->result=="ok" && $genres->count > 0){
			for($n = 0; $n < count($genres->fetch); $n++):
				echo '{ ID: "'.$hash->encode($genres->fetch[$n]->ID).'",label:"'.$genres->fetch[$n]->title.'", count: "'.number_format($genres->fetch[$n]->tracks).'" }';
				echo $n < count($genres->fetch) - 1 ? "," : "";
			endfor;
		}
		echo '];zuz.albums=[';
		$albums = $z->select("SELECT * FROM albums WHERE status=? ORDER BY title ASC", array("yes"), "s");
		if($albums->result=="ok" && $albums->count > 0){
			for($n = 0; $n < count($albums->fetch); $n++):
				echo '{ ID: "'.$hash->encode($albums->fetch[$n]->ID).'", label:"'.$albums->fetch[$n]->title.'", cover: "'.baseurl.'photo/album/'.$z->encode($albums->fetch[$n]->photo).'/default.jpg", count: "'.number_format($albums->fetch[$n]->tracks).'" }';
				echo $n < count($albums->fetch) - 1 ? "," : "";
			endfor;
		}
		echo '];';
	}
}else{ 
	echo 'zuz.googleClient="'.GOOGLE_CLIENT_ID.'";';
} ?></script>