<?php
	session_start();
	require_once("../site_settings.php");
	require_once("../PageBuilder.class.php");
	require_once("../xajax_functions.php");
	
	//error_reporting(E_ALL | E_STRICT);
	//ini_set('display_errors',1); 

	$pb = new PageBuilder();
	$myxa = new xajax();
	$pb->initXajaxFunctions($myxa);
	
	if(! isset($_REQUEST['xjxr']))
	{
		$smrty = new MySmarty();
	
		$page = $pb->build();
		$page->displayPage($smrty);
		$pb->loadCompliments($smrty);
		
		/*if($smrty->templateExists($_GET['var1'].".tpl"))*/
		if(file_exists("./templates/".$_GET['var1'].".tpl"))
			$smrty->assign('exists', 1);
		
		$smrty->assign('year', date('Y'));
		$smrty->assign('xajax', $myxa->getJavascript());
		$smrty->display('index.tpl');
	}
?>
