$groupName = $params->get('groupName');
$thumbQuality = intval($params->get('thumbQuality', 80), 10);
if (!defined('ASIDO_GD_JPEG_QUALITY'))
	define('ASIDO_GD_JPEG_QUALITY', $thumbQuality);

if (empty($groupName)) $params->set('groupName', uniqid('asexy_'));
$autoShow = $params->get('autoShow');
$showOnClose = $params->get('showOnClose');
$mParams = AriParametersHelper::flatParametersToArray($params);
AriSexyLightboxHelper::includeAssets(
	AriUtils2::parseValueBySample($params->get('includeJQuery'), true),
	AriUtils2::parseValueBySample($params->get('noConflict'), true),
	AriUtils2::parseValueBySample($params->get('jQueryVer', '1.4.4'), '1.4.4'),
	AriUtils2::getParam($mParams, 'opt', array()));

AriSexyLightboxHelper::activateAutoShow(
	trim($params->get('groupName', '')), 
	$autoShow, 
	$params->get('unique', 'aslmod_' . $module->id),
	AriUtils2::getParam($mParams, 'cookie'));
	
AriSexyLightboxHelper::activateAutoShowOnClose(
	trim($params->get('groupName', '')),
	$params->get('onCloseMessage'), 
	$showOnClose, 
	$params->get('unique', 'aslmod_' . $module->id),
	AriUtils2::getParam($mParams, 'cookie'));

$activeType = $params->get('activeType', 'imagelist');
AriSexyLightboxHelper::executeModel($activeType, $mParams, dirname(__FILE__) . DS . 'includes' . DS . 'templates' . DS);
?>
	function executeModel($model, $params, $templatePath)
	{
		$modelParams = isset($params[$model]) ? $params[$model] : null;
		$filter = JFilterInput::getInstance();
		$model = ucfirst($filter->clean($model, 'WORD'));
		if (empty($model))
		{
			AriSexyLightboxHelper::executeErrorModel($params, $templatePath);
			return ;
		}
		else
		{
			$modelName = 'SexyLightbox' . $model . 'Model';
			$modelPath = dirname(__FILE__) . DS . 'Models' . DS . 'class.' . $modelName . '.php';

			if (!@file_exists($modelPath))
			{
				AriSexyLightboxHelper::executeErrorModel($params, $templatePath);
				return ;
			}
			else
			{
				AriKernel::import('SexyLightbox.Models.' . $modelName);

				$modelClass = 'Ari' . $modelName;
				$oModel = new $modelClass();
				$oModel->execute($modelParams, $params, $templatePath);
			}
		}
	}