<?php 
//die("cutlass grill");
	session_start();
	include 'mobileDetect.php'; 
	include 'globals.php';	//globals will make db connection, get brand, etc.
	//print_r($_SESSION);
	//exit;

?>
<?
	//echo "agent ". $_SERVER['HTTP_USER_AGENT'];
	//exit;
	if($_SESSION['menu_board_only']==1){  //if site is only a menu board system with no website, redirect to admin login
		$standardRedirectURL = "/cmsadmin";
	    header('Location: '.$standardRedirectURL);
	} else {
		$mobileRedirectURL = "indexm.php";
		if($mobile_only==1){
			$standardRedirectURL = "indexm.php";
		} else {
			$standardRedirectURL = "indexs.php";
		}
		
		if((($isMobileBrowser == true) &&($_SESSION['enable_mobile']==1))||($_SESSION['mobile']==1)){
			//header('Location: '.$mobileRedirectURL); 
			//exit;
			include($mobileRedirectURL); //instead of redirecting, we now include the mobile page here
		} else {
			//header('Location: '.$standardRedirectURL); 
			//exit;
			include($standardRedirectURL); //instead of redirecting, we now include the desktop page here
		}	
	}
?>
