<?php
ob_start();
/* All Right Reserved (C) 2010;
  MyTickets;
  Writed By Fahad S. Al-ghudaier;
  faha1ad2@hotmail.com;
  www.phpx3.com;
*/
	require('include/connect.php');
	require('include/system/main.querys.php');
	require('include/system/cookies.php');
	include('include/system/Functions.php');
	include('include/system/mobile_device_detect.php');
	
	$isMobile	= $_COOKIE['isMobile'];
	
	if($_GET['NoMobile'] == 1){
		$NoMobile	= 	setcookie('isMobile',2,time()+86400,"/");
		$isMobile	= 	2;
		$ClearTemp	= 	1;
	}
	if(empty($isMobile)){
		if(mobile_device_detect(true,false,true,true,true,true,true,false,false) == true){
			$setMobile	= 	setcookie('isMobile',1,time()+86400,"/");
			$isMobile	= 1;
			$ClearTemp	= 1;
		}else{
			$setMobile	= 	setcookie('isMobile',2,time()+86400,"/");
			$isMobile	= 2;
			$ClearTemp	= 1;
		}
	}

	
	if(! @include('languages/'.$language['file'])){ error('خطأ في احضار ملف اللغة , الملف غير موجود<br />Error Getting the language file , the file doesnt exist'); }
	if(! @is_dir('style/'.$language['style_dir'])){ error('حصل خطأ في احضار الستايل , المسار خاطئ<br />Error getting the style directory , the directory is not exist'); }
	$Style_Dir		= $language['style_dir'];
	$Language_ID	= $language['id'];
	include('smarty.php');
	$smarty->assign('Style_Dir',$Style_Dir);
	$smarty->assign('Languaged_ID',$Language_ID);
	$smarty->assign('language',$language);
	$smarty->assign('options',$options);
	$smarty->assign('member',$member);
	$smarty->assign('permission',$permission);
	$smarty->assign('xlanguages',$xlanguages);
	
	if($options['allow_pages'] == 1){
		include('include/system/pages.query.php');
		$smarty->assign('pages',$pages);
	}
	
	if($options['close'] == 1 AND $permission['top_man'] == 2){
		$smarty->display('closed.htm');
		die();
	}
	include('include/system/language.changer.php');
	include('include/system/static.querys.php');
?>