<?php
/**
 * jeGroupBuy package
 * @author J-Extension <contact@jextn.com>
 * @link http://www.jextn.com
 * @copyright (C) 2010 - 2011 J-Extension
 * @license GNU/GPL, see LICENSE.php for full license.
**/

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');

$doc   = & JFactory::getDocument();
$cssshadow 	  = JURI::base().'components/com_jegroupbuy/assets/css/shadowbox.css';
$doc->addStyleSheet($cssshadow);

$controllerName = JRequest::getCmd( 'view', 'jegroupbuy' );

switch($controllerName) {
	case 'category' :
		$controllerName = 'category';
		break;
	case 'productdetails':
		$controllerName = 'productdetails';
		break;
	case 'couponpage':
		$controllerName = 'couponpage';
		break;
	default:
		$controllerName = 'jegroupbuy';
		break;
}


//$controllerName = 'jegroupbuy';
require_once( JPATH_COMPONENT.DS.'controllers'.DS.$controllerName.'.php' );
$controllerName = 'jegroupbuyController'.$controllerName;

// Create the controller
$controller = new $controllerName();

// Perform the Request task
$controller->execute( JRequest::getCmd('task') );

// Redirect if set by the controller
$controller->redirect();

?>