<?php

/**
* YOOholidays Joomla! Module
*
* @author    yootheme.com
* @copyright Copyright (C) 2007 YOOtheme Ltd. & Co. KG. All rights reserved.
* @license	 GNU/GPL
*/

// no direct access
defined('_JEXEC') or die('Restricted access');

jimport('joomla.utilities.date');

// include the syndicate functions only once
require_once (dirname(__FILE__) . DS . 'helper.php');

global $mainframe;

$modulesRoot = "" . JURI :: root() . "modules";

$document = & JFactory :: getDocument();

$enableSnow = $params->get('snow', false);
$enableFire = $params->get('fire', false);
$enableBats = $params->get('bats', false);
?>
<script type="text/javascript">
	var mod_yooholiday_path = "<?php echo $modulesRoot."/mod_yoo_holidays/"; ?>";
</script>
<?php
if ($enableSnow == 2 ||
		$enableSnow == 1 &&
		modYOOholidaysHelper :: isDateBetween($params->get('snowActivatedDateFrom', ""),
			$params->get('snowActivatedDateTill', ""))) {

	$document->addScript("" . $modulesRoot . '/mod_yoo_holidays/snowstorm/script/snowstorm.js');
}

if ($enableFire == 2 ||
		$enableFire == 1 &&
		modYOOholidaysHelper :: isDateBetween($params->get('fireActivatedDateFrom', ""),
			$params->get('fireActivatedDateTill', ""))) {

	?>
		
	<div id="sound"></div>

	<div id="fireworks-template">
	 <div id="fw" class="firework"></div>
	 <div id="fp" class="fireworkParticle"><img src="<?php echo $modulesRoot;?>/mod_yoo_holidays/fireworks/image/particles.gif" alt="" /></div>
	</div>

	<div id="fireContainer"></div>
	<?php


	$useSound = $params->get('useSound', false);
	if ($useSound == 1) {
		$document->addScript("" . $modulesRoot . '/mod_yoo_holidays/fireworks/script/soundmanager.js');
	}
	$document->addStyleSheet($modulesRoot . '/mod_yoo_holidays/fireworks/style/fireworks.css');
	$document->addScript("" . $modulesRoot . '/mod_yoo_holidays/fireworks/script/fireworks.js');

	//modYOOholidaysHelper :: setFCParams($params->get('preconf', 2));
	modYOOholidaysHelper :: setFCParams(7);

	if ($useSound == 1) {
		?><script type="text/javascript">if (typeof(soundManagerInit)!='undefined') soundManagerInit();</script><?php
	}
}

if ($enableBats == 2 ||
		$enableBats == 1 &&
		modYOOholidaysHelper :: isDateBetween($params->get('batsActivatedDateFrom', ""),
			$params->get('batsActivatedDateTill', ""))) {

	?>	
	<div id='batsFrame'></div>
	<?php

	$document->addScript($modulesRoot . '/mod_yoo_holidays/halloween/script/halloween.js');
}
?>

