<!--[if IE]><script language="javascript" type="text/javascript" src="/scripts/excanvas.min.js"></script><![endif]-->

<?php
/**
 * Initialize data point information setup in the Controller.
 * This will also dictate the show/hide display logic around the flot placeholders
 **/
foreach($this->trans_types as $trans_type){
	${strtolower($trans_type)."_data"} = (isset($this->results[$trans_type]) ? json_encode($this->results[$trans_type]) : "");
}
?>

<div id="loading_image" style="display: none;">
<div class="modalLoading">
<b><?=$this->translate->_("LOADING...")?></b><br />
<img src="/images/loading.gif" />
</div>
</div>

<div id="content">
<div id="bread"><a href=""><?=$this->translate->_("home")?></a> &gt; <a
	href="/analytics/releaseanalytics"><?=strtolower($this->translate->_("release analytics"))?></a>
&gt; <span class="active"><?=$this->translate->_("sales overview")?></span></div>
<h1 class="float-left"><?=$this->translate->_("release analytics")?>: <span
	class="subheading"><?=$this->translate->_("Sales Overview")?></span></h1>

<?php if(count($this->available_stores)){
if(in_array(1,array_keys($this->available_stores))){?>
<div class="analyticsBackBtn" id="heat_map_link_container">
<a id="heat_map_link" class="salesMapLink" href="<?=$this->heatmap_link?>"><img src="/images/analytics/map.png"/><?=$this->translate->_("iTunes Sales Map")?></a>
</div>
<?php }}?>
<div class="clear"></div>
<!-- Start Header -->
<?php
//Render filter header
echo $this->releaseanalyticsfilters();
?>

<!-- End Header -->


<div class="analyticsContainer"><!-- No information panel -->
<?php
if($this->noinfo){
	?>
<div id="noInfo"><?=$this->translate->_("no sales")?></div>
<?php
}else{
	?>
<!-- Flot placeholder for DA channel -->

<div>
<div class="analyticsTopHelp float-left">
<div class="graphDetailsHelp"><img src="/images/icons/graph.png"
	class="graphImage" /><?=$this->translate->_("Click for details")?></div>
<img src="/images/icons/arrow_down.png" class="arrowDown" /></div>

<?php
	//Render presets
	echo $this->releaseanalyticspresetbar()?>

<div class="clear"></div>
<?php
	foreach($this->trans_types as $trans_type){
		if(in_array($trans_type,$this->trans_type_has_sale)){
			$channel = Alw_Model_Channel::getChannelByCode($trans_type);
?>
	<div>
	<div class="channelInfo<?=$channel->css_name?>"
		onclick="$('input[name=\'channel\']').val('<?=$trans_type?>'); $('#frm_goto_channel').submit()">
	<div class="channelTotal">
	<p><?=$this->translate->_($channel->title)?></p>
	<p id="channel<?=$channel->css_name?>Count" class="channelNumber channel<?=$channel->css_name?>">0</p>
	</div>
	</div>
	<div id="placeholder<?=$trans_type?>" class="channelGraph"></div>
	</div>
<?php
		}
	}

?>


<div id="tool_tip" class="graphTooltip"></div>

</div>
<div class="clear"></div>

<div class="analyticsDisclaimer smalltext">
<p><a href="/analytics/salesfeedinfo" class="salesMapLink"><img src="/images/icons/getinfo.png"/><?=$this->translate->_("more about our sales feeds")?></a></p>
<p><span class="subtextlink"><strong><?=$this->translate->_("Please Note")?></strong></span><?=$this->translate->_("Analytics disclaimer")?></p>
</div>

<?php
}
?>
</div>
</div>
<script language="javascript" type="text/javascript">
<?php
foreach($this->trans_types as $trans_type){
	if(in_array($trans_type,$this->trans_type_has_sale)){
		$channel = Alw_Model_Channel::getChannelByCode($trans_type);
?>
	genereateNewLineChart("channel<?=$channel->css_name?>Count", "placeholder<?=$trans_type?>", "<?=$channel->graph_color?>", <?=${strtolower($trans_type)."_data"}?>);
<?php }
}?>
</script>

<div id="modal_overlay" class="modal-background"><div id="modal_container"></div></div>