<?php
	$scriptversion = 0.4;
	
	if ($page == "cat") {
		$sorttable = "[[0,'asc']]";
	} else {
		$sorttable = "[[0,'desc']]";
	}
	
	$sitequery = 'select * from settings;';
	$siteresult = mysql_query($sitequery,$connection) or die(mysql_error());
	
	//Create site settings variables		
	$siteinfo = mysql_fetch_array($siteresult);
	$sitetitle = $siteinfo['title'];
	$siteurl = $siteinfo['url'];
	$logo = $siteinfo['logourl'];
	$statcode = $siteinfo['statcode'];
	$skipqueue = $siteinfo['skipqueue'];
	
	
	$query = "select * from admins;"; 
	$result = mysql_query($query,$connection) or die(mysql_error());
	$info = mysql_fetch_assoc($result);
	$adminemail = $info['email'];
	$adminuser = $info['username'];
	$adminname = $info['name'];
	$avatar = $info['avatar'];

?>

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">

		<!-- iPhone, iPad and Android specific settings -->	
		<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1;">
		<meta name="apple-mobile-web-app-capable" content="yes" />
		<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
		
		<title><?php echo $metatitle; ?></title>
		
		<!-- Create an icon and splash screen for iPhone and iPad -->
		<link rel="apple-touch-icon" href="images/iOS_icon.png">
		<link rel="apple-touch-startup-image" href="images/iOS_startup.png"> 

		<link rel="stylesheet" type="text/css" href="css/all.css" media="screen">
		
		<!--[if IE 6]><link rel="stylesheet" type="text/css" href="css/ie6.css" media="screen" /><![endif]-->
		<!--[if IE 7]><link rel="stylesheet" type="text/css" href="css/ie.css" media="screen" /><![endif]-->
			
		<!-- Load JQuery -->		
		<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>

		<!-- Load JQuery UI -->
		<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
		
		<!-- Load Interface Plugins -->
		<script src="js/plugins.js"></script>
		
		<script type="text/javascript" src="js/quicksand/jquery.quicksand.js"></script>
		<script type="text/javascript" src="js/quicksand/custom_sorter.js"></script>
		<script type="text/javascript" src="js/quicksand/jquery-css-transform.js"></script>
		<script type="text/javascript" src="js/quicksand/jquery-animate-css-rotate-scale.js"></script>
		<script type="text/javascript" src="js/tinyeditor/tinyeditor.js"></script>
		<script type="text/javascript" src="js/DataTables/jquery.dataTables.js"></script>
		<script type="text/javascript" src="js/slidernav/slidernav.js"></script>
		
		<!-- This file configures the various jQuery plugins for Adminica. Contains links to help pages for each plugin. -->
		<script type="text/javascript">var sorttable = <?= $sorttable ?>;</script>
		<script type="text/javascript" src="js/adminica/adminica_ui.js"></script>

		<script type="text/javascript" src="../js/tiny_mce/tiny_mce.js"></script>
		<script type="text/javascript" src="../js/tiny_mce/tiny_mce_init.js"></script>


	</head>
	<body>