<?php
/**
* @version 1.0.0
* @package RSEvents! 1.0.0
* @copyright (C) 2009 www.rsjoomla.com
* @license GPL, http://www.gnu.org/copyleft/gpl.html
*/

defined( '_JEXEC' ) or die( 'Restricted access' );

define('RSE_RS_PRODUCT','RSEvents!');
define('RSE_RS_VERSION','1.0.0');
define('RSE_RS_REVISION','15');
define('RSE_RS_KEY','EV8SK739H1');
define('RSE_RS_COPYRIGHT','&copy;2007-2009 www.rsjoomla.com');
define('RSE_RS_LICENSE','GPL License');
define('RSE_RS_AUTHOR','<a href="http://www.rsjoomla.com" target="_blank">www.rsjoomla.com</a>');

global $mainframe;

$rseventsConfig = $mainframe->getUserState('rseventsConfig');
if($rseventsConfig['enable.debug'])
{
	error_reporting(E_ALL);
	ini_set('display_errors',true);
}

require_once(JPATH_COMPONENT.DS.'controller.php');
require_once(JPATH_COMPONENT.DS.'helpers'.DS.'rsevents.php');
require_once(JPATH_COMPONENT.DS.'helpers'.DS.'calendar.php');

if ($controller = JRequest::getWord('controller'))
{
	$path = JPATH_COMPONENT.DS.'controllers'.DS.$controller.'.php';
	if (file_exists($path))
		require_once $path;
	else
		$controller = 'rsevents';
}

$classname	= 'rseventsController'.$controller;
$controller	= new $classname();

$controller->execute(JRequest::getVar('task'));
$controller->redirect();