<?php
/**
 * @version		$Id: default.php 114 2009-06-16 12:25:08Z eddieajau $
 * @package		TAOJ.Quanta
 * @subpackage	com_quanta
 * @copyright	Copyright (C) 2009 New Life in IT Pty Ltd. All rights reserved.
 * @license		GNU General Public License <http://www.gnu.org/copyleft/gpl.html>
 * @link		http://www.theartofjoomla.com
 */

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

JHtml::script('swfobject.js', 'components/com_quanta/media/js/');

switch ($this->item->chart_version) :
	case 'dz':
		$swf = 'open_flash_chart_dz.swf';
		break;
	case 'dz-full':
		$swf = 'open_flash_chart_dz_full.swf';
		break;
	default:
		$swf = 'open_flash_chart_2.swf';
		break;
endswitch;

?>
<script type="text/javascript">
function ofc_ready() {}
function com_quanta_chart_<?php echo (int) $this->item->id;?>_data()
{
	return '<?php echo json_encode(json_decode($this->item->code));?>';
}
swfobject.embedSWF('<?php echo $this->baseurl;?>/components/com_quanta/media/flash/<?php echo $swf;?>',
	'com_quanta_chart_<?php echo (int) $this->item->id;?>',
	'<?php echo (int) $this->item->chart_width;?>',
	'<?php echo (int) $this->item->chart_height;?>',
	'9.0.0',
	'expressInstall.swf',
	{'get-data':'com_quanta_chart_<?php echo (int) $this->item->id;?>_data',
	 'id':'com_quanta_chart_<?php echo (int) $this->item->id;?>'}
	);
</script>

<h2><?php echo $this->item->title;?></h2>

<div id="com_quanta_chart_<?php echo (int) $this->item->id;?>">
<?php echo JText::_('Quanta_Error_chart_cannot_display');?>
</div>

<?php echo $this->item->description;?>
