{* 
//////
//    @version [ Wainuiomata ]
//    @package hwdVideoShare
//    @copyright (C) 2007 - 2009 Highwood Design
//    @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
//////
//    hwdVideoShare Template System:::This template system uses the Smarty Template Engine. 
//    For full documentation, including syntax usage please refer to http://www.smarty.net 
//    or our website at http://www.hwdmediashare.co.uk   
//////
//    This file generates the display for the hwdVideoShare component homepage.
//////
//    VARIABLES AVAILBLE IN THIS TEMPLATE FILE:                                        
//    -- $print_nowlist........Only set if any videos are being watched now
//    -- $print_featured.......Only set if any videos are featured
//    -- $print_ads............Only set if hwdRevenueManager is installed   
//    -- $print_videolist......Only set if there are any videos
//    -- $list.................Array containing main video list data  
//    -- $pageNavigation.......Page navigation code 
//    -- $print_mostviewed.....Only set if there are any "most viewed" videos
//    -- $mostviewedlist.......Array containing main "most viewed" list data  
//    -- $print_mostfavoured...Only set if there are any "most favoured" videos
//    -- $mostfavouredlist.....Array containing main "most favoured" list data  
//    -- $print_mostpopular....Only set if there are any "most popular" videos
//    -- $mostpopularlist......Array containing main "most popular" list data  
//////
*}
     
{include file="header.tpl"}

<div style="clear:both;margin:5px;"></div>

{if $print_mostviewed or $print_mostviewed or $print_mostpopular}

<div class="sic-container">
  
  <div id="sic-left" class="sic-left">

    {if $print_mostviewed}
    <div class="hwdmodule-h3">
      <h2>{$title_mostviewed}</h2>
      <div class="list">
        <div class="box">
          {foreach name=outer item=data from=$mostviewedlist}
	  {if $smarty.foreach.outer.index % 2-1 == 0}
	    <div style="width: 48%; float:right;">
	  {else}
	    <div style="width: 48%; float:left;">
	  {/if}
	  {include file="video_list_simple.tpl"}
	  </div>
	  {if $smarty.foreach.outer.last}
	     <div style="clear:both;"></div>
	  {elseif $smarty.foreach.outer.index % 2-1 == 0}
	     <div style="clear:both;"></div></div><div class="box">
	  {/if}
          {/foreach}
        </div>
      </div>  
    </div>
    {/if}
    
    {if $print_ads}{if $advert4}<div class="hwdadcontainer"><div id="hwdadverts-nopadding">{$advert4}</div></div>{/if}{/if}
    
    {if $print_mostfavoured}
    <div class="hwdmodule-h2">
      <h2>{$title_mostfavoured}</h2>
      <div class="list">
        <div class="box">
          {foreach name=outer item=data from=$mostfavouredlist}
	  {if $smarty.foreach.outer.index % 2-1 == 0}
	    <div style="width: 48%; float:right;">
	  {else}
	    <div style="width: 48%; float:left;">
	  {/if}
	  {include file="video_list_simple.tpl"}
	  </div>
	  {if $smarty.foreach.outer.last}
	     <div style="clear:both;"></div>
	  {elseif $smarty.foreach.outer.index % 2-1 == 0}
	     <div style="clear:both;"></div></div><div class="box">
	  {/if}
          {/foreach}
        </div>
      </div>  
    </div>
    {/if}

    {if $print_mostpopular}
    <div class="hwdmodule-h4">
      <h2>{$title_mostpopular}</h2>
      <div class="list">
        <div class="box">
          {foreach name=outer item=data from=$mostpopularlist}
	  {if $smarty.foreach.outer.index % 2-1 == 0}
	    <div style="width: 48%; float:right;">
	  {else}
	    <div style="width: 48%; float:left;">
	  {/if}
	  {include file="video_list_simple.tpl"}
	  </div>
	  {if $smarty.foreach.outer.last}
	     <div style="clear:both;"></div>
	  {elseif $smarty.foreach.outer.index % 2-1 == 0}
	     <div style="clear:both;"></div></div><div class="box">
	  {/if}
          {/foreach}
        </div>
      </div>  
    </div>
    {/if}
  
  </div>
  
  <div class="sic-center">

{/if}

    <div style="text-align:right;margin:5px 0;">{include file='navigation_selects.tpl'}</div>
    <div class="hwdmodule-h5">
    <h2>{$title}</h2>
      <div class="list">
      {if $print_videolist}

        <div class="box">
          {foreach name=outer item=data from=$list}
          <div class="videoBox">
	  {include file="video_list.tpl"}
	  </div>
	  {if $smarty.foreach.outer.last}
	     <div style="clear:both;"></div>
	  {elseif $smarty.foreach.outer.index % $vpr-($vpr-1) == 0}
	     <div style="clear:both;"></div></div><div class="box">
	  {/if}
          {/foreach}
        </div>
      
      {else}
        <div class="padding">{$smarty.const._HWDVIDS_INFO_NRV}</div>
      {/if}
      {$pageNavigation}
      </div>  
    </div>
    
    {if $print_featured}
      <div class="hwdmodule-h3">
      {if $print_featured_player}
        {include file="featured_videos_01.tpl"}
      {else}
        {include file="featured_videos_02.tpl"}
      {/if}
      </div>
    {/if}

    {if $print_ads}{if $advert3}<div class="hwdadcontainer"><div id="hwdadverts-nopadding">{$advert3}</div></div>{/if}{/if}

    {if $print_nowlist}
      <div class="hwdmodule-h4">
        {include file="video_beingwatched.tpl"}
      </div>
    {/if}

{if $print_mostviewed or $print_mostviewed or $print_mostpopular}

  </div>
</div>

{/if}

<div style="clear:both;"></div>

{if $print_mostviewed or $print_mostviewed or $print_mostpopular}
{literal}
<script language='javascript' type='text/javascript'>
	var fullWidth = document.getElementById("hwdvids").offsetWidth;
	var sideWidth = fullWidth - {/literal}{$flvplay_width}{literal};
	document.getElementById("sic-left").style.width = sideWidth + "px";
</script>
{/literal}
{/if}

{include file="footer.tpl"}
