<?php
/**
* @version		$Id: mod_vworldclock.php 2009-12-05 vinaora $
* @package		Vinaora World Time Clock
* @copyright	Copyright (C) 2007-2010 VINAORA.COM. All rights reserved.
* @license		GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/

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

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

// variable for clock
$wtsclock 		= $params->get('wtsclock', "wtsclock001.swf");
$random			= $params->get('random', false);
$color			= $params->get('color', "C00000");
$custom_color	= $params->get('custom_color', "");
$wtsid			= $params->get('wtsid', "VN");
$wmode			= $params->get('wmode', "");

$size			= (int)$params->get('size', 100);

// other variables
$pretext	= $params->get('pretext', "");
$posttext	= $params->get('posttext', "");


if ( !empty($custom_color) ){
	$color = $custom_color;
}

if( $random ){
	$color_array	= array("000000", "ff7f50", "808000", "87ceeb", "800000", "cc6600", "228b22", "6495ed", "c00000", "ff9900", "32cd32", "000ff2", "ff0000", "ffcc33", "90ee90", "000080", "ff1493", "ffff00", "00ff00", "800080", "ffc0cb", "ffff99", "008080", "9932cc");
	$color_number 	= mt_rand(0, count($color_array)-1);
	$color 			= $color_array[$color_number];
}

JHTML::script("clock.js", "modules/mod_vworldclock/");

require(JModuleHelper::getLayoutPath('mod_vworldclock'));
?>